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 18249 Details for
Bug 72258
[model] Should be able to dynamicaly set the size of Java model cache
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch to apply on org.elipse.jdt.core v_538
org.eclipse.jdt.core_patch72258.txt (text/plain), 6.21 KB, created by
Jerome Lanneluc
on 2005-02-23 13:16:56 EST
(
hide
)
Description:
Patch to apply on org.elipse.jdt.core v_538
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2005-02-23 13:16:56 EST
Size:
6.21 KB
patch
obsolete
>Index: model/org/eclipse/jdt/internal/core/JavaModelCache.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelCache.java,v >retrieving revision 1.18 >diff -u -r1.18 JavaModelCache.java >--- model/org/eclipse/jdt/internal/core/JavaModelCache.java 23 Feb 2005 02:47:29 -0000 1.18 >+++ model/org/eclipse/jdt/internal/core/JavaModelCache.java 23 Feb 2005 18:15:04 -0000 >@@ -11,7 +11,6 @@ > package org.eclipse.jdt.internal.core; > import java.text.NumberFormat; > import java.util.HashMap; >-import java.util.Iterator; > import java.util.Map; > > import org.eclipse.jdt.core.IJavaElement; >@@ -65,59 +64,6 @@ > this.childrenCache = new HashMap(DEFAULT_CHILDREN_SIZE); > } > >-/* >- * Ensures there is enough room in each ElementCache to put the given new elements. >- */ >-protected void ensureSpaceLimit(Map newElements) { >- int rootSize = 0; >- IJavaElement project = null; >- int pkgSize = 0; >- IJavaElement root = null; >- int openableSize = 0; >- IJavaElement pkg = null; >- Iterator iterator = newElements.keySet().iterator(); >- while (iterator.hasNext()) { >- IJavaElement element = (IJavaElement) iterator.next(); >- switch (element.getElementType()) { >- case IJavaElement.PACKAGE_FRAGMENT_ROOT: >- project = element.getParent(); >- rootSize++; >- break; >- case IJavaElement.PACKAGE_FRAGMENT: >- root = element.getParent(); >- pkgSize++; >- break; >- case IJavaElement.COMPILATION_UNIT: >- case IJavaElement.CLASS_FILE: >- pkg = element.getParent(); >- openableSize++; >- break; >- } >- } >- this.rootCache.ensureSpaceLimit(rootSize, project); >- this.pkgCache.ensureSpaceLimit(pkgSize, root); >- this.openableCache.ensureSpaceLimit(openableSize, pkg); >-} >- >-/* >- * The given element is being removed. >- * Ensures that the corresponding children cache's space limit is reset if this was the parent >- * that increased the space limit. >- */ >-protected void resetSpaceLimit(IJavaElement element) { >- switch (element.getElementType()) { >- case IJavaElement.JAVA_PROJECT: >- this.rootCache.resetSpaceLimit(DEFAULT_ROOT_SIZE, element); >- break; >- case IJavaElement.PACKAGE_FRAGMENT_ROOT: >- this.pkgCache.resetSpaceLimit(DEFAULT_PKG_SIZE, element); >- break; >- case IJavaElement.PACKAGE_FRAGMENT: >- this.openableCache.resetSpaceLimit(DEFAULT_OPENABLE_SIZE, element); >- break; >- } >-} >- > /** > * Returns the info for the element. > */ >@@ -171,12 +117,15 @@ > break; > case IJavaElement.JAVA_PROJECT: > this.projectCache.put(element, info); >+ this.rootCache.ensureSpaceLimit(((JavaElementInfo) info).children.length, element); > break; > case IJavaElement.PACKAGE_FRAGMENT_ROOT: > this.rootCache.put(element, info); >+ this.pkgCache.ensureSpaceLimit(((JavaElementInfo) info).children.length, element); > break; > case IJavaElement.PACKAGE_FRAGMENT: > this.pkgCache.put(element, info); >+ this.openableCache.ensureSpaceLimit(((JavaElementInfo) info).children.length, element); > break; > case IJavaElement.COMPILATION_UNIT: > case IJavaElement.CLASS_FILE: >@@ -196,12 +145,15 @@ > break; > case IJavaElement.JAVA_PROJECT: > this.projectCache.remove(element); >+ this.rootCache.resetSpaceLimit(DEFAULT_ROOT_SIZE, element); > break; > case IJavaElement.PACKAGE_FRAGMENT_ROOT: > this.rootCache.remove(element); >+ this.pkgCache.resetSpaceLimit(DEFAULT_PKG_SIZE, element); > break; > case IJavaElement.PACKAGE_FRAGMENT: > this.pkgCache.remove(element); >+ this.openableCache.resetSpaceLimit(DEFAULT_OPENABLE_SIZE, element); > break; > case IJavaElement.COMPILATION_UNIT: > case IJavaElement.CLASS_FILE: >Index: model/org/eclipse/jdt/internal/core/JavaModelManager.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java,v >retrieving revision 1.250 >diff -u -r1.250 JavaModelManager.java >--- model/org/eclipse/jdt/internal/core/JavaModelManager.java 23 Feb 2005 02:47:29 -0000 1.250 >+++ model/org/eclipse/jdt/internal/core/JavaModelManager.java 23 Feb 2005 18:15:06 -0000 >@@ -480,7 +480,7 @@ > pkgPath = pkgPath.removeLastSegments(1); > } > String[] pkgName = pkgPath.segments(); >- if (pkgName == null || JavaConventions.validatePackageName(Util.packageName(pkgPath)).getSeverity() == IStatus.ERROR) { >+ if (pkgName.length != 0 && JavaConventions.validatePackageName(Util.packageName(pkgPath)).getSeverity() == IStatus.ERROR) { > return null; > } > return root.getPackageFragment(pkgName); >@@ -1511,9 +1511,6 @@ > } > } > >- // ensure that the elements that are being added have enough room >- this.cache.ensureSpaceLimit(newElements); >- > Iterator iterator = newElements.keySet().iterator(); > while (iterator.hasNext()) { > IJavaElement element = (IJavaElement)iterator.next(); >@@ -1651,7 +1648,6 @@ > } > } > this.cache.removeInfo(element); >- this.cache.resetSpaceLimit(element); > if (wasVerbose) { > System.out.println(this.cache.toStringFillingRation("-> ")); //$NON-NLS-1$ > } >Index: model/org/eclipse/jdt/internal/core/JavaModelOperation.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelOperation.java,v >retrieving revision 1.55 >diff -u -r1.55 JavaModelOperation.java >--- model/org/eclipse/jdt/internal/core/JavaModelOperation.java 23 Feb 2005 02:47:29 -0000 1.55 >+++ model/org/eclipse/jdt/internal/core/JavaModelOperation.java 23 Feb 2005 18:15:07 -0000 >@@ -729,7 +729,12 @@ > if (!(openable instanceof CompilationUnit) || !((CompilationUnit) openable).isWorkingCopy()) { // a working copy must remain a child of its parent even after a move > ((JavaElement) openable.getParent()).close(); > } >- ((JavaProject) element.getJavaProject()).resetCaches(); >+ switch (element.getElementType()) { >+ case IJavaElement.PACKAGE_FRAGMENT_ROOT: >+ case IJavaElement.PACKAGE_FRAGMENT: >+ ((JavaProject) element.getJavaProject()).resetCaches(); >+ break; >+ } > } > > // fire only iff:
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 72258
:
18104
|
18237
|
18239
| 18249