Skip to content

Commit 4635693

Browse files
authored
Merge pull request #1431 from hcoles/bug/revert_1427
revert performance regression
2 parents 11f368d + 46e6e80 commit 4635693

File tree

4 files changed

+4
-32
lines changed

4 files changed

+4
-32
lines changed

pitest-entry/src/main/java/org/pitest/mutationtest/build/intercept/equivalent/EqualsPerformanceShortcutFilter.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import org.pitest.sequence.QueryParams;
2727
import org.pitest.sequence.QueryStart;
2828
import org.pitest.sequence.SequenceMatcher;
29-
import org.pitest.util.Log;
3029

3130
public class EqualsPerformanceShortcutFilter implements MutationInterceptor {
3231

@@ -62,12 +61,6 @@ public void begin(ClassTree clazz) {
6261
public Collection<MutationDetails> intercept(
6362
Collection<MutationDetails> mutations, Mutater m) {
6463

65-
// skip for mutations to annotations on interfaces
66-
// to avoid generating empty method warnings.
67-
if (this.currentClass.isInterface()) {
68-
return mutations;
69-
}
70-
7164
final List<MutationDetails> doNotTouch = mutations.stream()
7265
.filter(inEqualsMethod().negate())
7366
.collect(Collectors.toList());
@@ -101,7 +94,7 @@ private Predicate<MutationDetails> isShortcutEquals(final MethodTree tree, final
10194

10295
private boolean shortCutEquals(MethodTree tree, MutationDetails a, Mutater m) {
10396
if (tree.instructions().isEmpty()) {
104-
Log.getLogger().warning(tree.asLocation() + " has no instructions");
97+
// occurs for mutations to annotations on interfaces
10598
return false;
10699
}
107100

pitest-entry/src/main/java/org/pitest/mutationtest/build/intercept/javafeatures/ForEachLoopFilter.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
import org.pitest.sequence.SequenceMatcher;
5050
import org.pitest.sequence.SequenceQuery;
5151
import org.pitest.sequence.Slot;
52-
import org.pitest.util.Log;
5352

5453
public class ForEachLoopFilter implements MutationInterceptor {
5554

@@ -185,12 +184,6 @@ public void begin(ClassTree clazz) {
185184
public Collection<MutationDetails> intercept(
186185
Collection<MutationDetails> mutations, Mutater m) {
187186

188-
// skip for mutations to annotations on interfaces
189-
// to avoid generating empty method warnings.
190-
if (this.currentClass.isInterface()) {
191-
return mutations;
192-
}
193-
194187
return mutations.stream().filter(mutatesIteratorLoopPlumbing().negate())
195188
.collect(Collectors.toList());
196189
}
@@ -205,7 +198,7 @@ private Predicate<MutationDetails> mutatesIteratorLoopPlumbing() {
205198
MethodTree method = maybeMethod.get();
206199

207200
if (method.instructions().isEmpty()) {
208-
Log.getLogger().warning(method.asLocation() + " has no instructions");
201+
// occurs for mutations to annotations on interfaces
209202
return false;
210203
}
211204

pitest-entry/src/main/java/org/pitest/mutationtest/build/intercept/timeout/AvoidForLoopCounterFilter.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
import org.pitest.sequence.SequenceQuery;
4747
import org.pitest.sequence.Slot;
4848
import org.pitest.sequence.SlotWrite;
49-
import org.pitest.util.Log;
5049

5150
/**
5251
* Removes mutants that effect for loop counters as these have
@@ -153,12 +152,6 @@ public void begin(ClassTree clazz) {
153152
public Collection<MutationDetails> intercept(
154153
Collection<MutationDetails> mutations, Mutater m) {
155154

156-
// skip for mutations to annotations on interfaces
157-
// to avoid generating empty method warnings.
158-
if (this.currentClass.isInterface()) {
159-
return mutations;
160-
}
161-
162155
return mutations.stream()
163156
.filter(mutatesAForLoopCounter().negate())
164157
.collect(Collectors.toList());
@@ -173,7 +166,7 @@ private Predicate<MutationDetails> mutatesAForLoopCounter() {
173166
}
174167
MethodTree method = maybeMethod.get();
175168
if (method.instructions().isEmpty()) {
176-
Log.getLogger().warning(method.asLocation() + " has no instructions");
169+
// occurs for mutations to annotations on interfaces
177170
return false;
178171
}
179172

pitest-entry/src/main/java/org/pitest/mutationtest/build/intercept/timeout/InfiniteLoopFilter.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import org.pitest.mutationtest.engine.Mutater;
2222
import org.pitest.mutationtest.engine.MutationDetails;
2323
import org.pitest.sequence.SequenceMatcher;
24-
import org.pitest.util.Log;
2524

2625
public abstract class InfiniteLoopFilter implements MutationInterceptor {
2726

@@ -44,12 +43,6 @@ public void begin(ClassTree clazz) {
4443
public Collection<MutationDetails> intercept(
4544
Collection<MutationDetails> mutations, Mutater m) {
4645

47-
// skip for mutations to annotations on interfaces
48-
// to avoid generating empty method warnings.
49-
if (this.currentClass.isInterface()) {
50-
return mutations;
51-
}
52-
5346
final Map<Location,Collection<MutationDetails>> buckets = FCollection.bucket(mutations, mutationToLocation());
5447

5548
final List<MutationDetails> willTimeout = new ArrayList<>();
@@ -69,7 +62,7 @@ private Collection<MutationDetails> findTimeoutMutants(Location location,
6962
}
7063
MethodTree method = maybeMethod.get();
7164
if (method.instructions().isEmpty()) {
72-
Log.getLogger().warning(method.asLocation() + " has no instructions");
65+
// occurs for mutations to annotations on interfaces
7366
return Collections.emptyList();
7467
}
7568

0 commit comments

Comments
 (0)