Skip to content

Commit

Permalink
test(spgroup#31): add tests sample
Browse files Browse the repository at this point in the history
  • Loading branch information
barbosamaatheus committed Dec 9, 2020
1 parent 950cee2 commit 8121522
Show file tree
Hide file tree
Showing 10 changed files with 199 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package br.unb.cic.analysis.samples;

public class OverridingAssignmentClassFieldConflictInterProceduralSample {
private int x;

public void m() {
x = 0; // LEFT
foo(); // RIGHT
}

private void foo() {
x = 1;
}


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


public class OverridingAssignmentClassFieldConflictInterProceduralSample2 {
private int x;

public void m() {
foo(); // LEFT
bar(); // RIGHT
}

private void foo() {
x = 0;
}

private void bar() {
x = 1;
}

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


public class OverridingAssignmentClassFieldNotConflictInterProceduralSample {
private int x;

public void m() {
x = 0; // LEFT
base();
foo(); // RIGHT
}

private void base() {
x = 0;
}

private void foo() {
x = 1;
}


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


public class OverridingAssignmentClassFieldNotConflictInterProceduralSample2 {
private int x;

public void m() {
foo(); // LEFT
base();
bar(); // RIGHT
}

private void base() {
x = 0;
}

private void foo() {
x = 1;
}

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


public class OverridingAssignmentClassFieldWithParameterNotConflictInterProceduralSample {
private int x;

public void m() {
x = 0; // LEFT
foo(x); // RIGHT
}

private void foo(int a) {
x = a;
}


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


public class OverridingAssignmentLocalVariablesNotConflictInterProceduralSample {
public void m() {
foo(); // LEFT
bar(); // RIGHT
}

private void foo() {
int x = 0;
}

private void bar() {
int x = 1;
}


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


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

}

private void foo(int a) {
a = 3;
}


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


public class OverridingAssignmentLocalVariablesWithParameterNotConflictInterProceduralSample {
public void m() {
foo(0); // LEFT
bar(1); // RIGHT
}

private void foo(int a) {
int x = a;
}

private void bar(int a) {
int x = a;
}


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


public class OverridingAssignmentObjectFieldConflictInterProceduralSample {
public void m() {
ObjectFieldConflict c = new ObjectFieldConflict();
c.foo(1); // left
ObjectFieldConflict d = c;
d.bar(0); //right
}
}

class ObjectFieldConflict {
private int at;

public void foo(int a) {
this.at = a + 1;
}

public void bar(int a) {
this.at = a;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package br.unb.cic.analysis.samples;


public class OverridingAssignmentObjectFieldNotConflictInterProceduralSample {
public void m() {
ObjectFieldNotConflict objectFieldNotConflict = new ObjectFieldNotConflict();
objectFieldNotConflict.foo(1); // left
ObjectFieldNotConflict objectFieldNotConflict2 = new ObjectFieldNotConflict();
objectFieldNotConflict2.bar(0); //right
}
}

class ObjectFieldNotConflict {
private int at;

public void foo(int a) {
this.at = a + 1;
}

public void bar(int a) {
this.at = a;
}
}

0 comments on commit 8121522

Please sign in to comment.