Bug 183502

Summary: newcompilationUnit.imports().add(importdeclaration) not Working
Product: [Eclipse Project] JDT Reporter: Yogesh Arora <yogesh.minocha>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED INVALID QA Contact:
Severity: major    
Priority: P3    
Version: 3.2   
Target Milestone: 3.3 M7   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

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.