Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2008-05-19 10:30:37 -0400
committerThomas Watson2008-05-19 10:30:37 -0400
commit4c8c9284324eafa851d06576f7431f0bd09ca905 (patch)
treec228ad72c876d9cbedf60898efaec39a0e4c9ef3 /bundles
parent2a5443f8854ca5b1f8fa447bf0e4be0024f39bed (diff)
downloadrt.equinox.framework-4c8c9284324eafa851d06576f7431f0bd09ca905.tar.gz
rt.equinox.framework-4c8c9284324eafa851d06576f7431f0bd09ca905.tar.xz
rt.equinox.framework-4c8c9284324eafa851d06576f7431f0bd09ca905.zip
Bug 232636 Locale.setDefault(Locale.ROOT) crashes the framework startup
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/ManifestLocalization.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/ManifestLocalization.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/ManifestLocalization.java
index 619f0266b..4c0f8b5ee 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/ManifestLocalization.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/ManifestLocalization.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 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
@@ -78,15 +78,11 @@ public class ManifestLocalization {
private String[] buildNLVariants(String nl) {
ArrayList result = new ArrayList();
- int lastSeparator;
- while ((lastSeparator = nl.lastIndexOf('_')) != -1) {
+ while (nl.length() > 0) {
result.add(nl);
- if (lastSeparator != -1) {
- nl = nl.substring(0, lastSeparator);
- }
+ int i = nl.lastIndexOf('_');
+ nl = (i < 0) ? "" : nl.substring(0, i); //$NON-NLS-1$
}
- result.add(nl);
- // always add the default locale string
result.add(""); //$NON-NLS-1$
return (String[]) result.toArray(new String[result.size()]);
}

Back to the top