Commits

Anonymous committed 8eef5ef

Assignment to itself example.

Comments (0)

Files changed (3)

nbproject/project.properties

 javac.deprecation=false
 javac.processorpath=\
     ${javac.classpath}
-javac.source=1.7
-javac.target=1.7
+javac.source=1.6
+javac.target=1.6
 javac.test.classpath=\
     ${javac.classpath}:\
     ${build.classes.dir}:\

src/META-INF/upgrade/assignment.to.itself.hint

+$var = $var
+;;
+
+// :: !matchesAny($var, "$a[$i]")
+// :: elementKindMatches($var, ElementKind.FIELD)

src/demo/Assignment2Itself.java

+package demo;
+
+public class Assignment2Itself {
+
+    private String value;
+
+    public Assignment2Itself(String aValue) {
+        this.value = value;
+        
+        
+        value = this.value;
+        value = value;
+        this.value = this.value;
+    }
+    
+    public void shift(String[] array) {
+        int i = 0;
+        array[i++] = array[i++];
+        array = array;
+    }
+    
+}