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 185424 Details for
Bug 202384
can not reload text file encoding prefs
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]
Patch v.0.4
patch202384_201012171500.txt (text/plain), 6.37 KB, created by
Szymon Ptaszkiewicz
on 2010-12-17 09:27:30 EST
(
hide
)
Description:
Patch v.0.4
Filename:
MIME Type:
Creator:
Szymon Ptaszkiewicz
Created:
2010-12-17 09:27:30 EST
Size:
6.37 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.core.resources >Index: src/org/eclipse/core/internal/resources/Project.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Project.java,v >retrieving revision 1.177 >diff -u -r1.177 Project.java >--- src/org/eclipse/core/internal/resources/Project.java 29 Nov 2010 12:10:40 -0000 1.177 >+++ src/org/eclipse/core/internal/resources/Project.java 17 Dec 2010 14:22:15 -0000 >@@ -15,8 +15,6 @@ > *******************************************************************************/ > package org.eclipse.core.internal.resources; > >-import java.util.LinkedHashSet; >- > import java.net.URI; > import java.util.*; > import org.eclipse.core.filesystem.*; >@@ -1169,6 +1167,7 @@ > } finally { > monitor.done(); > } >+ ((ProjectPreferences) Platform.getPreferencesService().getRootNode().node(ProjectScope.SCOPE).node(getName())).initialize(); > } > > /* (non-Javadoc) >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.60 >diff -u -r1.60 ProjectPreferences.java >--- src/org/eclipse/core/internal/resources/ProjectPreferences.java 16 Dec 2010 12:24:11 -0000 1.60 >+++ src/org/eclipse/core/internal/resources/ProjectPreferences.java 17 Dec 2010 14:22:15 -0000 >@@ -72,7 +72,6 @@ > */ > protected static Set loadedNodes = Collections.synchronizedSet(new HashSet()); > private IFile file; >- private boolean initialized = false; > /** > * Flag indicating that this node is currently reading values from disk, > * to avoid flushing during a read. >@@ -348,21 +347,7 @@ > addPreferenceChangeListener(workspace.getCharsetManager().getPreferenceChangeListener()); > } > >- if (segmentCount != 2) >- return; >- >- // else segmentCount == 2 so we initialize the children >- if (initialized) >- return; >- try { >- synchronized (this) { >- String[] names = computeChildren(); >- for (int i = 0; i < names.length; i++) >- addChild(names[i], null); >- } >- } finally { >- initialized = true; >- } >+ initialize(); > } > > /* >@@ -471,6 +456,19 @@ > return new ProjectPreferences(nodeParent, nodeName); > } > >+ protected void initialize() { >+ if (segmentCount == 2) { >+ // segmentCount == 2 so we initialize the children >+ synchronized (this) { >+ // this node might have been already initialized so before initializing it again remove all child nodes from loaded nodes >+ removeLoadedNodes(this); >+ String[] names = computeChildren(); >+ for (int i = 0; i < names.length; i++) >+ addChild(names[i], null); >+ } >+ } >+ } >+ > protected boolean isAlreadyLoaded(IEclipsePreferences node) { > return loadedNodes.contains(node.absolutePath()); > } >#P org.eclipse.ui.ide >Index: src/org/eclipse/ui/internal/ide/LineDelimiterEditor.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/LineDelimiterEditor.java,v >retrieving revision 1.8 >diff -u -r1.8 LineDelimiterEditor.java >--- src/org/eclipse/ui/internal/ide/LineDelimiterEditor.java 11 Apr 2007 15:09:35 -0000 1.8 >+++ src/org/eclipse/ui/internal/ide/LineDelimiterEditor.java 17 Dec 2010 14:22:16 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2007 IBM Corporation and others. >+ * Copyright (c) 2005, 2010 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 >@@ -17,8 +17,6 @@ > import org.eclipse.core.resources.IProject; > import org.eclipse.core.resources.ProjectScope; > import org.eclipse.core.runtime.Platform; >-import org.eclipse.core.runtime.preferences.IEclipsePreferences; >-import org.eclipse.core.runtime.preferences.IScopeContext; > import org.eclipse.core.runtime.preferences.InstanceScope; > import org.eclipse.swt.SWT; > import org.eclipse.swt.events.SelectionAdapter; >@@ -32,6 +30,7 @@ > import org.eclipse.swt.widgets.Control; > import org.eclipse.swt.widgets.Group; > import org.osgi.service.prefs.BackingStoreException; >+import org.osgi.service.prefs.Preferences; > > /** > * A class to handle editing of the Line delimiter preferences in core. >@@ -162,24 +161,31 @@ > * @return the currently stored encoding > */ > public String getStoredValue() { >- IScopeContext[] scopeContext = new IScopeContext[] { getScopeContext() }; >- IEclipsePreferences node = scopeContext[0].getNode(Platform.PI_RUNTIME); >- return node.get(Platform.PREF_LINE_SEPARATOR, null); >+ Preferences node = getPreferences(); >+ try { >+ // be careful looking up for our node so not to create any nodes as side effect >+ if (node.nodeExists(Platform.PI_RUNTIME)) >+ return node.node(Platform.PI_RUNTIME).get( >+ Platform.PREF_LINE_SEPARATOR, null); >+ } catch (BackingStoreException e) { >+ // ignore >+ } >+ return null; > } > > /** >- * Answer the <code>IScopeContext</code> for the receiver, this will be a >- * project scope if the receiver is editing project preferences, otherwise >- * instance scope. >+ * Answer the <code>Preferences</code> for the receiver, this will be a >+ * project preferences if the receiver is editing project preferences, otherwise >+ * instance preferences. > * >- * @return the scope context >+ * @return the preferences > */ >- private IScopeContext getScopeContext() { >+ private Preferences getPreferences() { > if (project != null) { >- return new ProjectScope(project); >+ return Platform.getPreferencesService().getRootNode().node(ProjectScope.SCOPE).node(project.getName()); > } > >- return new InstanceScope(); >+ return Platform.getPreferencesService().getRootNode().node(InstanceScope.SCOPE); > } > > /** >@@ -264,8 +270,7 @@ > val = (String) lineSeparators.get(choiceCombo.getText()); > } > >- IEclipsePreferences node = getScopeContext().getNode( >- Platform.PI_RUNTIME); >+ Preferences node = getPreferences().node(Platform.PI_RUNTIME); > if (val == null) { > node.remove(Platform.PREF_LINE_SEPARATOR); > } else {
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 202384
:
185125
|
185134
|
185139
|
185424
|
185543
|
185703
|
185720
|
186377