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 31814 Details for
Bug 118507
Autobuild churn during classpath init
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Possible fix
118507.txt (text/plain), 3.76 KB, created by
Jerome Lanneluc
on 2005-12-15 10:06:37 EST
(
hide
)
Description:
Possible fix
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2005-12-15 10:06:37 EST
Size:
3.76 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.311 >diff -u -r1.311 JavaModelManager.java >--- model/org/eclipse/jdt/internal/core/JavaModelManager.java 8 Dec 2005 14:48:52 -0000 1.311 >+++ model/org/eclipse/jdt/internal/core/JavaModelManager.java 15 Dec 2005 15:07:18 -0000 >@@ -1721,7 +1721,7 @@ > } > > // collect all container paths >- HashMap allContainerPaths = new HashMap(); >+ final HashMap allContainerPaths = new HashMap(); > IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); > for (int i = 0, length = projects.length; i < length; i++) { > IProject project = projects[i]; >@@ -1768,23 +1768,42 @@ > // initialize all containers > boolean ok = false; > try { >- Set keys = allContainerPaths.keySet(); >- int length = keys.size(); >- IJavaProject[] javaProjects = new IJavaProject[length]; // clone as the following will have a side effect >- keys.toArray(javaProjects); >- for (int i = 0; i < length; i++) { >- IJavaProject javaProject = javaProjects[i]; >- HashSet pathSet = (HashSet) allContainerPaths.get(javaProject); >- if (pathSet == null) continue; >- int length2 = pathSet.size(); >- IPath[] paths = new IPath[length2]; >- pathSet.toArray(paths); // clone as the following will have a side effect >- for (int j = 0; j < length2; j++) { >- IPath path = paths[j]; >- initializeContainer(javaProject, path); >- } >- } >+ // if possible run iniside an IWokspaceRunnable with AVOID_UPATE to avoid unwanted builds >+ // (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=118507) >+ IWorkspaceRunnable runnable = >+ new IWorkspaceRunnable() { >+ public void run(IProgressMonitor monitor) throws CoreException { >+ Set keys = allContainerPaths.keySet(); >+ int length = keys.size(); >+ IJavaProject[] javaProjects = new IJavaProject[length]; // clone as the following will have a side effect >+ keys.toArray(javaProjects); >+ for (int i = 0; i < length; i++) { >+ IJavaProject javaProject = javaProjects[i]; >+ HashSet pathSet = (HashSet) allContainerPaths.get(javaProject); >+ if (pathSet == null) continue; >+ int length2 = pathSet.size(); >+ IPath[] paths = new IPath[length2]; >+ pathSet.toArray(paths); // clone as the following will have a side effect >+ for (int j = 0; j < length2; j++) { >+ IPath path = paths[j]; >+ initializeContainer(javaProject, path); >+ } >+ } >+ } >+ }; >+ IWorkspace workspace = ResourcesPlugin.getWorkspace(); >+ if (workspace.isTreeLocked()) >+ runnable.run(null/*no progress available*/); >+ else >+ workspace.run( >+ runnable, >+ null/*don't take any lock*/, >+ IWorkspace.AVOID_UPDATE, >+ null/*no progress available here*/); > ok = true; >+ } catch (CoreException e) { >+ // ignore >+ Util.log(e, "Exception while initializing all containers"); //$NON-NLS-1$ > } finally { > if (!ok) { > // if we're being traversed by an exception, ensure that that containers are >@@ -1797,7 +1816,7 @@ > return containerGet(javaProjectToInit, containerToInit); > } > >- private IClasspathContainer initializeContainer(IJavaProject project, IPath containerPath) throws JavaModelException { >+ IClasspathContainer initializeContainer(IJavaProject project, IPath containerPath) throws JavaModelException { > > IClasspathContainer container = null; > final ClasspathContainerInitializer initializer = JavaCore.getClasspathContainerInitializer(containerPath.segment(0));
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 118507
:
30807
| 31814