Community
Participate
Working Groups
Created attachment 99720 [details] proposed fix With 3.4M7 and following code: public class MyArray2 { private Object[] array; public void method() { MyArray2 copy = null; for (int i = 0; i < copy.array.length; i++) { array[i].equals(null); } } } Using "Clean Up" with only option "Convert for loops to enhanced for loops", I get: public class MyArray2 { private Object[] array; public void method() { MyArray2 copy = null; for (Object element : copy.array) { element.equals(null); } } } Should be: no conversion, as index variable is used to iterate other array.
Note, analogous case when loop array is simple name (e.g. "array"), and access inside the block is qualified name (e.g. "copy.array") works correctly now.
Major, silent semantic change, let's fix it for 3.4... Fix for bug 214340 was not good enough.
Created attachment 99909 [details] fix proposed fix + test case
Martin? Can you please review? Is this an external contribution?
Patch looks good. I think we only need to set the 'contributed' keyword on this bug as Jacek is not a 'Eclipse project' contributer (is this correct, Jacek?). No change to the copyright is required as he is included in the 'IBM' comment.
(In reply to comment #5) > Patch looks good. > > I think we only need to set the 'contributed' keyword on this bug as Jacek is > not a 'Eclipse project' contributer (is this correct, Jacek?). No change to the > copyright is required as he is included in the 'IBM' comment. Yes i fall under IBM umbrella. And am only PDE incubator committer, so in all other projects I must be contributor. :) However for example PDE sets "contributed" and comment in copyright, so it's up to you and JDT rules. I'm ok with whatever you set, as long as bug is fixed.
Fixed without changes to copyright header > I20080510-2000 Thanks for the patch and the bug report!
start verifying
verified in I20080516-1333
Created attachment 101281 [details] r322_v20070124-patch patch for the same issue against Eclipse 3.2.2 (r322_v20070124).
We no plans to back port this to 3.2.2...