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 114697 Details for
Bug 249930
Deadlock with JavaModelManager$PerProjectInfo
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed workaround
249930.txt (text/plain), 4.82 KB, created by
Jerome Lanneluc
on 2008-10-09 12:32:09 EDT
(
hide
)
Description:
Proposed workaround
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2008-10-09 12:32:09 EDT
Size:
4.82 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/SetClasspathOperation.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SetClasspathOperation.java,v >retrieving revision 1.155 >diff -u -r1.155 SetClasspathOperation.java >--- model/org/eclipse/jdt/internal/core/SetClasspathOperation.java 27 Jun 2008 16:03:51 -0000 1.155 >+++ model/org/eclipse/jdt/internal/core/SetClasspathOperation.java 9 Oct 2008 16:31:04 -0000 >@@ -10,7 +10,11 @@ > *******************************************************************************/ > package org.eclipse.jdt.internal.core; > >+import org.eclipse.core.resources.IResourceRuleFactory; >+import org.eclipse.core.resources.ResourcesPlugin; > import org.eclipse.core.runtime.IPath; >+import org.eclipse.core.runtime.jobs.ISchedulingRule; >+import org.eclipse.core.runtime.jobs.MultiRule; > import org.eclipse.jdt.core.IClasspathEntry; > import org.eclipse.jdt.core.IJavaElement; > import org.eclipse.jdt.core.IJavaModelStatus; >@@ -64,6 +68,20 @@ > done(); > } > } >+ >+ protected ISchedulingRule getSchedulingRule() { >+ if (this.canChangeResources) { >+ IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory(); >+ return new MultiRule(new ISchedulingRule[] { >+ // use project modification rule as this is needed to create the .classpath file if it doesn't exist yet, or to update project references >+ ruleFactory.modifyRule(this.project.getProject()), >+ >+ // and external project modification rule in case the external folders are modified >+ ruleFactory.modifyRule(JavaModelManager.getExternalManager().getExternalFoldersProject()) >+ }); >+ } >+ return super.getSchedulingRule(); >+ } > > public String toString(){ > StringBuffer buffer = new StringBuffer(20); >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.414 >diff -u -r1.414 JavaModelManager.java >--- model/org/eclipse/jdt/internal/core/JavaModelManager.java 9 Oct 2008 08:13:08 -0000 1.414 >+++ model/org/eclipse/jdt/internal/core/JavaModelManager.java 9 Oct 2008 16:31:04 -0000 >@@ -1221,41 +1221,19 @@ > return buffer.toString(); > } > >- public boolean writeAndCacheClasspath(final JavaProject javaProject, final IClasspathEntry[] newRawClasspath, final IPath newOutputLocation) throws JavaModelException { >- final boolean[] result = new boolean[1]; >+ public boolean writeAndCacheClasspath(JavaProject javaProject, final IClasspathEntry[] newRawClasspath, final IPath newOutputLocation) throws JavaModelException { > try { >- // use a workspace runnable so that the notification of .classpath file change is done outside the synchronized block (to avoid deadlocks) >- IWorkspace workspace = ResourcesPlugin.getWorkspace(); >- workspace.run(new IWorkspaceRunnable() { >- public void run(IProgressMonitor monitor) throws CoreException { >- // ensure that the writing of the .classpath file and the caching in memory are synchronized (see also readAnCacheClasspath which is synchronized) >- try { >- PerProjectInfo.this.writtingRawClasspath = true; >- synchronized (PerProjectInfo.this) { >- if (!javaProject.writeFileEntries(newRawClasspath, newOutputLocation)) { >- result[0] = false; >- return; >- } >- // store new raw classpath, new output and new status, and null out resolved info >- setRawClasspath(newRawClasspath, newOutputLocation, JavaModelStatus.VERIFIED_OK); >- result[0] = true; >- } >- } finally { >- PerProjectInfo.this.writtingRawClasspath = false; >- } >- } >- }, >- workspace.getRuleFactory().modifyRule(this.project), // use project modification rule as this is needed to create the .classpath file if it doesn't exist yet >- IWorkspace.AVOID_UPDATE, >- null); >- } catch (JavaModelException e) { >- // rethrow exception (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=245576 ) >- throw e; >- } catch (CoreException e) { >- // rethrow exception (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=245576 ) >- throw new JavaModelException(e); >+ this.writtingRawClasspath = true; >+ // write .classpath >+ if (!javaProject.writeFileEntries(newRawClasspath, newOutputLocation)) { >+ return false; >+ } >+ // store new raw classpath, new output and new status, and null out resolved info >+ setRawClasspath(newRawClasspath, newOutputLocation, JavaModelStatus.VERIFIED_OK); >+ } finally { >+ this.writtingRawClasspath = false; > } >- return result[0]; >+ return true; > } > } >
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 249930
:
114401
| 114697 |
124948
|
128715