Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Null scopes passed to ASTVisitor
Null scopes passed to ASTVisitor [message #512203] Thu, 04 February 2010 06:51 Go to next message
Eclipse UserFriend
I am doing some work using Lombok (projectlombok.org) which needs type
resolution. In order to do this I take something like an Expression and
I call resolveType from that Expression in order to get a TypeBinding.

In order to call resolveType you need a Scope, and as I am in the
visit(MessageSend,BlockScope) method of my ASTVisitor I rather assumed
that the BlockScope would do.

BUT sometimes it is null. In particular it seems to be null when
processing initializers for field variables (there are other occasions
too, but lets start with this one).

So what I am looking for is some guidance on why the BlockScope might
be null, and what I am suppose to do to resolve types in its absence.
I have tried creating my own MethodScope from enclosing TypeDeclarations
but the chain sometimes gets broken and resolveType complains that it
did not find a CompilationUnitScope at the head of the scope chain.

I am running with Eclipse 3.5.1 (on Linux using Java 6 if that matters).

David
Re: Null scopes passed to ASTVisitor [message #512250 is a reply to message #512203] Thu, 04 February 2010 09:04 Go to previous message
Eclipse UserFriend
Le 2010-02-04 06:51, David Goodenough a écrit :
> BUT sometimes it is null. In particular it seems to be null when
> processing initializers for field variables (there are other occasions
> too, but lets start with this one).
Could you please describe in a bug report open against JDT/Core what you
are trying to do and what API you re using?
I can then have a look to see if we forgot to pass a scope.

Thanks.
--
Olivier
Previous Topic:Problem with Eclipse and /usr/lib/eclipse/startup.jar on Ubuntu
Next Topic:Accessing DB2 from Eclipse
Goto Forum:
  


Current Time: Sun Mar 23 20:55:58 EDT 2025

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

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

Back to the top