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 67417 Details for
Bug 133141
Must JavaCore.create(IFile) always do full checks?
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix and performance test
133141.txt (text/plain), 4.42 KB, created by
Jerome Lanneluc
on 2007-05-16 10:52:33 EDT
(
hide
)
Description:
Proposed fix and performance test
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2007-05-16 10:52:33 EDT
Size:
4.42 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/JavaModelManager.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java,v >retrieving revision 1.369 >diff -u -r1.369 JavaModelManager.java >--- model/org/eclipse/jdt/internal/core/JavaModelManager.java 18 Apr 2007 13:08:16 -0000 1.369 >+++ model/org/eclipse/jdt/internal/core/JavaModelManager.java 16 May 2007 14:46:16 -0000 >@@ -47,6 +47,7 @@ > import org.eclipse.jdt.internal.compiler.env.AccessRestriction; > import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; > import org.eclipse.jdt.internal.compiler.util.HashtableOfObjectToInt; >+import org.eclipse.jdt.internal.core.JavaProjectElementInfo.ProjectCache; > import org.eclipse.jdt.internal.core.builder.JavaBuilder; > import org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy; > import org.eclipse.jdt.internal.core.search.AbstractSearchScope; >@@ -55,6 +56,7 @@ > import org.eclipse.jdt.internal.core.search.JavaWorkspaceScope; > import org.eclipse.jdt.internal.core.search.indexing.IndexManager; > import org.eclipse.jdt.internal.core.search.processing.JobManager; >+import org.eclipse.jdt.internal.core.util.HashtableOfArrayToObject; > import org.eclipse.jdt.internal.core.util.LRUCache; > import org.eclipse.jdt.internal.core.util.Messages; > import org.eclipse.jdt.internal.core.util.Util; >@@ -893,6 +895,9 @@ > > IPath resourcePath = resource.getFullPath(); > try { >+ JavaProjectElementInfo projectInfo = (JavaProjectElementInfo) getJavaModelManager().getInfo(project); >+ ProjectCache projectCache = projectInfo == null ? null : projectInfo.projectCache; >+ HashtableOfArrayToObject allPkgFragmentsCache = projectCache == null ? null : projectCache.allPkgFragmentsCache; > IClasspathEntry[] entries = > org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(resourcePath.lastSegment()) > ? project.getRawClasspath() // JAVA file can only live inside SRC folder (on the raw path) >@@ -922,6 +927,12 @@ > pkgPath = pkgPath.removeLastSegments(1); > } > String[] pkgName = pkgPath.segments(); >+ >+ // if package name is in the cache, then it has already been validated >+ // (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=133141) >+ if (allPkgFragmentsCache != null && allPkgFragmentsCache.containsKey(pkgName)) >+ return root.getPackageFragment(pkgName); >+ > if (pkgName.length != 0 && JavaConventions.validatePackageName(Util.packageName(pkgPath, sourceLevel, complianceLevel), sourceLevel, complianceLevel).getSeverity() == IStatus.ERROR) { > return null; > } >#P org.eclipse.jdt.core.tests.performance >Index: src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java,v >retrieving revision 1.31 >diff -u -r1.31 FullSourceWorkspaceModelTests.java >--- src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java 1 May 2007 16:16:45 -0000 1.31 >+++ src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java 16 May 2007 14:46:17 -0000 >@@ -846,6 +846,38 @@ > assertPerformance(); > } > >+/* >+ * Tests the performance of JavaCore#create(IResource). >+ * (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=133141) >+ */ >+public void testCreateJavaElement() throws CoreException { >+ // setup (force the project cache to be created) >+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(BIG_PROJECT_TYPE_PATH); >+ getNameLookup((JavaProject) JavaCore.create(file.getProject())); >+ >+ // warm up >+ int warmup = WARMUP_COUNT / 10; >+ int iterations = 5000; >+ for (int i = 0; i < warmup; i++) { >+ for (int j = 0; j < iterations; j++) { >+ JavaCore.create(file); >+ } >+ } >+ >+ // measure performance >+ for (int i = 0; i < MEASURES_COUNT; i++) { >+ runGc(); >+ startMeasuring(); >+ for (int j = 0; j < iterations; j++) { >+ JavaCore.create(file); >+ } >+ stopMeasuring(); >+ } >+ >+ commitMeasurements(); >+ assertPerformance(); >+} >+ > public void testInitJDTPlugin() throws JavaModelException, CoreException { > tagAsSummary("JDT/Core plugin initialization", true); // put in fingerprint >
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 133141
: 67417