| Summary: | Navigation to constructor/method intertype broken if regular declaration with same number of args exists | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] AJDT | Reporter: | Kris De Volder <kdevolder> | ||||||||
| Component: | UI | Assignee: | AJDT-inbox <AJDT-inbox> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | andrew.eisenberg, kdevolder | ||||||||
| Version: | 2.0.2 | Flags: | andrew.eisenberg:
review+
|
||||||||
| Target Milestone: | 2.1.0 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Linux | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
This bug is not restricted to constructors. I have verified... it also happens for ordinary methods. The reason why it happens is that Java's selection finder does not bother to check the argument types when it only finds one method/constructor in the declaring type that has the same name and number of arguments as the selection. AJDT's intertype finder explicitly assumes that if exactly one element is found by the java selection finder it must be correct and so it does not try to find ITDs. Created attachment 173159 [details]
mylyn/context/zip
Mylin context for work on this bug
Created attachment 173160 [details]
patch fixing this bug + testcase
I also fixed a small bug in the findRegion method used across the other test cases. I pulled that bugfix up to a superclass so it is shared by all sub testcases that had replicated copies.
Luckily fixing the bug in that method, didn't actually cause any of the existing tests to fail :-)
Thanks, Kris. I will apply this patch when I return from vacation. Did this patch ever get applied? Nope. It is now. Applied patch. Thanks. |
Created attachment 173135 [details] zip of a source folder with small example (few classes and an aspect) When there are two constructors for a type, both with the same number of arguments but overloaded on type, one of the constructors defined in the class itself and the other one defined as a intertype member... when we navigate from a call to a constructor to its declaration we always get taken to the constructor in the class (even when we should be taken to the one in the aspect). This doesn't seem to happen when the constructors have different numbers of arguments. I am attaching a .zip file with a small example. In the method com.springsource,DeparmentTest.testDepartmentBean() there are two calls to Deparment constructors one in an aspect and one in the class itself.