Bug 117538

Summary: Completion of deeply nested class fills in FQCN, with "$" separators
Product: [Eclipse Project] JDT Reporter: David M. Karr <david.karr>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, eclipse
Version: 3.1.1   
Target Milestone: 3.4 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Test case for JDT Completion problem none

Description David M. Karr CLA 2005-11-22 13:03:20 EST
In the attached test case, completion of a nested class produces a non-optimal result, where the base class (the first non-inner class) is specified as a FQCN, even though the class already imports the class, and the separator between the nested inner classes is "$" instead of ".".  The "$" is legal, but the "." is preferred.

If the string "DataSourceResponses" is entered, and then you try to complete the symbol, the result is the following:

com.equifax.xml.xmlSchema.interConnect.InterConnectResponseDocument$InterConnectResponse$BusinessSubjects$BusinessSubject.DataSourceResponses

Where it should be:

InterConnectResponseDocument.InterConnectResponse.BusinessSubjects.BusinessSubject.DataSourceResponses

The steps to execute the test case are as follows:

1. Extract the zip to a directory.
2. Download XMLBeans-2.1.0 from <http://www.apache.org/dyn/closer.cgi/xmlbeans>.
3. Extract the "xbean.jar" and "jsr173_1.0_api.jar" from the XMLBeans distribution and put them in the "jdtcompletionbug/lib" directory.
2. Change to the "jdtcompletionbug" directory and enter "ant".
3. In Eclipse, create a new Java project.
4. Name the project "jdtcompletionbug" (or whatever).
5. Select the "Create project from existing source" radio button.
6. Browse to the "jdtcompletionbug" directory.
7. Click Next and then Finish.
8. Navigate to the project and then open JDTCompletionBug.java.
9. Put the cursor in the main method and type "DataSourceResponses".
10. Press Ctrl-space to do completion of the symbol.
11. Press Enter to get the default of "DataSourceResponses".

You will now see the completion result in question.
Comment 1 David M. Karr CLA 2005-11-22 13:14:59 EST
Created attachment 30397 [details]
Test case for JDT Completion problem

The case description describes how to build and run the test case.
Comment 2 David Audel CLA 2008-05-20 10:57:19 EDT
This bug is fixed in a previous build and can not be reproduced with I20080516-1333.

I close this bug as WORKSFORME.
Comment 3 Frederic Fusier CLA 2008-05-23 06:35:10 EDT
Verified for 3.4RC2 using I20080523-0100.
Note that it also works using 3.3.2.