From 9fd345daa4f6f23f3ef42be9157625c4127bb6cb Mon Sep 17 00:00:00 2001 From: Henry Coles Date: Tue, 23 Jan 2024 08:32:09 +0000 Subject: [PATCH] temporarily remove dynamic call tracking --- .../staticinitializers/StaticInitializerInterceptor.java | 7 +++++-- .../StaticInitializerInterceptorTest.java | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pitest-entry/src/main/java/org/pitest/mutationtest/build/intercept/staticinitializers/StaticInitializerInterceptor.java b/pitest-entry/src/main/java/org/pitest/mutationtest/build/intercept/staticinitializers/StaticInitializerInterceptor.java index 7bc251d82..ed8a23e97 100644 --- a/pitest-entry/src/main/java/org/pitest/mutationtest/build/intercept/staticinitializers/StaticInitializerInterceptor.java +++ b/pitest-entry/src/main/java/org/pitest/mutationtest/build/intercept/staticinitializers/StaticInitializerInterceptor.java @@ -90,8 +90,11 @@ private void analyseClass(ClassTree tree) { } private List allCallsFor(ClassTree tree, MethodTree m) { - return Stream.concat(callsFor(tree,m), invokeDynamicCallsFor(tree,m)) - .collect(Collectors.toList()); + // temporarily disable dynamic calls as they are more likely to be involved + // in storing delayed execution code within static fields. + return callsFor(tree,m).collect(Collectors.toList()); + // return Stream.concat(callsFor(tree,m), invokeDynamicCallsFor(tree,m)) + // .collect(Collectors.toList()); } private Stream callsFor(ClassTree tree, MethodTree m) { diff --git a/pitest-entry/src/test/java/org/pitest/mutationtest/build/intercept/staticinitializers/StaticInitializerInterceptorTest.java b/pitest-entry/src/test/java/org/pitest/mutationtest/build/intercept/staticinitializers/StaticInitializerInterceptorTest.java index 7e92a1ff3..644f1a972 100644 --- a/pitest-entry/src/test/java/org/pitest/mutationtest/build/intercept/staticinitializers/StaticInitializerInterceptorTest.java +++ b/pitest-entry/src/test/java/org/pitest/mutationtest/build/intercept/staticinitializers/StaticInitializerInterceptorTest.java @@ -7,6 +7,7 @@ import com.example.staticinitializers.SecondLevelPrivateMethods; import com.example.staticinitializers.SingletonWithWorkInInitializer; import com.example.staticinitializers.ThirdLevelPrivateMethods; +import org.junit.Ignore; import org.junit.Test; import org.pitest.mutationtest.engine.MutationDetails; import org.pitest.mutationtest.engine.gregor.mutators.NullMutateEverything; @@ -145,6 +146,7 @@ public void analysisDoesNotGetStuckInInfiniteLoop() { } @Test + @Ignore("temporally disabled while filtering reworked") public void filtersMutantsInEnumPrivateMethodsCalledViaMethodRef() { v.forClass(EnumWithLambdaInConstructor.class) .forMutantsMatching(inMethodStartingWith("doStuff")) @@ -154,6 +156,7 @@ public void filtersMutantsInEnumPrivateMethodsCalledViaMethodRef() { } @Test + @Ignore("temporally disabled while filtering reworked") public void filtersMutantsInLambdaCalledFromStaticInitializerInNestedEnum() { v.forClass(NestedEnumWithLambdaInStaticInitializer.TOYS.class) .forMutantsMatching(inMethodStartingWith("lambda"))