Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Problem manipulating java source
Problem manipulating java source [message #142929] Wed, 18 February 2004 14:46 Go to next message
Stefan Holzknecht is currently offline Stefan HolzknechtFriend
Messages: 31
Registered: July 2009
Member
Hello,
I create and manipulate java sources using the provided jdt api's. I replace
text in the buffer of a ICompilationUnit to insert statements. After
replacing the compilation unit gets reconciled using
ICompilationUnit.reconcile(). But if I analyze created or manipulated
methods (got using IType.getMethods() or IType.findMethod(...) ) the source
of the method does not really reflect the changes I've done. The source
IMethod.getSource() is a fragment of the method as defined in the buffer
and contains just my inserted statements and a rest of the method; but that
it seams to me a rather accidental content. Debugging my application
(running on eclipse 2.1.2) I figured out that I'm not allowed to change
something in a workspace operation. But I could not figure out how I really
can make sure or test that the changes I've done in the buffer are
consistent wiith the java model.
Thanks for help.
Stefan
Re: Problem manipulating java source [message #142939 is a reply to message #142929] Wed, 18 February 2004 15:00 Go to previous messageGo to next message
Jerome Lanneluc is currently offline Jerome LannelucFriend
Messages: 572
Registered: July 2009
Senior Member
The Java model will be up-to-date at the end of the workbench modifying
operation.

Jerome

"Stefan Holzknecht" <s.holzknecht@intershop.de> wrote in message
news:c0vtd7$ri5$1@eclipse.org...
> Hello,
> I create and manipulate java sources using the provided jdt api's. I
replace
> text in the buffer of a ICompilationUnit to insert statements. After
> replacing the compilation unit gets reconciled using
> ICompilationUnit.reconcile(). But if I analyze created or manipulated
> methods (got using IType.getMethods() or IType.findMethod(...) ) the
source
> of the method does not really reflect the changes I've done. The source
> IMethod.getSource() is a fragment of the method as defined in the buffer
> and contains just my inserted statements and a rest of the method; but
that
> it seams to me a rather accidental content. Debugging my application
> (running on eclipse 2.1.2) I figured out that I'm not allowed to change
> something in a workspace operation. But I could not figure out how I
really
> can make sure or test that the changes I've done in the buffer are
> consistent wiith the java model.
> Thanks for help.
> Stefan
>
>
Re: Problem manipulating java source [message #142947 is a reply to message #142939] Wed, 18 February 2004 15:14 Go to previous messageGo to next message
Stefan Holzknecht is currently offline Stefan HolzknechtFriend
Messages: 31
Registered: July 2009
Member
Hi Jerome,
I do not manipulate the buffer in a workspace operation. And I do not
manipulate resources (the compilation unit is actually a working copy).
Therefore I did expect that the model is up to date after reconciling the
unit.
Stefan

"Jerome Lanneluc" <jerome_lanneluc@fr.ibm.com> wrote in message
news:c0vug8$t9t$1@eclipse.org...
> The Java model will be up-to-date at the end of the workbench modifying
> operation.
>
> Jerome
>
> "Stefan Holzknecht" <s.holzknecht@intershop.de> wrote in message
> news:c0vtd7$ri5$1@eclipse.org...
> > Hello,
> > I create and manipulate java sources using the provided jdt api's. I
> replace
> > text in the buffer of a ICompilationUnit to insert statements. After
> > replacing the compilation unit gets reconciled using
> > ICompilationUnit.reconcile(). But if I analyze created or manipulated
> > methods (got using IType.getMethods() or IType.findMethod(...) ) the
> source
> > of the method does not really reflect the changes I've done. The source
> > IMethod.getSource() is a fragment of the method as defined in the
buffer
> > and contains just my inserted statements and a rest of the method; but
> that
> > it seams to me a rather accidental content. Debugging my application
> > (running on eclipse 2.1.2) I figured out that I'm not allowed to change
> > something in a workspace operation. But I could not figure out how I
> really
> > can make sure or test that the changes I've done in the buffer are
> > consistent wiith the java model.
> > Thanks for help.
> > Stefan
> >
> >
>
>
Re: Problem manipulating java source [message #142967 is a reply to message #142947] Wed, 18 February 2004 15:29 Go to previous message
Jerome Lanneluc is currently offline Jerome LannelucFriend
Messages: 572
Registered: July 2009
Senior Member
Your expectation is right. It should be up-to-date after reconcile. Can you
please enter a bug report against JDT Core with steps to reproduce this
problem?

Thanks,
Jerome

"Stefan Holzknecht" <s.holzknecht@intershop.de> wrote in message
news:c0vv19$u58$1@eclipse.org...
> Hi Jerome,
> I do not manipulate the buffer in a workspace operation. And I do not
> manipulate resources (the compilation unit is actually a working copy).
> Therefore I did expect that the model is up to date after reconciling the
> unit.
> Stefan
>
> "Jerome Lanneluc" <jerome_lanneluc@fr.ibm.com> wrote in message
> news:c0vug8$t9t$1@eclipse.org...
> > The Java model will be up-to-date at the end of the workbench modifying
> > operation.
> >
> > Jerome
> >
> > "Stefan Holzknecht" <s.holzknecht@intershop.de> wrote in message
> > news:c0vtd7$ri5$1@eclipse.org...
> > > Hello,
> > > I create and manipulate java sources using the provided jdt api's. I
> > replace
> > > text in the buffer of a ICompilationUnit to insert statements. After
> > > replacing the compilation unit gets reconciled using
> > > ICompilationUnit.reconcile(). But if I analyze created or manipulated
> > > methods (got using IType.getMethods() or IType.findMethod(...) ) the
> > source
> > > of the method does not really reflect the changes I've done. The
source
> > > IMethod.getSource() is a fragment of the method as defined in the
> buffer
> > > and contains just my inserted statements and a rest of the method; but
> > that
> > > it seams to me a rather accidental content. Debugging my application
> > > (running on eclipse 2.1.2) I figured out that I'm not allowed to
change
> > > something in a workspace operation. But I could not figure out how I
> > really
> > > can make sure or test that the changes I've done in the buffer are
> > > consistent wiith the java model.
> > > Thanks for help.
> > > Stefan
> > >
> > >
> >
> >
>
>
Previous Topic:Problems with Classpath Container in Eclipse 3.0 M7
Next Topic:Debug Current Instruction Pointer
Goto Forum:
  


Current Time: Sun Jul 07 08:32:13 GMT 2024

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

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

Back to the top