| Summary: | [move method] Move method within the same CU results in compiler error when the method parameter type name is qualified | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Noopur Gupta <noopur_gupta> | ||||
| Component: | UI | Assignee: | Martin Mathew <manju656> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | manju656, markus.kell.r | ||||
| Version: | 4.4 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | stalebug | ||||||
| Attachments: |
|
||||||
|
Description
Noopur Gupta
This issue is not particular to Java 8. Consider the below code snippet:
package p1;
public class Snippet {
public void foo(java.io.FileNotFoundException arg, AnnotatedType type)
throws java.io.EOFException {
}
}
class AnnotatedType {
}
Moving #foo results in compiler error as neither the import is added nor the move preserves the qualified name of the method parameter.
In the finally block of MoveInstanceMethodProcessor#createMethodCopy, the call to rewriter.clearImportRewrites() is the culprit.
Created attachment 241085 [details]
Patch + Tests
ImportRewrite#addImport takes care of handling the imports, UI need not add/remove import separately.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |