Bug 171383 - [model] IType#getElementName() returns empty string for non-anonymous binary type with $ in name
Summary: [model] IType#getElementName() returns empty string for non-anonymous binary ...
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 3.3 RC4   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-23 09:23 EST by Markus Keller CLA
Modified: 2007-06-19 10:43 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2007-01-23 09:23:28 EST
I20070116-1510

IType#getElementName() returns an empty string for a non-anonymous binary type with a $ in its name:

package p;
public class R$1 {
	public static void main(String[] args) {
		System.out.println("I like $");
	}
}

If you put the p/R$1.class file into a class file folder, IType#getElementName() returns "". Expected: "R$1".

This can lead to strange entries in the Open Type dialog:
- The example shows up as " - p" for pattern "r".
- The IBM J9 1.4.2 VM's system libraries contain such types, e.g. javax.net.ssl.SSLSocketFactory$1, which caused bug 171359.
Comment 1 Frederic Fusier CLA 2007-06-19 09:11:23 EDT
Reproduced with 3.3 RC4.

When java file exists, the model behaves correctly and you can see the R$1 type in the Open Type dialog when typing "r" pattern. This problem only happens when only the class file exists, then there's no way to know whether this is a top-level type or an anonymous without opening the file. As this cannot be done for obvious performance reasons, not sure if there's something to do here...
Comment 2 Jerome Lanneluc CLA 2007-06-19 10:43:07 EDT
Known limitation of the model.