Summary: | Wrong class opened by debugger/"Open Type" | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Danny Yates <danny> |
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | blocker | ||
Priority: | P3 | CC: | John_Wiegand |
Version: | 3.1 | ||
Target Milestone: | 3.1 RC1 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Danny Yates
2005-04-15 17:22:41 EDT
Forgot to mention that this is on 3.1M6 with Sun JDK 1.4.2_06 Sorry guys, I've upped this to "blocker" because doing any serious development in 3.1M6 is not possible whilst this bug exists. :-( Looks to be a problem with the source attachment. The outline shows the correct class, however, the source is incorrect. (Correct source is in src.zip) Proposed fix idea: sort the rootPaths by number of segments (no segments first, most segments last). This will avoid the current problem of getting a false hit on a compilation unit which matches a subset of another path name (in the case below: opens com.sun.corba.se.xxx instead of xxx (xxx=org.omg.CORBA.ORB). This will let us find the correct root more quickly by starting with the most likely candidates so we will do fewer probes. I think the bug is that there are too many root paths found in this case. In this case, only the empty path should be the root path. Once the root path detection is fixed, only the right source should be displayed. Right now the root path detection finds: root[0]=com/sun root[1]=com/sun/corba/se/internal root[2]=com root[3]=org/omg/stub root[4]=com/sun/corba/se root[5]= I would expect only the last one. I propose another way to retrieve the source. First we don't compute any root. We consider that the default root ("") is the right one. When looking for a source, we check the default. If we find a matching source, we return it. If not, we compute the roots sorting them by segment length and then we iterate them. If we find more than one match, we can either: - return the shortest path - open the corresponding source and check the package declaration to find out if one of them is the best match. Doing this, it should solve this issue and speed up the source mapping for rt.jar. John, any thought? just sorting by segment length ("" will be first) addresses the problem reported and I believe suffices. I don't believe the further analysis is required (checking by segment length guarantees that you don't get the false hit UNLESS the src.zip is in error) Ok, but I still believe that checking first the default root prior to any computation can be an improvement. If there is a match, this should be the right one, right? Yes: checking "" first is a good optimization Fixed and released in HEAD. Verified for 3.1 RC1 with build I20050527-0010. |