Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » jdt not up-to-date?
jdt not up-to-date? [message #254882] Tue, 08 July 2008 17:51 Go to next message
Eclipse UserFriend
Hi,

I'm having a problem with reading some not update info from the jdt model.
Here's my scenario...

In my app I am using some third party code that generates some java source
files into my project. Then my code needs to introspect those generated
source files and perform some additional code gen based on that. What I
find happening is when I introspect those source files, sometimes (seems
to be random) I get incorrect results (e.g. getting no methods when there
should be some).

I find that if I trigger a build between the generation and my
introspecting code, then I would get the right reuslts.

So my question is, is a build absolutely necessary to force the jdt model
to be updated? Is there some lighter weight method I can call instead of
a build? I read in the javadocs that jdt has reconcile() and
makeConsistent() methods, would these methods help with my problem?

Thanks in advance

Andrew
Re: jdt not up-to-date? [message #254886 is a reply to message #254882] Tue, 08 July 2008 19:04 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Hi,

I'm assuming the third-party code simply did a java.io.File write into
your project. If it did, after you come back from that code you need to
do a refresh on the project or folder where the files were written too.
If you don't then Eclipse doesn't know right away that those files were
changed. It will eventually notice this but maybe not right away if you
don't do a refresh.

See the IResource.refresh() method.

Andrew Mak wrote:
> Hi,
>
> I'm having a problem with reading some not update info from the jdt
> model. Here's my scenario...
>
> In my app I am using some third party code that generates some java
> source files into my project. Then my code needs to introspect those
> generated source files and perform some additional code gen based on
> that. What I find happening is when I introspect those source files,
> sometimes (seems to be random) I get incorrect results (e.g. getting no
> methods when there should be some).
>
> I find that if I trigger a build between the generation and my
> introspecting code, then I would get the right reuslts.
>
> So my question is, is a build absolutely necessary to force the jdt
> model to be updated? Is there some lighter weight method I can call
> instead of a build? I read in the javadocs that jdt has reconcile() and
> makeConsistent() methods, would these methods help with my problem?
>
> Thanks in advance
>
> Andrew
>

--
Thanks,
Rich Kulp
Previous Topic:Sychronizing projects and workspaces
Next Topic:Re: Selecting a package from the project
Goto Forum:
  


Current Time: Sun Jul 13 12:52:12 EDT 2025

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

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

Back to the top