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 126052 Details for
Bug 262964
Unable to remove/disable repository
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]
Modifies AbstractRepositoryManager to use ProfilePreferences rather tahn Configuration
AbstractRepositoryManager.patch (text/plain), 3.86 KB, created by
Matthew Piggott
on 2009-02-18 13:04:06 EST
(
hide
)
Description:
Modifies AbstractRepositoryManager to use ProfilePreferences rather tahn Configuration
Filename:
MIME Type:
Creator:
Matthew Piggott
Created:
2009-02-18 13:04:06 EST
Size:
3.86 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.equinox.p2.core >Index: src/org/eclipse/equinox/internal/p2/core/helpers/AbstractRepositoryManager.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/AbstractRepositoryManager.java,v >retrieving revision 1.18 >diff -u -r1.18 AbstractRepositoryManager.java >--- src/org/eclipse/equinox/internal/p2/core/helpers/AbstractRepositoryManager.java 17 Feb 2009 20:03:41 -0000 1.18 >+++ src/org/eclipse/equinox/internal/p2/core/helpers/AbstractRepositoryManager.java 18 Feb 2009 18:03:25 -0000 >@@ -14,7 +14,7 @@ > import java.net.*; > import java.util.*; > import org.eclipse.core.runtime.*; >-import org.eclipse.core.runtime.preferences.ConfigurationScope; >+import org.eclipse.core.runtime.preferences.IPreferencesService; > import org.eclipse.equinox.internal.p2.core.Activator; > import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; > import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus; >@@ -453,7 +453,13 @@ > * Return the preference node which is the root for where we store the repository information. > */ > private Preferences getPreferences() { >- return new ConfigurationScope().getNode(getBundleId()).node(NODE_REPOSITORIES); >+ IPreferencesService prefService = (IPreferencesService) ServiceHelper.getService(Activator.getContext(), IPreferencesService.class.getName()); >+ >+ try { >+ return prefService.getRootNode().node("/profile/_SELF_/" + getBundleId() + "/" + NODE_REPOSITORIES); //$NON-NLS-1$ //$NON-NLS-2$ >+ } catch (IllegalArgumentException e) { >+ return null; >+ } > } > > /** >@@ -689,7 +695,13 @@ > */ > private void remember(IRepository repository, String suffix) { > boolean changed = false; >- Preferences node = getPreferences().node(getKey(repository.getLocation())); >+ >+ Preferences node = getPreferences(); >+ // Ensure we retrieved preferences >+ if (node == null) >+ return; >+ node = node.node(getKey(repository.getLocation())); >+ > changed |= putValue(node, KEY_URI, repository.getLocation().toString()); > changed |= putValue(node, KEY_URL, null); > changed |= putValue(node, KEY_DESCRIPTION, repository.getDescription()); >@@ -712,7 +724,11 @@ > */ > private boolean remember(RepositoryInfo info, boolean flush) { > boolean changed = false; >- Preferences node = getPreferences().node(getKey(info.location)); >+ Preferences node = getPreferences(); >+ // Ensure we retrieved preferences >+ if (node == null) >+ return changed; >+ node = node.node(getKey(info.location)); > changed |= putValue(node, KEY_URI, info.location.toString()); > changed |= putValue(node, KEY_URL, null); > changed |= putValue(node, KEY_SYSTEM, Boolean.toString(info.isSystem)); >@@ -763,8 +779,11 @@ > Tracing.debug(msg); > new Exception(msg).printStackTrace(); > } >- getPreferences().node(repoKey).removeNode(); >- saveToPreferences(); >+ Preferences node = getPreferences(); >+ if (node != null) { >+ getPreferences().node(repoKey).removeNode(); >+ saveToPreferences(); >+ } > clearNotFound(toRemove); > } catch (BackingStoreException e) { > log("Error saving preferences", e); //$NON-NLS-1$ >@@ -781,6 +800,8 @@ > private void restoreFromPreferences() { > // restore the list of repositories from the preference store > Preferences node = getPreferences(); >+ if (node == null) >+ return; > String[] children; > try { > children = node.childrenNames(); >@@ -845,7 +866,9 @@ > */ > private void saveToPreferences() { > try { >- getPreferences().flush(); >+ Preferences node = getPreferences(); >+ if (node != null) >+ node.flush(); > } catch (BackingStoreException e) { > log("Error while saving repositories in preferences", e); //$NON-NLS-1$ > }
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 262964
:
126052
|
126054
|
126195
|
126196
|
126198
|
126565