Community
Participate
Working Groups
Build ID: M20071023-1652 - Open the code example from bug 218437 in the AST View. - Look at the type binding of 'Bug' on 'line 27'. - The qualified name is '<Type>.Row' It should be the empty name as spec'ed in the Javadoc of TypeBinding.getQualifiedName '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.' --------------------- Bug.java ------------------- import org.eclipse.swt.widgets.*; class Bug{ { abstract class LeafPage<Type extends Short>{ abstract class Row{ final Button radio; final Control[]children; Row(final Composite left,final String name, final Composite rite, final boolean lastFocus,final Control...kids){ children=kids; (radio=new Button(left,0)).getBackground(); radio.setText(name+':'); radio.setData(this); } } Combo pickWay; public void createControl(final Composite parent){ final Composite a=new Composite(parent,0); ////////////// new Row(a,"",a,true,(Control)null){} //// LINE 27 //// ///////////// .children[0]=pickWay=new Combo(a,0); } }}}
If you look at the qualified name for the binding that corresponds to the anonymous type, then it is an empty name. If you look at the qualified name for the simple name "Row", then it is the qualified name of the member type "Row" and it looks ok. Am I missing something ?
Created attachment 107906 [details] screenshot of AST View Isn't 'Row' a local type (inside an initializer) and should also have the empty qualified name? See screenshot for what I see in 3.4.
(In reply to comment #2) > Isn't 'Row' a local type (inside an initializer) and should also have the empty > qualified name? See screenshot for what I see in 3.4. Sorry, but I disagree. Row is a member type. What is the local type is the type binding that corresponds to the anonymous class declaration. So if you want the empty name, you either look at the type binding of the class instance creation or you look at the type binding of the anonymous class declaration that is part of the class instance creation. I don't think we can change anything here. It definitely looks ok to me.
*** Bug 242252 has been marked as a duplicate of this bug. ***
(In reply to comment #4) > *** Bug 242252 has been marked as a duplicate of this bug. *** Sorry, not a dup of this bug. (In reply to comment #3) I agree with Olivier that there's a difference between a) the type binding of the ClassInstanceCreation (a local type, which correctly has no qualified name), and b) the type binding of the CIC's type (a reference to the type Row, which is a member type of the local type LeafPage) But I also agree with Martin that the CIC's type "Row" in "new Row(...){}" should have an empty qualified name, since the spec cited in comment 0 says: "[..] and members of local types do not have a fully qualified name." ^^^^^^^^^^^^^^^^^^^^^^
Sorry, I missed the initializer. I'll look at it again.
Released for 3.5M1. Added regression test org.eclipse.jdt.core.tests.dom.ASTConverter15Test#test0318
Verified for 3.5M1 using I20080805-1307