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 66522 Details for
Bug 185452
[search] for all packages seems hung
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v02.txt (text/plain), 4.87 KB, created by
Frederic Fusier
on 2007-05-09 13:41:59 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2007-05-09 13:41:59 EDT
Size:
4.87 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.performance >Index: src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceSearchTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceSearchTests.java,v >retrieving revision 1.33 >diff -u -r1.33 FullSourceWorkspaceSearchTests.java >--- src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceSearchTests.java 24 Apr 2007 11:00:43 -0000 1.33 >+++ src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceSearchTests.java 9 May 2007 17:24:21 -0000 >@@ -660,4 +660,40 @@ > commitMeasurements(); > assertPerformance(); > } >+ >+ /** >+ * Performance tests for search: Package Declarations on all workspaces >+ */ >+ public void testSearchPackageDeclarationsWorkspace() throws CoreException { >+ tagAsSummary("Search workspace package declarations", false); // do NOT put in fingerprint >+ >+ // Wait for indexing end >+ AbstractJavaModelTests.waitUntilIndexesReady(); >+ >+ // Warm up >+ IJavaSearchScope scope = SearchEngine.createWorkspaceScope(); >+ String name = "*"; >+ JavaSearchResultCollector resultCollector = new JavaSearchResultCollector(); >+ for (int i=0 ; i<WARMUP_COUNT; i++) { >+ search(name, PACKAGE, DECLARATIONS, scope, resultCollector); >+ if (i==0) { >+ System.out.println(" - "+INT_FORMAT.format(resultCollector.count)+" package declarations in workspace."); >+ } >+ } >+ >+ // Measures >+ for (int i=0; i<MEASURES_COUNT; i++) { >+ cleanCategoryTableCache(false, scope, resultCollector); >+ runGc(); >+ startMeasuring(); >+ // TODO (frederic) increase time for this test in next version as bug 183062 fix make its time around 2ms! >+ for (int j=0; j<10; j++) >+ search(name, PACKAGE, DECLARATIONS, scope, resultCollector); >+ stopMeasuring(); >+ } >+ >+ // Commit >+ commitMeasurements(); >+ assertPerformance(); >+ } > } >#P org.eclipse.jdt.core >Index: search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java,v >retrieving revision 1.291 >diff -u -r1.291 MatchLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java 25 Apr 2007 16:59:23 -0000 1.291 >+++ search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java 9 May 2007 17:24:23 -0000 >@@ -1235,42 +1235,35 @@ > return; > } > PackageDeclarationPattern pkgPattern = (PackageDeclarationPattern) searchPattern; >- IPath[] scopeProjectsAndJars = this.scope.enclosingProjectsAndJars(); >- int scopeLength = scopeProjectsAndJars.length; > IJavaProject[] projects = JavaModelManager.getJavaModelManager().getJavaModel().getJavaProjects(); >+ SimpleSet packages = new SimpleSet(); > for (int i = 0, length = projects.length; i < length; i++) { >- IJavaProject javaProject = projects[i]; >- // Verify that project belongs to the scope >- boolean found = false; >- for (int j=0; j<scopeLength; j++) { >- if (projects[i].getPath().equals(scopeProjectsAndJars[j])) { >- found = true; >- break; >- } >- } >- if (!found) continue; > this.nameLookup = ((JavaProject) projects[i]).newNameLookup(this.workingCopies); > IPackageFragment[] packageFragments = this.nameLookup.findPackageFragments(new String(pkgPattern.pkgName), true, true); > int pLength = packageFragments == null ? 0 : packageFragments.length; > for (int p=0; p<pLength; p++) { > IPackageFragment fragment = packageFragments[p]; >- IResource resource = fragment.getResource(); >- if (resource == null) // case of a file in an external jar >- resource = javaProject.getProject(); >- try { >- if (encloses(fragment)) { >- SearchMatch match = new PackageDeclarationMatch(fragment, SearchMatch.A_ACCURATE, -1, -1, participant, resource); >- report(match); >+ if (packages.addIfNotIncluded(fragment) == null) continue; >+ if (encloses(fragment)) { >+ IResource resource = fragment.getResource(); >+ if (resource == null) // case of a file in an external jar >+ resource = fragment.getJavaProject().getProject(); >+ try { >+ if (encloses(fragment)) { >+ SearchMatch match = new PackageDeclarationMatch(fragment, SearchMatch.A_ACCURATE, -1, -1, participant, resource); >+ report(match); >+ } >+ } catch (JavaModelException e) { >+ throw e; >+ } catch (CoreException e) { >+ throw new JavaModelException(e); > } >- } catch (JavaModelException e) { >- throw e; >- } catch (CoreException e) { >- throw new JavaModelException(e); > } > } > } > } > } >+// */ > protected IType lookupType(ReferenceBinding typeBinding) { > if (typeBinding == null) return null; >
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 185452
:
66522
|
66833