Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 213326 Details for
Bug 71761
[import rewrite] ImportRewrite should let me add explicit import to existing on demand import
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Test case patch
test.txt (text/plain), 1.91 KB, created by
Satyam Kandula
on 2012-03-29 07:01:00 EDT
(
hide
)
Description:
Test case patch
Filename:
MIME Type:
Creator:
Satyam Kandula
Created:
2012-03-29 07:01:00 EDT
Size:
1.91 KB
patch
obsolete
>diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ImportRewriteTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ImportRewriteTest.java >index f96f005..bbfb8f1 100644 >--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ImportRewriteTest.java >+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ImportRewriteTest.java >@@ -1539,4 +1539,46 @@ > compilationUnit.getBuffer().setContents(document.get()); > } > >+ public void testBug71761() throws Exception { >+ >+ IPackageFragment pack1= this.sourceFolder.createPackageFragment("pack1", false, null); >+ StringBuffer buf= new StringBuffer(); >+ buf.append("package pack1;\n"); >+ buf.append("\n"); >+ buf.append("import pack2.*;\n"); >+ buf.append("public class C {\n"); >+ buf.append("}\n"); >+ ICompilationUnit cu= pack1.createCompilationUnit("C.java", buf.toString(), false, null); >+ >+ buf= new StringBuffer(); >+ buf.append("package pack1;\n"); >+ buf.append("\n"); >+ buf.append("public class A {\n"); >+ buf.append("}\n"); >+ pack1.createCompilationUnit("A.java", buf.toString(), false, null); >+ >+ IPackageFragment pack2= this.sourceFolder.createPackageFragment("pack2", false, null); >+ buf= new StringBuffer(); >+ buf.append("package pack2;\n"); >+ buf.append("public class A {\n"); >+ buf.append("}\n"); >+ pack2.createCompilationUnit("A.java", buf.toString(), false, null); >+ >+ String[] order= new String[] { "pack2" }; >+ >+ ImportRewrite imports= newImportsRewrite(cu, order, 99, 99, true); >+ imports.addImport("pack2.A"); >+ >+ apply(imports); >+ >+ buf= new StringBuffer(); >+ buf.append("package pack1;\n"); >+ buf.append("\n"); >+ buf.append("import pack2.*;\n"); >+ buf.append("import pack2.A;\n"); >+ buf.append("public class C {\n"); >+ buf.append("}\n"); >+ assertEqualString(cu.getSource(), buf.toString()); >+ } >+ > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 71761
: 213326