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 34262 Details for
Bug 126709
ImportRewriteAnalizer#useSpaceBetweenGroups uses 23% cpu time in organize imports performance test
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
fix_126709.txt (text/plain), 2.46 KB, created by
Benno Baumgartner
on 2006-02-07 06:16:19 EST
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Benno Baumgartner
Created:
2006-02-07 06:16:19 EST
Size:
2.46 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: dom/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer.java,v >retrieving revision 1.6 >diff -u -r1.6 ImportRewriteAnalyzer.java >--- dom/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer.java 13 Jan 2006 09:36:49 -0000 1.6 >+++ dom/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer.java 7 Feb 2006 11:17:36 -0000 >@@ -30,10 +30,13 @@ > import org.eclipse.jdt.core.dom.ImportDeclaration; > import org.eclipse.jdt.core.dom.PackageDeclaration; > import org.eclipse.jdt.core.formatter.CodeFormatter; >+import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants; > import org.eclipse.jdt.core.search.IJavaSearchConstants; > import org.eclipse.jdt.core.search.IJavaSearchScope; > import org.eclipse.jdt.core.search.SearchEngine; > import org.eclipse.jdt.core.search.TypeNameRequestor; >+import org.eclipse.jdt.internal.formatter.DefaultCodeFormatter; >+import org.eclipse.jdt.internal.formatter.DefaultCodeFormatterOptions; > import org.eclipse.jface.text.BadLocationException; > import org.eclipse.jface.text.Document; > import org.eclipse.jface.text.IRegion; >@@ -637,20 +640,8 @@ > * @return Probes if the formatter allows spaces between imports > */ > private boolean useSpaceBetweenGroups() { >- try { >- String sample= "import a.A;\n\n import b.B;\nclass C {}"; //$NON-NLS-1$ >- TextEdit res= ToolFactory.createCodeFormatter(this.compilationUnit.getJavaProject().getOptions(true)).format(CodeFormatter.K_COMPILATION_UNIT, sample, 0, sample.length(), 0, String.valueOf('\n')); >- Document doc= new Document(sample); >- res.apply(doc); >- int idx1= doc.search(0, "import", true, true, false); //$NON-NLS-1$ >- int line1= doc.getLineOfOffset(idx1); >- int idx2= doc.search(idx1 + 1, "import", true, true, false); //$NON-NLS-1$ >- int line2= doc.getLineOfOffset(idx2); >- return line2 - line1 > 1; >- } catch (BadLocationException e) { >- // should not happen >- } >- return true; >+ String option= this.compilationUnit.getJavaProject().getOption(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, true); >+ return Integer.valueOf(option).intValue() > 0; > } > > private Set evaluateStarImportConflicts(IProgressMonitor monitor) throws JavaModelException {
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 126709
: 34262