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 149218 Details for
Bug 194358
[import rewrite] Organize Imports produces wrong order of imports
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch for perf_35x
patch_194358_perf_35.txt (text/plain), 2.59 KB, created by
Jay Arthanareeswaran
on 2009-10-09 05:03:50 EDT
(
hide
)
Description:
Patch for perf_35x
Filename:
MIME Type:
Creator:
Jay Arthanareeswaran
Created:
2009-10-09 05:03:50 EDT
Size:
2.59 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.performance >Index: src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceASTTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceASTTests.java,v >retrieving revision 1.26 >diff -u -r1.26 FullSourceWorkspaceASTTests.java >--- src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceASTTests.java 7 Mar 2009 02:04:23 -0000 1.26 >+++ src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceASTTests.java 9 Oct 2009 08:52:08 -0000 >@@ -19,10 +19,15 @@ > > import junit.framework.*; > >+import org.eclipse.core.runtime.CoreException; > import org.eclipse.jdt.core.*; > import org.eclipse.jdt.core.compiler.IProblem; > import org.eclipse.jdt.core.dom.*; >+import org.eclipse.jdt.core.dom.rewrite.ImportRewrite; > import org.eclipse.jdt.core.tests.model.AbstractJavaModelTests; >+import org.eclipse.jface.text.BadLocationException; >+import org.eclipse.text.edits.MalformedTreeException; >+import org.osgi.service.prefs.BackingStoreException; > > /** > */ >@@ -733,4 +738,39 @@ > tagAsSummary("DOM AST tree for project files (JLS3)", true); // put in fingerprint > runAstCreation(getProject("org.eclipse.search")); > } >+ >+ private void rewriteImport(ICompilationUnit cu, String[] order, >+ int normalThreshold, int staticThreshold, >+ boolean restoreExistingImports) throws CoreException, >+ BackingStoreException, MalformedTreeException, BadLocationException { >+ >+ ImportRewrite rewrite = ImportRewrite >+ .create(cu, restoreExistingImports); >+ rewrite.setImportOrder(order); >+ rewrite.setOnDemandImportThreshold(normalThreshold); >+ rewrite.setStaticOnDemandImportThreshold(staticThreshold); >+ rewrite.rewriteImports(null); >+ } >+ >+ public void testPerfImportRewrite() throws MalformedTreeException, CoreException, BackingStoreException, BadLocationException { >+ tagAsSummary("testPerfImportRewrite", false); // do NOT put in fingerprint >+ >+ String[] order= new String[] {"org", "javax", "java"}; >+ ICompilationUnit unit = getCompilationUnit("org.eclipse.jdt.core", "org.eclipse.jdt.internal.core", "JavaProject.java"); >+ >+ int measures = MEASURES_COUNT; >+ int internalLoop = 10; >+ for (int i = 0; i < measures; i++) { >+ runGc(); >+ startMeasuring(); >+ for (int index = 0; index < internalLoop; index++ ) { >+ rewriteImport(unit, order, 99, 99, false); >+ } >+ stopMeasuring(); >+ } >+ commitMeasurements(); >+ assertPerformance(); >+ >+ } >+ > }
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
Flags:
frederic_fusier
:
iplog+
frederic_fusier
:
review+
Actions:
View
|
Diff
Attachments on
bug 194358
:
122186
|
148389
|
148758
|
149099
| 149218 |
151351
|
151446
|
151922
|
152135
|
152716