diff options
| author | Szymon Ptaszkiewicz | 2012-10-17 13:46:52 +0000 |
|---|---|---|
| committer | Szymon Ptaszkiewicz | 2012-10-17 13:46:52 +0000 |
| commit | a90b50438ec9b71a182e49e496979dc95c2adf8f (patch) | |
| tree | 44533d622f4b6d3014db4c472f3ef582e5c5790c | |
| parent | b4719f7c958d562ea2138c6493a6a7e057194507 (diff) | |
| download | eclipse.platform.resources-a90b50438ec9b71a182e49e496979dc95c2adf8f.tar.gz eclipse.platform.resources-a90b50438ec9b71a182e49e496979dc95c2adf8f.tar.xz eclipse.platform.resources-a90b50438ec9b71a182e49e496979dc95c2adf8f.zip | |
Bug 387783 - DefaultScope not used when calculating line delimiterv20121017-134652
| -rw-r--r-- | bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/utils/FileUtil.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/utils/FileUtil.java b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/utils/FileUtil.java index 864d07435..6ef0e93f4 100644 --- a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/utils/FileUtil.java +++ b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/utils/FileUtil.java @@ -20,6 +20,7 @@ import org.eclipse.core.internal.resources.ResourceException; import org.eclipse.core.internal.resources.Workspace; import org.eclipse.core.resources.*; import org.eclipse.core.runtime.*; +import org.eclipse.core.runtime.preferences.DefaultScope; import org.eclipse.core.runtime.preferences.InstanceScope; import org.eclipse.osgi.util.NLS; import org.osgi.service.prefs.BackingStoreException; @@ -181,6 +182,7 @@ public class FileUtil { * <li> Line separator currently used in that file. * <li> Line separator defined in project preferences. * <li> Line separator defined in instance preferences. + * <li> Line separator defined in default preferences. * <li> Operating system default line separator. * </ol> * @param file the file for which line separator should be returned @@ -219,6 +221,10 @@ public class FileUtil { value = getLineSeparatorFromPreferences(rootNode.node(InstanceScope.SCOPE)); if (value != null) return value; + // try with default preferences + value = getLineSeparatorFromPreferences(rootNode.node(DefaultScope.SCOPE)); + if (value != null) + return value; // if there is no preference set, fall back to OS default value return System.getProperty("line.separator"); //$NON-NLS-1$ } |
