diff --git a/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentClassFieldConflictInterProceduralSample.java b/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentClassFieldConflictInterProceduralSample.java new file mode 100644 index 00000000..862c2d5a --- /dev/null +++ b/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentClassFieldConflictInterProceduralSample.java @@ -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; + } + + +} \ No newline at end of file diff --git a/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentClassFieldConflictInterProceduralSample2.java b/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentClassFieldConflictInterProceduralSample2.java new file mode 100644 index 00000000..dfb9a58f --- /dev/null +++ b/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentClassFieldConflictInterProceduralSample2.java @@ -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; + } + +} diff --git a/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentClassFieldNotConflictInterProceduralSample.java b/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentClassFieldNotConflictInterProceduralSample.java new file mode 100644 index 00000000..d66c3267 --- /dev/null +++ b/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentClassFieldNotConflictInterProceduralSample.java @@ -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; + } + + +} \ No newline at end of file diff --git a/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentClassFieldNotConflictInterProceduralSample2.java b/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentClassFieldNotConflictInterProceduralSample2.java new file mode 100644 index 00000000..6ec8b60d --- /dev/null +++ b/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentClassFieldNotConflictInterProceduralSample2.java @@ -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; + } +} \ No newline at end of file diff --git a/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentClassFieldWithParameterNotConflictInterProceduralSample.java b/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentClassFieldWithParameterNotConflictInterProceduralSample.java new file mode 100644 index 00000000..86c43c85 --- /dev/null +++ b/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentClassFieldWithParameterNotConflictInterProceduralSample.java @@ -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; + } + + +} \ No newline at end of file diff --git a/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentLocalVariablesNotConflictInterProceduralSample.java b/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentLocalVariablesNotConflictInterProceduralSample.java new file mode 100644 index 00000000..9728d535 --- /dev/null +++ b/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentLocalVariablesNotConflictInterProceduralSample.java @@ -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; + } + + +} \ No newline at end of file diff --git a/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentLocalVariablesNotConflictInterProceduralSample2.java b/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentLocalVariablesNotConflictInterProceduralSample2.java new file mode 100644 index 00000000..e346f115 --- /dev/null +++ b/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentLocalVariablesNotConflictInterProceduralSample2.java @@ -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; + } + + +} \ No newline at end of file diff --git a/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentLocalVariablesWithParameterNotConflictInterProceduralSample.java b/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentLocalVariablesWithParameterNotConflictInterProceduralSample.java new file mode 100644 index 00000000..e57a0a05 --- /dev/null +++ b/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentLocalVariablesWithParameterNotConflictInterProceduralSample.java @@ -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; + } + + +} \ No newline at end of file diff --git a/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentObjectFieldConflictInterProceduralSample.java b/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentObjectFieldConflictInterProceduralSample.java new file mode 100644 index 00000000..3cd54692 --- /dev/null +++ b/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentObjectFieldConflictInterProceduralSample.java @@ -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; + } +} \ No newline at end of file diff --git a/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentObjectFieldNotConflictInterProceduralSample.java b/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentObjectFieldNotConflictInterProceduralSample.java new file mode 100644 index 00000000..156e65bc --- /dev/null +++ b/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentObjectFieldNotConflictInterProceduralSample.java @@ -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; + } +} \ No newline at end of file