### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: model/org/eclipse/jdt/internal/core/util/Util.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Util.java,v retrieving revision 1.130 diff -u -r1.130 Util.java --- model/org/eclipse/jdt/internal/core/util/Util.java 8 Apr 2009 22:52:54 -0000 1.130 +++ model/org/eclipse/jdt/internal/core/util/Util.java 20 Apr 2009 19:04:12 -0000 @@ -926,7 +926,7 @@ /** * Returns the line separator found in the given text. - * If it is null, or not found return the line delimitor for the given project. + * If it is null, or not found return the line delimiter for the given project. * If the project is null, returns the line separator for the workspace. * If still null, return the system line separator. */ @@ -940,21 +940,23 @@ return lineSeparator; } - // line delimiter in project preference - IScopeContext[] scopeContext; - if (project != null) { - scopeContext= new IScopeContext[] { new ProjectScope(project.getProject()) }; - lineSeparator= Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, null, scopeContext); + if (Platform.isRunning()) { + // line delimiter in project preference + IScopeContext[] scopeContext; + if (project != null) { + scopeContext= new IScopeContext[] { new ProjectScope(project.getProject()) }; + lineSeparator= Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, null, scopeContext); + if (lineSeparator != null) + return lineSeparator; + } + + // line delimiter in workspace preference + scopeContext= new IScopeContext[] { new InstanceScope() }; + lineSeparator = Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, null, scopeContext); if (lineSeparator != null) return lineSeparator; } - // line delimiter in workspace preference - scopeContext= new IScopeContext[] { new InstanceScope() }; - lineSeparator = Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, null, scopeContext); - if (lineSeparator != null) - return lineSeparator; - // system line delimiter return org.eclipse.jdt.internal.compiler.util.Util.LINE_SEPARATOR; }