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 82171 Details for
Bug 137398
[Preferences] WorkingCopyPreferences attempts to set value of removed node
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]
suggested fix
137398.patch (text/plain), 5.40 KB, created by
Martin Aeschlimann
on 2007-11-06 04:22:04 EST
(
hide
)
Description:
suggested fix
Filename:
MIME Type:
Creator:
Martin Aeschlimann
Created:
2007-11-06 04:22:04 EST
Size:
5.40 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.core.resources >Index: src/org/eclipse/core/internal/utils/Messages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.resources/src/org/eclipse/core/internal/utils/Messages.java,v >retrieving revision 1.33 >diff -u -r1.33 Messages.java >--- src/org/eclipse/core/internal/utils/Messages.java 29 Jun 2006 18:32:57 -0000 1.33 >+++ src/org/eclipse/core/internal/utils/Messages.java 6 Nov 2007 09:12:02 -0000 >@@ -105,7 +105,7 @@ > public static String preferences_deleteException; > public static String preferences_loadException; > public static String preferences_operationCanceled; >- public static String preferences_removeNodeException; >+ public static String preferences_clearNodeException; > public static String preferences_saveProblems; > public static String preferences_syncException; > >Index: src/org/eclipse/core/internal/utils/messages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.resources/src/org/eclipse/core/internal/utils/messages.properties,v >retrieving revision 1.126 >diff -u -r1.126 messages.properties >--- src/org/eclipse/core/internal/utils/messages.properties 21 Aug 2006 14:05:22 -0000 1.126 >+++ src/org/eclipse/core/internal/utils/messages.properties 6 Nov 2007 09:12:02 -0000 >@@ -101,7 +101,7 @@ > preferences_deleteException=Exception deleting file: {0}. > preferences_loadException=Exception loading preferences from: {0}. > preferences_operationCanceled=Operation canceled. >-preferences_removeNodeException=Exception while removing preference node: {0}. >+preferences_clearNodeException=Exception while clearing preference node: {0}. > preferences_saveProblems=Exception occurred while saving project preferences: {0}. > preferences_syncException=Exception occurred while synchronizing node: {0}. > >Index: src/org/eclipse/core/internal/resources/ProjectPreferences.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/ProjectPreferences.java,v >retrieving revision 1.53 >diff -u -r1.53 ProjectPreferences.java >--- src/org/eclipse/core/internal/resources/ProjectPreferences.java 27 Mar 2007 22:27:37 -0000 1.53 >+++ src/org/eclipse/core/internal/resources/ProjectPreferences.java 6 Nov 2007 09:12:02 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2004, 2006 IBM Corporation and others. >+ * Copyright (c) 2004, 2007 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 >@@ -107,14 +107,8 @@ > // ignore > } > >- // if the node was loaded we need to clear the values and remove >- // its reference from the parent (don't save it though) >- // otherwise just remove the reference from the parent >- String childPath = projectNode.absolutePath() + IPath.SEPARATOR + qualifier; >- if (projectNode.isAlreadyLoaded(childPath)) >- removeNode(projectNode.node(qualifier)); >- else >- projectNode.removeNode(qualifier); >+ // clear the preferences >+ nodeDeleted(projectNode.node(qualifier)); > > // notifies the CharsetManager if needed > if (qualifier.equals(ResourcesPlugin.PI_RESOURCES)) >@@ -136,8 +130,8 @@ > Preferences projectNode = root.node(ProjectScope.SCOPE).node(project); > // check if we need to notify the charset manager > boolean hasResourcesSettings = getFile(folder, ResourcesPlugin.PI_RESOURCES).exists(); >- // remove the preferences >- removeNode(projectNode); >+ // clear the preferences >+ nodeDeleted(projectNode); > // notifies the CharsetManager > if (hasResourcesSettings) > preferencesChanged(folder.getProject()); >@@ -155,8 +149,8 @@ > Preferences projectNode = root.node(ProjectScope.SCOPE).node(project.getName()); > // check if we need to notify the charset manager > boolean hasResourcesSettings = getFile(project, ResourcesPlugin.PI_RESOURCES).exists(); >- // remove the preferences >- removeNode(projectNode); >+ // clear the preferences >+ nodeDeleted(projectNode); > // notifies the CharsetManager > if (hasResourcesSettings) > preferencesChanged(project); >@@ -241,12 +235,23 @@ > node.isReading = oldIsReading; > } > } >+ >+ private static void clearAll(Preferences node) throws BackingStoreException { >+ node.clear(); >+ String[] names = node.childrenNames(); >+ for (int i = 0; i < names.length; i++) { >+ clearAll(node.node(names[i])); >+ } >+ } > >- static void removeNode(Preferences node) throws CoreException { >- String message = NLS.bind(Messages.preferences_removeNodeException, node.absolutePath()); >+ static void nodeDeleted(Preferences node) throws CoreException { >+ // if the underlying properties file was deleted, clear the values and remove >+ // it from the list of loaded classes >+ // keep the node as it might still be referenced > try { >- node.removeNode(); >+ clearAll(node); > } catch (BackingStoreException e) { >+ String message = NLS.bind(Messages.preferences_clearNodeException, node.absolutePath()); > IStatus status = new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES, IStatus.ERROR, message, e); > throw new CoreException(status); > }
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 137398
: 82171 |
88401
|
97949
|
97991