From 7c6a5e7d748dd03be97d0b93ede2a79054620bfe Mon Sep 17 00:00:00 2001 From: Henry Coles Date: Wed, 4 Sep 2024 16:22:25 +0100 Subject: [PATCH] move javaassist concern to correct package and remove dead code --- .../mocksupport}/JavassistCoverageInterceptor.java | 14 ++------------ .../mocksupport/JavassistTransformation.java | 1 - 2 files changed, 2 insertions(+), 13 deletions(-) rename pitest/src/main/java/org/pitest/{coverage/execute => mutationtest/mocksupport}/JavassistCoverageInterceptor.java (90%) diff --git a/pitest/src/main/java/org/pitest/coverage/execute/JavassistCoverageInterceptor.java b/pitest/src/main/java/org/pitest/mutationtest/mocksupport/JavassistCoverageInterceptor.java similarity index 90% rename from pitest/src/main/java/org/pitest/coverage/execute/JavassistCoverageInterceptor.java rename to pitest/src/main/java/org/pitest/mutationtest/mocksupport/JavassistCoverageInterceptor.java index ecb54d202..0f3f292b9 100644 --- a/pitest/src/main/java/org/pitest/coverage/execute/JavassistCoverageInterceptor.java +++ b/pitest/src/main/java/org/pitest/mutationtest/mocksupport/JavassistCoverageInterceptor.java @@ -12,7 +12,7 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and limitations under the License. */ -package org.pitest.coverage.execute; +package org.pitest.mutationtest.mocksupport; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; @@ -45,13 +45,8 @@ public static InputStream openClassfile(final Object classPath, // NO_UCD final String name) { try { - if (isInstrumentedClass(name)) { final byte[] bs = getOriginalBytes(classPath, name); - return new ByteArrayInputStream( - transformBytes(IsolationUtils.getContextClassLoader(), name, bs)); - } else { - return returnNormalBytes(classPath, name); - } + return new ByteArrayInputStream(transformBytes(IsolationUtils.getContextClassLoader(), name, bs)); } catch (final IOException ex) { throw Unchecked.translateCheckedException(ex); } @@ -98,9 +93,4 @@ private static InputStream returnNormalBytes(final Object classPath, } } - private static boolean isInstrumentedClass(final String name) { - return true; - } - - } diff --git a/pitest/src/main/java/org/pitest/mutationtest/mocksupport/JavassistTransformation.java b/pitest/src/main/java/org/pitest/mutationtest/mocksupport/JavassistTransformation.java index 16211b9d3..9d6220754 100644 --- a/pitest/src/main/java/org/pitest/mutationtest/mocksupport/JavassistTransformation.java +++ b/pitest/src/main/java/org/pitest/mutationtest/mocksupport/JavassistTransformation.java @@ -1,6 +1,5 @@ package org.pitest.mutationtest.mocksupport; -import org.pitest.coverage.execute.JavassistCoverageInterceptor; import org.pitest.functional.prelude.Prelude; import org.pitest.mutationtest.environment.TransformationPlugin; import org.pitest.util.Glob;