Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » "[].length" attribute has null getDeclaringClass()
icon9.gif  "[].length" attribute has null getDeclaringClass() [message #639249] Mon, 15 November 2010 18:04 Go to next message
Nicolas Anquetil is currently offline Nicolas AnquetilFriend
Messages: 20
Registered: May 2010
Junior Member
Note: before you ask, yes I did parser.setResolveBindings(true); Smile

In the resulting AST, accesses to the length attribute of an array is a FieldAccess ASTNode (which is perfectly ok)

If I get the binding of this node (node.resolveFieldBinding()) I get an IVariableBinding. Now if I do a getDeclaringClass() on this binding, the result is null. Sad

That might be considered OK given that a Java array is not really a class (well I don't think it is ...?)

The problem is, how do I know that the 'null' does not come from a missing binding (some problem in the parsing), but from the fact that this is an array's attribute.
Or is it a bug in the binding resolver?

Nicolas
Re: "[].length" attribute has null getDeclaringClass() [message #639251 is a reply to message #639249] Mon, 15 November 2010 18:16 Go to previous message
Olivier Thomann is currently offline Olivier ThomannFriend
Messages: 518
Registered: July 2009
Senior Member
Could you please provide a complete test case and attached it to a bug report against JDT/Core ?
As soon as we get your test case, we can investigate what is going on.

Thanks,
--
Olivier
Previous Topic:ERROR: Unable to open class file
Next Topic:Refactor->move of directory not updating reference
Goto Forum:
  


Current Time: Thu Apr 25 07:58:35 GMT 2024

Powered by FUDForum. Page generated in 2.23284 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top