Skip to content

Commit

Permalink
refactor(spgroup#31): rename test cases and update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
barbosamaatheus committed Aug 11, 2021
1 parent ff728a5 commit e0c7264
Show file tree
Hide file tree
Showing 44 changed files with 154 additions and 150 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.util.List;

// Conflict: [left, m():11] --> [right, m():12]
public class OverridingAssignmentAdditionToArrayConflictInterProceduralSample {
public class AdditionToArrayConflictSample {

public void m() {
List<String> validParameterAnnotations = new ArrayList<String>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package br.unb.cic.analysis.samples.ioa;

// Conflict: [left, foo():15] --> [right, bar():19]
public class OverridingAssignmentArrayAliasingConflictInterProceduralSample {
// Conflict: [left, foo():17] --> [right, bar():21]
public class ArrayAliasingConflictSample {
private int[] arr, barr;

public static void main(String[] args) {
OverridingAssignmentArrayAliasingConflictInterProceduralSample m =
new OverridingAssignmentArrayAliasingConflictInterProceduralSample();
ArrayAliasingConflictSample m =
new ArrayAliasingConflictSample();
m.arr = new int[]{0, 0, 0, 0, 0};
m.barr = m.arr;
m.foo(); // LEFT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package br.unb.cic.analysis.samples.ioa;

// Not Conflict
public class ArrayDiferentIndexNotConflictSample {
private int[] arr;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package br.unb.cic.analysis.samples.ioa;

// Conflict: [left, foo():14] --> [right, bar():18]
// Conflict: [left, foo():15] --> [right, bar():19]
public class ArraySameIndexConflictSample {
private int[] arr;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package br.unb.cic.analysis.samples.ioa;

// Conflict: [left, foo():13] --> [right, bar():17]
public class OverridingAssignmentArraysClassFieldConflictInterProceduralSample {
public class ArraysClassFieldConflictSample {
public static int[] y;

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package br.unb.cic.analysis.samples.ioa;

// Not Conflict
public class OverridingAssignmentArraysClassFieldNotConflictInterProceduralSample {
public class ArraysClassFieldNotConflictSample {
public static int[] y;

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ public class BothMarkingConflictSample {
private static int x;

public void main() {
foo();
foo(); // LEFT
}


private static void foo() {
x = 1; // RIGHT
}
Expand Down
16 changes: 10 additions & 6 deletions src/test/java/br/unb/cic/analysis/samples/ioa/CallGraphSample.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
package br.unb.cic.analysis.samples.ioa;

// Conflict: [{left, CallGraphClassImplements.baz():43] --> [right, CallGraphClassImplements<init>():38},
// {left, CallGraphClassImplements<init>():38] --> [right, CallGraphClassImplements.baz():43}]

public class CallGraphSample {
private int[] arr;

public void m() {
CallGraphInterface callGraphInterface = new CallGraphClassImplements();
callGraphInterface.baz();
CallGraphInterface callGraphInterface = new CallGraphClassImplements(); // LEFT
callGraphInterface.baz(); // RIGHT

CallGraphClassImplements callGraphClassImplements = new CallGraphClassImplements();
callGraphClassImplements.baz();
CallGraphClassImplements callGraphClassImplements = new CallGraphClassImplements(); // LEFT
callGraphClassImplements.baz(); // RIGHT

CallGraphClass callGraphClass = new CallGraphClass();
callGraphClass.bar();
CallGraphClass callGraphClass = new CallGraphClass(); // LEFT
callGraphClass.bar(); // RIGHT

foo();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package br.unb.cic.analysis.samples.ioa;

// Conflict: [left, m():17] --> [right, InstanceAttributeSample.setFoo():21]
public class OverridingAssignmentChangeInstanceAttributeConflictInterProceduralSample {
// Conflict: [left, InstanceAttributeSample():20] --> [right, InstanceAttributeSample.setFoo():24]
public class ChangeInstanceAttributeConflictSample {
private InstanceAttributeSample instanceAttributeSample;

public static void main(String[] args) {
OverridingAssignmentChangeInstanceAttributeConflictInterProceduralSample m =
new OverridingAssignmentChangeInstanceAttributeConflictInterProceduralSample();
ChangeInstanceAttributeConflictSample m =
new ChangeInstanceAttributeConflictSample();

m.instanceAttributeSample = new InstanceAttributeSample(); // LEFT
m.instanceAttributeSample.setFoo(2); // RIGHT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package br.unb.cic.analysis.samples.ioa;

// Conflict: [left, m():9] --> [right, <init>():19]
public class OverridingAssignmentChangePublicAttributesConflictInterProceduralSample {
// Conflict: [left, m():9] --> [right, Result<init>():19]
public class ChangePublicAttributesConflictSample {

public void m() {
Result result = new Result(); // LEFT
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package br.unb.cic.analysis.samples.ioa;

// Conflict: [left, main():10] --> [right, foo():15]
public class ClassFieldConflictSample {
private int x;

public static void main(String[] args) {
ClassFieldConflictSample m =
new ClassFieldConflictSample();
m.x = 0; // LEFT
m.foo(); // RIGHT
}

private void foo() {
x = 1;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package br.unb.cic.analysis.samples.ioa;

// Conflict: [left, foo():15] --> [right, bar():19]
public class ClassFieldConflictSample2 {
private int x;

public static void main(String[] args) {
ClassFieldConflictSample2 m =
new ClassFieldConflictSample2();
m.foo(); // LEFT
m.bar(); // RIGHT
}

private void foo() {
x = 0;
}

private void bar() {
x = 1;
}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package br.unb.cic.analysis.samples.ioa;

// Not Conflict
public class OverridingAssignmentClassFieldNotConflictInterProceduralSample {
public class ClassFieldNotConflictSample {
private int x;

public void m() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package br.unb.cic.analysis.samples.ioa;

// Not Conflict
public class OverridingAssignmentClassFieldNotConflictInterProceduralSample2 {
public class ClassFieldNotConflictSample2 {
private int x;

public void m() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

// Not Conflict - Not implemented yet. You will need constant propagation.
// Currently detected as conflict: [left, m():9] --> [right, foo():14]
public class OverridingAssignmentClassFieldWithParameterNotConflictInterProceduralSample {
public class ClassFieldWithParameterNotConflictSample {
private int x;

public static void main(String[] args) {
OverridingAssignmentClassFieldWithParameterNotConflictInterProceduralSample m =
new OverridingAssignmentClassFieldWithParameterNotConflictInterProceduralSample();
ClassFieldWithParameterNotConflictSample m =
new ClassFieldWithParameterNotConflictSample();
m.x = 0; // LEFT
m.foo(m.x); // RIGHT
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package br.unb.cic.analysis.samples.ioa;

// Conflict: [left, m():7] --> [right, foo():8]
public class OverridingAssignmentConcatMethodsConflictInterProceduralSample {
// Conflict: [left, main():10] --> [right, main():11]
public class ConcatMethodsConflictSample {

public static void main(String[] args) {
OverridingAssignmentConcatMethodsConflictInterProceduralSample m =
new OverridingAssignmentConcatMethodsConflictInterProceduralSample();
ConcatMethodsConflictSample m =
new ConcatMethodsConflictSample();

int x = m.foo() + m.bar(); // LEFT i3 = $i0 + $i1 - x = $stack2 + $stack3
x = x + m.qux(); // RIGHT i4 = i3 + $i2 - x = x + $stack4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
public class ContainsInvokeExpConflictSample {
private int x, y;

public void m() {
x = 0; // LEFT
y = 0;
x = foo(); // RIGHT
public static void main() {
ContainsInvokeExpConflictSample m = new ContainsInvokeExpConflictSample();

m.x = 0; // LEFT
m.y = 0;
m.x = m.foo(); // RIGHT
}

private int foo() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package br.unb.cic.analysis.samples.ioa;

// Not Conflict
public class OverridingAssignmentDifferentAttributeOnIdenticalClassNotConflictInterProceduralSample {
public class DifferentAttributeOnIdenticalClassNotConflictSample {
private ObjectSample objectSample1, objectSample2;

public OverridingAssignmentDifferentAttributeOnIdenticalClassNotConflictInterProceduralSample() {
public DifferentAttributeOnIdenticalClassNotConflictSample() {
objectSample1 = new ObjectSample();
objectSample2 = new ObjectSample();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package br.unb.cic.analysis.samples.ioa;

// Not Conflict
public class OverridingAssignmentDifferentClassWithSameAttributeNotConflictInterProceduralSample {
public class DifferentClassWithSameAttributeNotConflictSample {
private ObjectExample objectExample;
private ObjectExample2 objectExample2;

public OverridingAssignmentDifferentClassWithSameAttributeNotConflictInterProceduralSample() {
public DifferentClassWithSameAttributeNotConflictSample() {
objectExample = new ObjectExample();
objectExample2 = new ObjectExample2();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package br.unb.cic.analysis.samples.ioa;

// Conflict: [left, IdenticalClassSample.setFoo():25] --> [right, IdenticalClassSample.setBar():21]
public class OverridingAssignmentDifferentMethodOnIdenticalClassConflictInterProceduralSample {
public class DifferentMethodOnIdenticalClassConflictSample {
private IdenticalClassSample identicalClassSample;

public static void main(String[] args) {
OverridingAssignmentDifferentMethodOnIdenticalClassConflictInterProceduralSample m =
new OverridingAssignmentDifferentMethodOnIdenticalClassConflictInterProceduralSample();
DifferentMethodOnIdenticalClassConflictSample m =
new DifferentMethodOnIdenticalClassConflictSample();

m.identicalClassSample = new IdenticalClassSample();
m.identicalClassSample.setFoo(1); // LEFT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.util.Map;

// Conflict: [left, m():13] --> [right, m():14]
public class OverridingAssignmentHashmapConflictInterProceduralSample {
public class HashmapConflictSample {


public void m() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package br.unb.cic.analysis.samples.ioa;

// Conflict: [left, m():8] --> [right, foo():14]
public class OverridingAssignmentIfBranchConflictInterProceduralSample {
// Conflict: [left, main():10] --> [right, foo():16]
public class IfBranchConflictSample {
private int x;

public static void main() {
OverridingAssignmentIfBranchConflictInterProceduralSample m =
new OverridingAssignmentIfBranchConflictInterProceduralSample();
IfBranchConflictSample m =
new IfBranchConflictSample();
m.x = 0; // LEFT
m.foo(); // RIGHT
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package br.unb.cic.analysis.samples.ioa;

// Conflict: [left, m():8] --> [right, foo():16]
// Conflict: [left, main():10] --> [right, foo():18]
public class IfWithInvokeConflictSample {
private int x, y;

public static void main(String[] args) {
IfWithInvokeConflictSample m = new IfWithInvokeConflictSample();

m.x = 0; // LEFT
m.y = 0;
if (m.foo()) { // RIGHT
Expand All @@ -17,6 +18,4 @@ private boolean foo() {
x = 1;
return true;
}


}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package br.unb.cic.analysis.samples.ioa;

// Not Conflict
public class OverridingAssignmentLocalArrayNotConflictInterProceduralSample {
public class LocalArrayNotConflictSample {
public void m() {
foo(); // LEFT
bar(); // RIGHT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package br.unb.cic.analysis.samples.ioa;

// Not Conflict
public class OverridingAssignmentLocalArrayRecursiveNotConflictInterProceduralSample {
public class LocalArrayRecursiveNotConflictSample {
public void m() {
foo(); // LEFT
bar(); // RIGHT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package br.unb.cic.analysis.samples.ioa;

// Not Conflict
public class OverridingAssignmentLocalVariablesNotConflictInterProceduralSample {
public class LocalVariablesNotConflictSample {
public void m() {
foo(); // LEFT
bar(); // RIGHT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package br.unb.cic.analysis.samples.ioa;

// Not Conflict
public class OverridingAssignmentLocalVariablesNotConflictInterProceduralSample2 {
public class LocalVariablesNotConflictSample2 {
public void m() {
int x = 0; // LEFT
int x = 0; // LEFT
foo(x); // RIGHT

}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package br.unb.cic.analysis.samples.ioa;

// Not Conflict
public class OverridingAssignmentLocalVariablesWithParameterNotConflictInterProceduralSample {
public class LocalVariablesWithParameterNotConflictSample {
public void m() {
foo(0); // LEFT
bar(1); // RIGHT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package br.unb.cic.analysis.samples.ioa;

// Conflict: [left, ObjectFieldConflict.m():17] --> [right, ObjectFieldConflict.bar():21]
public class OverridingAssignmentObjectFieldConflictInterProceduralSample {
// Conflict: [left, ObjectFieldConflict.foo():17] --> [right, ObjectFieldConflict.bar():21]
public class ObjectFieldConflictSample {
public void m() {
ObjectFieldConflict c = new ObjectFieldConflict();
c.foo(1); // left
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package br.unb.cic.analysis.samples.ioa;

// Not Conflict
public class OverridingAssignmentObjectFieldNotConflictInterProceduralSample {
public class ObjectFieldNotConflictSample {
public void m() {
ObjectFieldNotConflict objectFieldNotConflict = new ObjectFieldNotConflict();
objectFieldNotConflict.foo(1); // left
Expand Down
Loading

0 comments on commit e0c7264

Please sign in to comment.