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 154747 Details for
Bug 289560
Eclipse hangs after modifying user libraries
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Latest patch
patch_289560_1.txt (text/plain), 5.90 KB, created by
Jay Arthanareeswaran
on 2009-12-18 02:14:29 EST
(
hide
)
Description:
Latest patch
Filename:
MIME Type:
Creator:
Jay Arthanareeswaran
Created:
2009-12-18 02:14:29 EST
Size:
5.90 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/SetContainerOperation.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SetContainerOperation.java,v >retrieving revision 1.12 >diff -u -r1.12 SetContainerOperation.java >--- model/org/eclipse/jdt/internal/core/SetContainerOperation.java 27 Jun 2008 16:03:51 -0000 1.12 >+++ model/org/eclipse/jdt/internal/core/SetContainerOperation.java 18 Dec 2009 06:54:56 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2008 IBM Corporation and others. >+ * Copyright (c) 2000, 2009 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -10,9 +10,12 @@ > *******************************************************************************/ > package org.eclipse.jdt.internal.core; > >+import org.eclipse.core.resources.IResourceRuleFactory; > import org.eclipse.core.resources.ResourcesPlugin; > import org.eclipse.core.runtime.CoreException; > 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.IClasspathContainer; > import org.eclipse.jdt.core.IClasspathEntry; > import org.eclipse.jdt.core.IJavaElement; >@@ -140,6 +143,23 @@ > } > } > >+ protected ISchedulingRule getSchedulingRule() { >+ if (this.canChangeResources) { >+ int length = this.affectedProjects.length; >+ IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory(); >+ ISchedulingRule[] rules = new ISchedulingRule[length + 1]; >+ >+ for (int index = 0; index < length; index++) { >+ rules[index] = ruleFactory.modifyRule(this.affectedProjects[index].getProject()); >+ } >+ // External folders might get changed inside ChangeClasspathOperation.classpathChanged(ClasspathChange) >+ rules[length] = ruleFactory.modifyRule(JavaModelManager.getExternalManager().getExternalFoldersProject()); >+ >+ return new MultiRule(rules); >+ } >+ return super.getSchedulingRule(); >+ } >+ > private void verbose_failure(CoreException e) { > Util.verbose( > "CPContainer SET - FAILED DUE TO EXCEPTION\n" + //$NON-NLS-1$ >Index: model/org/eclipse/jdt/internal/core/UserLibraryManager.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/UserLibraryManager.java,v >retrieving revision 1.18 >diff -u -r1.18 UserLibraryManager.java >--- model/org/eclipse/jdt/internal/core/UserLibraryManager.java 6 Jul 2009 06:49:40 -0000 1.18 >+++ model/org/eclipse/jdt/internal/core/UserLibraryManager.java 18 Dec 2009 06:54:56 -0000 >@@ -152,37 +152,34 @@ > } > > public void removeUserLibrary(String libName) { >- synchronized (this.userLibraries) { >- IEclipsePreferences instancePreferences = JavaModelManager.getJavaModelManager().getInstancePreferences(); >- String propertyName = CP_USERLIBRARY_PREFERENCES_PREFIX+libName; >- instancePreferences.remove(propertyName); >- try { >- instancePreferences.flush(); >- } catch (BackingStoreException e) { >- Util.log(e, "Exception while removing user library " + libName); //$NON-NLS-1$ >- } >+ IEclipsePreferences instancePreferences = JavaModelManager.getJavaModelManager().getInstancePreferences(); >+ String propertyName = CP_USERLIBRARY_PREFERENCES_PREFIX+libName; >+ instancePreferences.remove(propertyName); >+ try { >+ instancePreferences.flush(); >+ } catch (BackingStoreException e) { >+ Util.log(e, "Exception while removing user library " + libName); //$NON-NLS-1$ > } >- // this.userLibraries was updated during the PreferenceChangeEvent (see preferenceChange(...)) >+ // No need to lock this.userLibraries since SetContainerOperation uses ISchedulingRule now. > } > >- public void setUserLibrary(String libName, IClasspathEntry[] entries, boolean isSystemLibrary) { >- synchronized (this.userLibraries) { >- IEclipsePreferences instancePreferences = JavaModelManager.getJavaModelManager().getInstancePreferences(); >- String propertyName = CP_USERLIBRARY_PREFERENCES_PREFIX+libName; >- try { >- String propertyValue = UserLibrary.serialize(entries, isSystemLibrary); >- instancePreferences.put(propertyName, propertyValue); // sends out a PreferenceChangeEvent (see preferenceChange(...)) >- } catch (IOException e) { >- Util.log(e, "Exception while serializing user library " + libName); //$NON-NLS-1$ >- return; >- } >- try { >- instancePreferences.flush(); >- } catch (BackingStoreException e) { >- Util.log(e, "Exception while saving user library " + libName); //$NON-NLS-1$ >- } >+ public void setUserLibrary(String libName, IClasspathEntry[] entries, boolean isSystemLibrary) { >+ IEclipsePreferences instancePreferences = JavaModelManager.getJavaModelManager().getInstancePreferences(); >+ String propertyName = CP_USERLIBRARY_PREFERENCES_PREFIX + libName; >+ try { >+ String propertyValue = UserLibrary.serialize(entries, isSystemLibrary); >+ instancePreferences.put(propertyName, propertyValue); // sends out a PreferenceChangeEvent (see >+ // preferenceChange(...)) >+ } catch (IOException e) { >+ Util.log(e, "Exception while serializing user library " + libName); //$NON-NLS-1$ >+ return; > } >- // this.userLibraries was updated during the PreferenceChangeEvent (see preferenceChange(...)) >+ try { >+ instancePreferences.flush(); >+ } catch (BackingStoreException e) { >+ Util.log(e, "Exception while saving user library " + libName); //$NON-NLS-1$ >+ } >+ // No need to lock this.userLibraries since SetContainerOperation uses ISchedulingRule now. > } > > }
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 289560
:
152030
|
152051
|
152490
|
152633
| 154747