Summary: | [compiler] NPE renaming run() method | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Adam Bartoszewicz <adam.bartoszewicz> | ||||
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||
Status: | VERIFIED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | egalvez, kent_johnson, markus.kell.r, Olivier_Thomann, stephan.herrmann | ||||
Version: | 3.5 | ||||||
Target Milestone: | 3.6 M2 | ||||||
Hardware: | PC | ||||||
OS: | Windows Vista | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Adam Bartoszewicz
2009-09-09 05:03:59 EDT
Reproduced. Investigating. Created attachment 146867 [details]
Proposed fix
Kent, could you please review it?
The null check is required when the enclosing method is not available.
The fix in findMethod is required to retrieve the enclosing method when the methods have been initialized.
I am working on a regression test.
Kent, if the fix is ok, I would backport to 3.5.2. Released for 3.6M2. Added regression test in: org.eclipse.jdt.core.tests.compiler.regression.EnclosingMethodAttributeTest#test004 *** Bug 284131 has been marked as a duplicate of this bug. *** *** Bug 289078 has been marked as a duplicate of this bug. *** Verified for 3.6M2 I have downloaded Eclipse 3.6M2. Now renaming run() method works. Thank you for this fix. I noticed another problem. Renaming run() (getName or getValue) method is time-consuming and significantly slower than renaming other methods e.g. run212121(). I tested this issue on large workspace. Eclipse renames getName() method about 4 minutes, but rename getName1() run only 5 seconds. This could be related to the search for all methods named "getName". Markus, could you please comment on this ? (In reply to comment #8) That's bug 102279. > That's bug 102279.
Actually, that's only one part of the problem (but I think it's the one taking most of the time).
The other is a peculiarity in the Java language that requires us to create type hierarchies for all methods with the same name and parameter list, in order to find all connected methods that need to be renamed as well. The short version of the story: If methods are declared in multiple interfaces and inherited by the same sub-interface, then they can form a "ripple", i.e. you have to walk up and down the type hierarchy to find them all.
|