Bug 183502 - newcompilationUnit.imports().add(importdeclaration) not Working
Summary: newcompilationUnit.imports().add(importdeclaration) not Working
Status: VERIFIED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows 2000
: P3 major (vote)
Target Milestone: 3.3 M7   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-21 09:23 EDT by Yogesh Arora CLA
Modified: 2007-05-03 20:56 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yogesh Arora CLA 2007-04-21 09:23:24 EDT
Build ID:  M20060629-1905

Steps To Reproduce:
1.get the Imports List from the compilationUnit and then newcompilationUnit.imports().add(importdeclaration) the statements blocks the next line of codes. 
2.
3.


More information:
I am trying to add new Import Statements in the JAVA Class 
but the line of code blocks the ext Lines and not give proper results.
Comment 1 Olivier Thomann CLA 2007-04-21 15:40:13 EDT
You should look at the javadoc of the class org.eclipse.jdt.core.dom.rewrite.ASTRewrite. This might help.

Also please describe what you mean by "not give proper results".
Comment 2 Yogesh Arora CLA 2007-04-23 01:30:51 EDT
(In reply to comment #0)
> Build ID:  M20060629-1905
> 
> Steps To Reproduce:
> 1.get the Imports List from the compilationUnit and then
> newcompilationUnit.imports().add(importdeclaration) the statements blocks the
> next line of codes. 
> 2.
> 3.
> 
> 
> More information:
> I am trying to add new Import Statements in the JAVA Class 
> but the line of code blocks the ext Lines and not give proper results.
> 

(In reply to comment #1)
> You should look at the javadoc of the class
> org.eclipse.jdt.core.dom.rewrite.ASTRewrite. This might help.
> 
> Also please describe what you mean by "not give proper results".
> 

I mean to say the Compilation Unit does not show the added import Statement
Comment 3 Olivier Thomann CLA 2007-04-23 08:49:50 EDT
So did you try the AST Rewrite?
Closing as INVALID since ASTRewrite is the way to go.
Please reopen if using it doesn't work using ASTRewrite.
Comment 4 Olivier Thomann CLA 2007-05-03 20:56:01 EDT
Verify for 3.3M7 with I20070503-1400.