Bug 173814 - IJavaElement not refresh after AST saved to the Buffer
Summary: IJavaElement not refresh after AST saved to the Buffer
Status: VERIFIED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.4 M4   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-11 20:20 EST by Eddie Man CLA
Modified: 2007-12-11 07:36 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eddie Man CLA 2007-02-11 20:20:25 EST
Build ID: M20060921-0945

Steps To Reproduce:
1. Create the ICompilationUnit using the JavaCore
2. Get the IMethod from a created ICompilationUnit
3. Create the CompilationUnit using the ASTParser (JLS3)
4. Get the MethodDeclaration from the CompilationUnit
5. Invoke MethodDeclaration.setConstructor(true)
6. Save the change of the AST to the buffer
    DocumentAdapter document = new DocumentAdpater(ICompilationUnit.getBuffer());
    TextEdit edit = CompilationUnit.rewrite(document, null);
    edit.apply(document);
7. Invoke the IMethod.isConstructor()

Result : The IMethod.isConstructor still return false.


More information:
Comment 1 Jerome Lanneluc CLA 2007-02-20 07:56:58 EST
Are you calling reconcile(...) on the ICompilationUnit after you save the IBuffer ?
Comment 2 Eddie Man CLA 2007-02-22 23:17:26 EST
need to call reconcile manually? will not refresh automatically?
Comment 3 Jerome Lanneluc CLA 2007-11-30 10:20:30 EST
Yes, reconcile must be called when making changes to the buffer so as to bring the working copy in sync with the buffer.
Comment 4 Jerome Lanneluc CLA 2007-11-30 10:21:21 EST
No further action.
Comment 5 David Audel CLA 2007-12-11 07:36:02 EST
Verified for 3.4M4.