Bug 201929 - Member of local type should not have a fully qualified name
Summary: Member of local type should not have a fully qualified name
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M2   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-31 12:24 EDT by Markus Keller CLA
Modified: 2007-09-18 04:30 EDT (History)
2 users (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-08-31 12:24:32 EDT
HEAD

class C {
	void m() {
		new Cloneable() {
			class MemberOfLocal {
			}
		};
	}
}

ITypeBinding#getQualifiedName() on 'MemberOfLocal' returns ".MemberOfLocal".

Expected: returns "", see Javadoc:

'Local types (including anonymous classes) and members of local types do not have a fully qualified name. For these types, and array types thereof, this method returns an empty string.'

The problem can e.g. be seen in Eclipse when you place the caret on 'MemberOfLocal' and press Ctrl+Shift+M => 'import .MemberOfLocal;' is added.
Comment 1 Markus Keller CLA 2007-08-31 12:40:26 EDT
> The problem can e.g. be seen in Eclipse when you place the caret on
> 'MemberOfLocal' and press Ctrl+Shift+M => 'import .MemberOfLocal;' is added.

This is only reproducible if C is *not* in the default package.
Comment 2 Olivier Thomann CLA 2007-09-07 11:05:58 EDT
Released for 3.4M2.
Regression tests added in org.eclipse.jdt.core.tests.dom.ASTConverterTestAST3_2#test0684
org.eclipse.jdt.core.tests.dom.ASTConverterTestAST3_2#test0685
Comment 3 David Audel CLA 2007-09-18 04:30:06 EDT
Verified for 3.4M2 using build I20070917-0010