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 62394 Details for
Bug 179529
Stop Eclipse takes a lot of time in case of big workspace
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix and regression test
179529.txt (text/plain), 4.24 KB, created by
Jerome Lanneluc
on 2007-03-29 10:52:57 EDT
(
hide
)
Description:
Proposed fix and regression test
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2007-03-29 10:52:57 EDT
Size:
4.24 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.365 >diff -u -r1.365 JavaModelManager.java >--- model/org/eclipse/jdt/internal/core/JavaModelManager.java 27 Mar 2007 10:43:28 -0000 1.365 >+++ model/org/eclipse/jdt/internal/core/JavaModelManager.java 29 Mar 2007 14:52:57 -0000 >@@ -2144,6 +2144,10 @@ > > IClasspathContainer initializeContainer(IJavaProject project, IPath containerPath) throws JavaModelException { > >+ IProgressMonitor monitor = (IProgressMonitor) this.batchContainerInitializationsProgress.get(); >+ if (monitor != null && monitor.isCanceled()) >+ throw new OperationCanceledException(); >+ > IClasspathContainer container = null; > final ClasspathContainerInitializer initializer = JavaCore.getClasspathContainerInitializer(containerPath.segment(0)); > if (initializer != null){ >@@ -2159,7 +2163,6 @@ > containerPut(project, containerPath, CONTAINER_INITIALIZATION_IN_PROGRESS); // avoid initialization cycles > boolean ok = false; > try { >- IProgressMonitor monitor = (IProgressMonitor) this.batchContainerInitializationsProgress.get(); > if (monitor != null) > monitor.subTask(Messages.bind(Messages.javamodel_configuring, initializer.getDescription(containerPath, project))); > >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/JavaModelTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaModelTests.java,v >retrieving revision 1.21 >diff -u -r1.21 JavaModelTests.java >--- src/org/eclipse/jdt/core/tests/model/JavaModelTests.java 29 Mar 2006 04:03:08 -0000 1.21 >+++ src/org/eclipse/jdt/core/tests/model/JavaModelTests.java 29 Mar 2007 14:53:00 -0000 >@@ -12,8 +12,12 @@ > > import org.eclipse.core.resources.*; > import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.IPath; >+import org.eclipse.core.runtime.NullProgressMonitor; >+import org.eclipse.core.runtime.OperationCanceledException; > import org.eclipse.core.runtime.jobs.ISchedulingRule; > import org.eclipse.jdt.core.*; >+import org.eclipse.jdt.core.tests.model.ClasspathInitializerTests.DefaultContainerInitializer; > > import junit.framework.Test; > /** >@@ -518,6 +522,54 @@ > JavaCore.initializeAfterLoad(null); > } > >+/* >+ * Ensures that JavaCore#initializeAfterLoad() can be canceled >+ * (regression test for bug 179529 Stop Eclipse takes a lot of time in case of big workspace) >+ */ >+public void testInitializeAfterLoad2() throws CoreException { >+ try { >+ createJavaProject( >+ "P1", >+ new String[] {}, >+ new String[] {"org.eclipse.jdt.core.tests.model.TEST_CONTAINER"}, >+ ""); >+ createFile("/P1/lib.jar", ""); >+ createJavaProject( >+ "P2", >+ new String[] {}, >+ new String[] {"org.eclipse.jdt.core.tests.model.TEST_CONTAINER"}, >+ ""); >+ createFile("/P2/lib.jar", ""); >+ >+ simulateExitRestart(); >+ final NullProgressMonitor progressMonitor = new NullProgressMonitor(); >+ class CancellingInitializer extends DefaultContainerInitializer { >+ int count = 1; >+ public CancellingInitializer(String[] values) { >+ super(values); >+ } >+ public void initialize(IPath containerPath, IJavaProject project) throws CoreException { >+ super.initialize(containerPath, project); >+ if (--count == 0) >+ progressMonitor.setCanceled(true); >+ else >+ assertFalse("Should have canceled initializeAfterLoad()", true); >+ >+ } >+ } >+ CancellingInitializer initializer = new CancellingInitializer(new String[] {"P1", "/P1/lib.jar", "P2", "/P2/lib.jar"}); >+ ContainerInitializer.setInitializer(initializer); >+ try { >+ JavaCore.initializeAfterLoad(progressMonitor); >+ } catch (OperationCanceledException e) { >+ // expected >+ } >+ } finally { >+ deleteProject("P1"); >+ deleteProject("P2"); >+ } >+} >+ > /** > * Ensures that a registered pre-processing resource changed listener is correctly called. > * @deprecated since using deprecated API
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 179529
:
62090
|
62091
|
62092
|
62093
| 62394