Bug 165849 - [new type wizard] New Class wizard gives incorrect results for inner interfaces
Summary: [new type wizard] New Class wizard gives incorrect results for inner interfaces
Status: VERIFIED DUPLICATE of bug 182179
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M6   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-25 17:48 EST by Wendell Beckwith CLA
Modified: 2008-03-26 06:25 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wendell Beckwith CLA 2006-11-25 17:48:33 EST
The New Class wizard fails to produce a correct class if the class implements and inner interface of another class.

Steps to reproduce:

1. Use the wizard to create a new class Foo that implements the org.eclipse.ui.actions.ActionFactory.IWorkbenchAction interface.  You need to use the "Add" button to select the interface.

2. After selecting the interface the type in the "Interfaces" text field is "org.eclipse.ui.actions.ActionFactory$IWorkbenchAction" and not "org.eclipse.ui.actions.ActionFactory.IWorkbenchAction".

3. Selecting "Finish" at this point will produce and incorrect class and the appropriate methods that should have been provided from the interface are not in the Foo class.  However, if you replace the '$' with a '.' before hitting "Finish" then the class will be created correctly.
Comment 1 Markus Keller CLA 2006-11-27 10:06:27 EST
TypeNameMatch.getFullyQualifiedName() return the $ in the name, which is against its spec. A JDK-only example of this is java.util.Map.Entry.

[JDT/UI's call is in SuperInterfaceSelectionDialog.addSelectedInterface().]
Comment 2 Frederic Fusier CLA 2006-12-02 06:16:06 EST
TypeNameMatch.getFullyQualifiedName() relies on IType same method => as said in bug 156168 comment 2:
For binary types, this is the name of the class file without the ".class"
suffix.
...
 * <li>the type qualified name of a binary type whose class file is A$B.class
 *     using the '$' separator is "A$B"</li>


*** This bug has been marked as a duplicate of bug 156168 ***
Comment 3 Frederic Fusier CLA 2006-12-02 06:17:07 EST
Sorry, previous comment should read:
 * <li>the type qualified name of a binary type whose class file is A$B.class
 *     using the '.' separator is "A$B"</li>
Comment 4 Jerome Lanneluc CLA 2008-03-11 08:34:10 EDT
Not a dup of bug 156168, but a dup of bug 182179
Comment 5 Jerome Lanneluc CLA 2008-03-11 08:34:45 EDT

*** This bug has been marked as a duplicate of bug 182179 ***
Comment 6 Eric Jodet CLA 2008-03-26 06:25:03 EDT
Verified for 3.4M6 using build I20080324-1300