Bug 117538 - Completion of deeply nested class fills in FQCN, with "$" separators
Summary: Completion of deeply nested class fills in FQCN, with "$" separators
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 RC2   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-22 13:03 EST by David M. Karr CLA
Modified: 2008-05-23 06:35 EDT (History)
2 users (show)

See Also:


Attachments
Test case for JDT Completion problem (10.62 KB, application/octet-stream)
2005-11-22 13:14 EST, David M. Karr CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.