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 62217 Details for
Bug 179699
type.newTypeHierarchy doesn't cancel
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Proposed fix and rmodified test
179699.txt (text/plain), 3.40 KB, created by
Jerome Lanneluc
on 2007-03-28 09:12:54 EDT
(
hide
)
Description:
Proposed fix and rmodified test
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2007-03-28 09:12:54 EDT
Size:
3.40 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java,v >retrieving revision 1.102 >diff -u -r1.102 IndexBasedHierarchyBuilder.java >--- model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java 6 Mar 2007 02:38:51 -0000 1.102 >+++ model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java 28 Mar 2007 13:12:09 -0000 >@@ -16,6 +16,7 @@ > import org.eclipse.core.resources.IResource; > import org.eclipse.core.runtime.IPath; > import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.core.runtime.NullProgressMonitor; > import org.eclipse.core.runtime.SubProgressMonitor; > import org.eclipse.jdt.core.*; > import org.eclipse.jdt.core.compiler.CharOperation; >@@ -444,7 +445,7 @@ > final Map binariesFromIndexMatches, > final IPathRequestor pathRequestor, > int waitingPolicy, // WaitUntilReadyToSearch | ForceImmediateSearch | CancelIfNotReadyToSearch >- IProgressMonitor progressMonitor) { >+ final IProgressMonitor progressMonitor) { > > /* embed constructs inside arrays so as to pass them to (inner) collector */ > final Queue queue = new Queue(); >@@ -519,7 +520,16 @@ > > // search all index references to a given supertype > pattern.superSimpleName = currentTypeName; >- indexManager.performConcurrentJob(job, waitingPolicy, null); // no sub progress monitor since its too costly for deep hierarchies >+ indexManager.performConcurrentJob(job, waitingPolicy, progressMonitor == null ? null : new NullProgressMonitor() { >+ // don't report progress since this is too costly for deep hierarchies >+ // just handle isCanceled() (seehttps://bugs.eclipse.org/bugs/show_bug.cgi?id=179511) >+ public void setCanceled(boolean value) { >+ progressMonitor.setCanceled(value); >+ } >+ public boolean isCanceled() { >+ return progressMonitor.isCanceled(); >+ } >+ }); > if (progressMonitor != null && ++ticks <= MAXTICKS) > progressMonitor.worked(1); > >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java,v >retrieving revision 1.70 >diff -u -r1.70 TypeHierarchyTests.java >--- src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java 14 Mar 2007 08:18:39 -0000 1.70 >+++ src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java 28 Mar 2007 13:12:15 -0000 >@@ -620,6 +620,7 @@ > createFile("/P3/Y.java", "public class Y extends X {}"); > createFile("/P3/Z.java", "public class Z extends X {}"); > createFile("/P2/W.java", "public class W extends X {}"); >+ waitUntilIndexesReady(); > IType type = getCompilationUnit("/P1/X.java").getType("X"); > class ProgressCounter extends TestProgressMonitor { > int count = 0; >@@ -630,7 +631,7 @@ > } > ProgressCounter counter = new ProgressCounter(); > type.newTypeHierarchy(counter); >- assertEquals("Unexpected work count", 18, counter.count); >+ assertEquals("Unexpected work count", 89, counter.count); > } finally { > deleteProjects(new String[] {"P1", "P2", "P3"}); > }
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 179699
: 62217