diff --git a/src/test/java/br/unb/cic/analysis/samples/ioa/AdditionToArrayConflictSample.java b/src/test/java/br/unb/cic/analysis/samples/ioa/AdditionToArrayConflictSample.java index 9f1b75a8..818060b4 100644 --- a/src/test/java/br/unb/cic/analysis/samples/ioa/AdditionToArrayConflictSample.java +++ b/src/test/java/br/unb/cic/analysis/samples/ioa/AdditionToArrayConflictSample.java @@ -9,6 +9,7 @@ public class AdditionToArrayConflictSample { public void m() { List validParameterAnnotations = new ArrayList(); validParameterAnnotations.add("LEFT"); // LEFT + System.out.println(validParameterAnnotations.toString()); validParameterAnnotations.add("RIGHT"); // RIGHT } } \ No newline at end of file diff --git a/src/test/java/br/unb/cic/analysis/samples/ioa/ArrayConstantSample.java b/src/test/java/br/unb/cic/analysis/samples/ioa/ArrayConstantSample.java new file mode 100644 index 00000000..2b2b3615 --- /dev/null +++ b/src/test/java/br/unb/cic/analysis/samples/ioa/ArrayConstantSample.java @@ -0,0 +1,23 @@ +package br.unb.cic.analysis.samples.ioa; + +// Conflict: [left, foo():15] --> [right, bar():19] +public class ArrayConstantSample { + + private int[] arr; + + public static void main(String[] args) { + ArrayConstantSample m = new ArrayConstantSample(); + m.arr = new int[]{0, 0, 0, 0, 0}; + m.foo(3); // LEFT + m.bar(2); // RIGHT + } + + private void foo(int i) { + arr[i] = 1; + } + + private void bar(int i) { + arr[i] = 2; + } + +} \ No newline at end of file diff --git a/src/test/java/br/unb/cic/analysis/samples/ioa/ArraysClassFieldConflictSample.java b/src/test/java/br/unb/cic/analysis/samples/ioa/ArraysClassFieldConflictSample.java index 9ea762fd..a20d5470 100644 --- a/src/test/java/br/unb/cic/analysis/samples/ioa/ArraysClassFieldConflictSample.java +++ b/src/test/java/br/unb/cic/analysis/samples/ioa/ArraysClassFieldConflictSample.java @@ -1,19 +1,24 @@ package br.unb.cic.analysis.samples.ioa; -// Conflict: [left, foo():13] --> [right, bar():17] +// Conflict: [left, foo():14] --> [right, bar():18] public class ArraysClassFieldConflictSample { - public static int[] y; + public int[] y; + + public ArraysClassFieldConflictSample() { + this.y = new int[]{0}; + } public static void main(String[] args) { - foo(); //left - bar(); //right + ArraysClassFieldConflictSample m = new ArraysClassFieldConflictSample(); + m.foo(); //left + m.bar(); //right } - private static void foo() { + private void foo() { y[0] = 3; } - private static void bar() { + private void bar() { y[0] = 4; } }