| Summary: | [content assist] method code completion overwrites for() declaration | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Martijn Dashorst <martijn.dashorst> | ||||
| Component: | Text | Assignee: | Dani Megert <daniel_megert> | ||||
| Status: | CLOSED DUPLICATE | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | markus.kell.r | ||||
| Version: | 3.6 | ||||||
| Target Milestone: | 3.6 | ||||||
| Hardware: | Macintosh | ||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 153808 [details]
Screen cast showing the described behavior
This movie shows what happens with this bug report.
It appears to relate to an organize imports race condition where several imports are substituted by a * import. Reproduced with I20091201-1600 and 3.5.1:
- set number of imports for .* to 3
- content assist after Arrays.sort
package xy;
import java.lang.reflect.Method;
import java.util.List;
import java.util.ArrayList;
public class Try {
void m(List l, ArrayList al) {
Method[] methods = getClass().getDeclaredMethods();
Arrays.sort
for (Method method : methods) {
if (method.isAnnotationPresent(Deprecated.class)) {
System.out.println(method);
}
}
}
}
*** This bug has been marked as a duplicate of bug 285137 *** |
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-us) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10 Build Identifier: 20090920-1017 Given the code: 1. Method[] methods = taskClass.getDeclaredMethods(); 2. 3. for(Method method : methods) 4. { 5. ....... when I try to sort the array before entering the loop by typing at line 2: Arrays.sort<CTRL-SPACE> Eclipse will garble the lines 3-5 into gibberish. Reproducible: Always Steps to Reproduce: 1.have a construct like for() 2.type a part of a method invocation 3.use code completion to generate the method call and parameters