Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Resolving Bindings without compiling?
Resolving Bindings without compiling? [message #251702] Fri, 29 February 2008 10:29 Go to next message
Eclipse UserFriend
Originally posted by: tansey.vt.edu

Hi all!

I'm working on a project where we want to be able to use the JDT both
inside and outside of Eclipse. For the project, we need to call
resolveBindings() on some nodes, but it's returning null when we parse
the source. Our fear is that we'll have to compile the code (meaning
handle dependency, classpath, etc. issues) in order to get the bindings.
Is there any way to get back bindings by only parsing the code, not
compiling it?

Sincerely,
Wesley
Re: Resolving Bindings without compiling? [message #251711 is a reply to message #251702] Fri, 29 February 2008 10:43 Go to previous message
Eclipse UserFriend
Originally posted by: myawn.ebay.com

Wesley Tansey wrote:
> Hi all!
>
> I'm working on a project where we want to be able to use the JDT both
> inside and outside of Eclipse. For the project, we need to call
> resolveBindings() on some nodes, but it's returning null when we parse
> the source. Our fear is that we'll have to compile the code (meaning
> handle dependency, classpath, etc. issues) in order to get the bindings.
> Is there any way to get back bindings by only parsing the code, not
> compiling it?
>
> Sincerely,
> Wesley

When you parse the source, are you calling
parse.setResolveBindings(true);
before creating the AST?


Also, if you have issues with dependencies, classpath, etc., I'm not
sure whether the AST will be able to return bindings to you. It's kind
of the whole point of bindings that they are resolved -- for example, if
you have code that refers to type Date, you might check the resolved
bindings to see whether that is java.util.Date, java.sql.Date, or
com.myprivatepackage.Date. I'm not an expert in this area, but I don't
see how the AST is going to be able to return correct bindings to you if
the code isn't buildable.

Mike
Previous Topic:Indexing sources - every time I reopen project
Next Topic:project setup for a client program which use two jar files
Goto Forum:
  


Current Time: Tue Apr 29 18:36:00 EDT 2025

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

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

Back to the top