Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ To use the plugin it must be placed on the classpath of the pitest tool (**not**
<dependency>
<groupId>org.pitest</groupId>
<artifactId>pitest-rv-plugin</artifactId>
<version>1.0</version>
<version>0.1</version>
</dependency>
</dependencies>
</plugin>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>org.pitest</groupId>
<artifactId>pitest-rv-plugin</artifactId>
<version>${revision}</version>

<name>pitest-rv-plugin</name>
<url>http://pitest.org</url>
<description>Research operators for pitest</description>
Expand All @@ -23,7 +23,7 @@
<junit.platform.version>1.8.0</junit.platform.version>
<junit.version>5.8.0</junit.version>
<mockito.version>2.7.6</mockito.version>
<pitest.version>1.8.0</pitest.version>
<pitest.version>1.25.9</pitest.version>
<asm.version>9.3</asm.version>
</properties>

Expand Down
3 changes: 0 additions & 3 deletions src/main/java/org/pitest/rv/ABSMutator.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ class ABSMethodVisitor extends MethodVisitor {
}

private boolean shouldMutate(String message) {
if (this.context.getClassInfo().isEnum()) {
return false;
}
final MutationIdentifier newId = this.context.registerMutation(this.factory, message);
return this.context.shouldMutate(newId);
}
Expand Down
16 changes: 5 additions & 11 deletions src/main/java/org/pitest/rv/AOD1Mutator.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public enum AOD1Mutator implements MethodMutatorFactory {

public MethodVisitor create(final MutationContext context,
final MethodInfo methodInfo, final MethodVisitor methodVisitor) {
return new AODMethodVisitor1(this, context, methodInfo, methodVisitor);
return new AODMethodVisitor1(this, context, methodVisitor);
}

public String getGloballyUniqueId() {
Expand All @@ -34,24 +34,18 @@ class AODMethodVisitor1 extends MethodVisitor {

private final MethodMutatorFactory factory;
private final MutationContext context;
private final MethodInfo info;

AODMethodVisitor1(final MethodMutatorFactory factory,
final MutationContext context, final MethodInfo info, final MethodVisitor delegateMethodVisitor) {
final MutationContext context, final MethodVisitor delegateMethodVisitor) {
super(ASMVersion.ASM_VERSION, delegateMethodVisitor);
this.factory = factory;
this.context = context;
this.info = info;
}

private boolean shouldMutate(String expression) {
if (this.info.isGeneratedEnumMethod()) {
return false;
} else {
final MutationIdentifier newId = this.context.registerMutation(
this.factory, "Replaced " + expression + " operation with first member");
return this.context.shouldMutate(newId);
}
final MutationIdentifier newId = this.context.registerMutation(
this.factory, "Replaced " + expression + " operation with first member");
return this.context.shouldMutate(newId);
}

@Override
Expand Down
11 changes: 3 additions & 8 deletions src/main/java/org/pitest/rv/AOD2Mutator.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,9 @@ class AODMethodVisitor2 extends LocalVariablesSorter {
}

private boolean shouldMutate(String expression) {
if (this.info.isGeneratedEnumMethod()) {
return false;
} else {
final MutationIdentifier newId = this.context.registerMutation(this.factory,
"Replaced " + expression + " operation by second member");
return this.context.shouldMutate(newId);
}

final MutationIdentifier newId = this.context.registerMutation(this.factory,
"Replaced " + expression + " operation by second member");
return this.context.shouldMutate(newId);
}

@Override
Expand Down
17 changes: 5 additions & 12 deletions src/main/java/org/pitest/rv/OBBN2Mutator.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public enum OBBN2Mutator implements MethodMutatorFactory {

public MethodVisitor create(final MutationContext context,
final MethodInfo methodInfo, final MethodVisitor methodVisitor) {
return new OBBNMethodVisitor2(this, context, methodInfo, methodVisitor);
return new OBBNMethodVisitor2(this, context, methodVisitor);
}

public String getGloballyUniqueId() {
Expand All @@ -33,25 +33,18 @@ class OBBNMethodVisitor2 extends MethodVisitor {

private final MethodMutatorFactory factory;
private final MutationContext context;
private final MethodInfo info;

OBBNMethodVisitor2(final MethodMutatorFactory factory,
final MutationContext context, final MethodInfo info, final MethodVisitor delegateMethodVisitor) {
final MutationContext context, final MethodVisitor delegateMethodVisitor) {
super(ASMVersion.ASM_VERSION, delegateMethodVisitor);
this.factory = factory;
this.context = context;
this.info = info;
}

private boolean shouldMutate(String expression) {
if (info.isGeneratedEnumMethod()) {
return false;
} else {
final MutationIdentifier newId = this.context.registerMutation(
this.factory, "Replaced " + expression + " by first member");
return this.context.shouldMutate(newId);
}

final MutationIdentifier newId = this.context.registerMutation(
this.factory, "Replaced " + expression + " by first member");
return this.context.shouldMutate(newId);
}

@Override
Expand Down
11 changes: 3 additions & 8 deletions src/main/java/org/pitest/rv/OBBN3Mutator.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,9 @@ class OBBNMethodVisitor3 extends LocalVariablesSorter {
}

private boolean shouldMutate(String expression) {
if (info.isGeneratedEnumMethod()) {
return false;
} else {
final MutationIdentifier newId = this.context.registerMutation(
this.factory, "Replace " + expression + " by second member");
return this.context.shouldMutate(newId);
}

final MutationIdentifier newId = this.context.registerMutation(
this.factory, "Replace " + expression + " by second member");
return this.context.shouldMutate(newId);
}

@Override
Expand Down
8 changes: 2 additions & 6 deletions src/main/java/org/pitest/rv/UOI1Mutator.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,8 @@ class UOI1MethodVisitor extends MethodVisitor {
}

private boolean shouldMutate(String description) {
if (context.getClassInfo().isEnum()) {
return false;
} else {
final MutationIdentifier newId = this.context.registerMutation(this.factory, description);
return this.context.shouldMutate(newId);
}
final MutationIdentifier newId = this.context.registerMutation(this.factory, description);
return this.context.shouldMutate(newId);
}

@Override
Expand Down
8 changes: 2 additions & 6 deletions src/main/java/org/pitest/rv/UOI2Mutator.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,8 @@ class UOI2MethodVisitor extends MethodVisitor {
}

private boolean shouldMutate(String description) {
if (context.getClassInfo().isEnum()) {
return false;
} else {
final MutationIdentifier newId = this.context.registerMutation(this.factory, description);
return this.context.shouldMutate(newId);
}
final MutationIdentifier newId = this.context.registerMutation(this.factory, description);
return this.context.shouldMutate(newId);
}

@Override
Expand Down
8 changes: 2 additions & 6 deletions src/main/java/org/pitest/rv/UOI3Mutator.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,8 @@ class UOIMethodVisitor3 extends MethodVisitor {
}

private boolean shouldMutate(String description) {
if (context.getClassInfo().isEnum()) {
return false;
} else {
final MutationIdentifier newId = this.context.registerMutation(this.factory, description);
return this.context.shouldMutate(newId);
}
final MutationIdentifier newId = this.context.registerMutation(this.factory, description);
return this.context.shouldMutate(newId);
}

@Override
Expand Down
8 changes: 2 additions & 6 deletions src/main/java/org/pitest/rv/UOI4Mutator.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,8 @@ class UOI4MethodVisitor extends MethodVisitor {
}

private boolean shouldMutate(String description) {
if (context.getClassInfo().isEnum()) {
return false;
} else {
final MutationIdentifier newId = this.context.registerMutation(this.factory, description);
return this.context.shouldMutate(newId);
}
final MutationIdentifier newId = this.context.registerMutation(this.factory, description);
return this.context.shouldMutate(newId);
}

@Override
Expand Down