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 152025 Details for
Bug 288211
APT uses a lot of memory
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch for 3.5.1
patch1.txt (text/plain), 7.54 KB, created by
Satyam Kandula
on 2009-11-12 04:34:24 EST
(
hide
)
Description:
Proposed patch for 3.5.1
Filename:
MIME Type:
Creator:
Satyam Kandula
Created:
2009-11-12 04:34:24 EST
Size:
7.54 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.apt.core >Index: src/org/eclipse/jdt/apt/core/internal/env/BaseProcessorEnv.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/env/BaseProcessorEnv.java,v >retrieving revision 1.34 >diff -u -r1.34 BaseProcessorEnv.java >--- src/org/eclipse/jdt/apt/core/internal/env/BaseProcessorEnv.java 2 Sep 2008 16:49:00 -0000 1.34 >+++ src/org/eclipse/jdt/apt/core/internal/env/BaseProcessorEnv.java 12 Nov 2009 09:12:11 -0000 >@@ -853,6 +853,7 @@ > p.setBindingsRecovery(true); > p.setProject( javaProject ); > p.setKind( ASTParser.K_COMPILATION_UNIT ); >+ p.setIgnoreMethodStatements(true); > p.createASTs( parseUnits, keys, requestor, null); > } > >#P org.eclipse.jdt.core >Index: dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java,v >retrieving revision 1.133.2.2 >diff -u -r1.133.2.2 CompilationUnitResolver.java >--- dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java 27 Aug 2009 14:52:51 -0000 1.133.2.2 >+++ dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java 12 Nov 2009 09:12:25 -0000 >@@ -470,7 +470,7 @@ > getRequestor(), > problemFactory, > monitor); >- >+ if ((flags & ICompilationUnit.IGNORE_METHOD_STATEMENTS) != 0) resolver.parser.setIgnoreMethodStatements(true); > resolver.resolve(compilationUnits, bindingKeys, requestor, apiLevel, options, owner, flags); > if (NameLookup.VERBOSE) { > System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInSourcePackage: " + environment.nameLookup.timeSpentInSeekTypesInSourcePackage + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ >Index: dom/org/eclipse/jdt/core/dom/ASTParser.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java,v >retrieving revision 1.88 >diff -u -r1.88 ASTParser.java >--- dom/org/eclipse/jdt/core/dom/ASTParser.java 27 Apr 2009 08:46:43 -0000 1.88 >+++ dom/org/eclipse/jdt/core/dom/ASTParser.java 12 Nov 2009 09:12:24 -0000 >@@ -149,6 +149,10 @@ > private boolean statementsRecovery; > > /** >+ * Request to ignore parsing the method Statements. Defaults to <code>false</code>. >+ */ >+ private boolean ignoreMethodStatements; >+ /** > * Request for a bindings recovery. Defaults to <code>false</code>. > */ > private boolean bindingsRecovery; >@@ -226,6 +230,7 @@ > this.rawSource = null; > this.typeRoot = null; > this.resolveBindings = false; >+ this.ignoreMethodStatements = false; > this.sourceLength = -1; > this.sourceOffset = 0; > this.workingCopyOwner = DefaultWorkingCopyOwner.PRIMARY; >@@ -564,6 +569,21 @@ > public void setStatementsRecovery(boolean enabled) { > this.statementsRecovery = enabled; > } >+ >+ /** >+ * Requests that the compiler should ignore method statements. >+ * >+ * Default to <code>false</code>. >+ * </p> >+ * >+ * @param enabled <code>true</code> if method statements should be ignored >+ * and <code>false</code> if the method statements should be parsed. >+ * >+ * @since 3.5.2 >+ */ >+ public void setIgnoreMethodStatements(boolean enabled) { >+ this.ignoreMethodStatements = enabled; >+ } > > /** > * Sets the working copy owner using when resolving bindings, where >@@ -730,6 +750,7 @@ > try { > int flags = 0; > if (this.statementsRecovery) flags |= ICompilationUnit.ENABLE_STATEMENTS_RECOVERY; >+ if (this.ignoreMethodStatements) flags |= ICompilationUnit.IGNORE_METHOD_STATEMENTS; > if (this.resolveBindings) { > if (this.project == null) > throw new IllegalStateException("project not specified"); //$NON-NLS-1$ >@@ -790,6 +811,7 @@ > int flags = 0; > if (this.statementsRecovery) flags |= ICompilationUnit.ENABLE_STATEMENTS_RECOVERY; > if (this.bindingsRecovery) flags |= ICompilationUnit.ENABLE_BINDINGS_RECOVERY; >+ if (this.ignoreMethodStatements) flags |= ICompilationUnit.IGNORE_METHOD_STATEMENTS; > return CompilationUnitResolver.resolve(elements, this.apiLevel, this.compilerOptions, this.project, this.workingCopyOwner, flags, monitor); > } finally { > // re-init defaults to allow reuse (and avoid leaking) >Index: compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java,v >retrieving revision 1.403.2.2 >diff -u -r1.403.2.2 Parser.java >--- compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java 22 Jun 2009 14:00:11 -0000 1.403.2.2 >+++ compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java 12 Nov 2009 09:12:23 -0000 >@@ -8513,6 +8513,10 @@ > > if (unit == null) return; > >+ // some clients like APT may not need the ASTs for the method statements >+ if (this.options.ignoreMethodStatements) >+ return; >+ > if (unit.ignoreMethodBodies) { > unit.ignoreFurtherInvestigation = true; > return; >@@ -10549,6 +10553,9 @@ > if(enabled) this.options.performMethodsFullRecovery = true; > this.options.performStatementsRecovery = enabled; > } >+public void setIgnoreMethodStatements(boolean enabled) { >+ this.options.ignoreMethodStatements = enabled; >+} > public String toString() { > > >Index: compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java,v >retrieving revision 1.215 >diff -u -r1.215 CompilerOptions.java >--- compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java 24 Apr 2009 13:31:26 -0000 1.215 >+++ compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java 12 Nov 2009 09:12:15 -0000 >@@ -325,6 +325,8 @@ > public boolean performMethodsFullRecovery; > /** Specify if parser perform statements recovery */ > public boolean performStatementsRecovery; >+ /** Specify if the parser should ignore parsing the method statements */ >+ public boolean ignoreMethodStatements; > /** Control whether annotation processing is enabled */ > public boolean processAnnotations; > /** Store annotations */ >@@ -1028,6 +1030,9 @@ > // parser perform statements recovery > this.performStatementsRecovery = true; > >+ // parser ignore parsing method statements >+ this.ignoreMethodStatements = false; >+ > // store annotations > this.storeAnnotations = false; > >Index: model/org/eclipse/jdt/core/ICompilationUnit.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ICompilationUnit.java,v >retrieving revision 1.69 >diff -u -r1.69 ICompilationUnit.java >--- model/org/eclipse/jdt/core/ICompilationUnit.java 28 Jan 2009 14:42:53 -0000 1.69 >+++ model/org/eclipse/jdt/core/ICompilationUnit.java 12 Nov 2009 09:12:25 -0000 >@@ -63,6 +63,14 @@ > public static final int ENABLE_BINDINGS_RECOVERY = 0x04; > > /** >+ * Constant indicating that a reconcile operation should ignore parsing the method statements. >+ * @see ASTParser#setIgnoreMethodStatements(boolean) >+ * @since 3.5.2 >+ */ >+public static final int IGNORE_METHOD_STATEMENTS = 0x08; >+ >+ >+/** > * Applies a text edit to the compilation unit's buffer. > * <p> > * Note that the edit is simply applied to the compilation unit's buffer.
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 288211
:
152025
|
152566
|
152688
|
152956
|
152989
|
153054
|
153055
|
153180
|
153220
|
153221
|
153295