aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDirk Fauth2014-02-21 08:25:05 (EST)
committerDirk Fauth2014-02-21 08:25:05 (EST)
commite0f108c75adb292bbccb383c9abb6e3c5e6dd629 (patch)
tree5f3ad4e94e4f261eb8b5c8765c2840db47d8eaeb
parentfd207f947353ca7c3e6e80fe7bf7d7bcf38d47f2 (diff)
downloadeclipse.platform.runtime-e0f108c75adb292bbccb383c9abb6e3c5e6dd629.zip
eclipse.platform.runtime-e0f108c75adb292bbccb383c9abb6e3c5e6dd629.tar.gz
eclipse.platform.runtime-e0f108c75adb292bbccb383c9abb6e3c5e6dd629.tar.bz2
Bug 428427 - Make the translation package API and add handling ofrefs/changes/65/22365/1
invalid contributorURIs Change-Id: I56d521939aab2714e1403b320fc9aea6a3475cd3 Signed-off-by: Dirk Fauth <dirk.fauth@googlemail.com>
-rw-r--r--bundles/org.eclipse.e4.core.services/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.e4.core.services/src/org/eclipse/e4/core/internal/services/ResourceBundleHelper.java11
2 files changed, 10 insertions, 3 deletions
diff --git a/bundles/org.eclipse.e4.core.services/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.core.services/META-INF/MANIFEST.MF
index 57b3f21..4b7905e 100644
--- a/bundles/org.eclipse.e4.core.services/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.e4.core.services/META-INF/MANIFEST.MF
@@ -38,7 +38,7 @@ Export-Package: org.eclipse.e4.core.internal.services;x-friends:="org.eclipse.e4
org.eclipse.ui.workbench",
org.eclipse.e4.core.services.nls,
org.eclipse.e4.core.services.statusreporter;x-friends:="org.eclipse.e4.ui.workbench.swt",
- org.eclipse.e4.core.services.translation;x-internal:=true
+ org.eclipse.e4.core.services.translation
Eclipse-ExtensibleAPI: true
Bundle-ClassPath: injection_annotations.jar, .
Bundle-Activator: org.eclipse.e4.core.internal.services.ServicesActivator
diff --git a/bundles/org.eclipse.e4.core.services/src/org/eclipse/e4/core/internal/services/ResourceBundleHelper.java b/bundles/org.eclipse.e4.core.services/src/org/eclipse/e4/core/internal/services/ResourceBundleHelper.java
index 791d76c..8b9f338 100644
--- a/bundles/org.eclipse.e4.core.services/src/org/eclipse/e4/core/internal/services/ResourceBundleHelper.java
+++ b/bundles/org.eclipse.e4.core.services/src/org/eclipse/e4/core/internal/services/ResourceBundleHelper.java
@@ -129,7 +129,14 @@ public class ResourceBundleHelper {
}
bundleName = uri.getAuthority();
// remove the leading /
- classPath = uri.getPath().substring(1);
+ if (uri.getPath() != null && uri.getPath().length() > 0) {
+ classPath = uri.getPath().substring(1);
+ } else {
+ if (logService != null) {
+ logService.log(LogService.LOG_ERROR, "Called with invalid contributor URI: "
+ + contributorURI);
+ }
+ }
}
ResourceBundle result = null;
@@ -151,7 +158,7 @@ public class ResourceBundleHelper {
.log(LogService.LOG_ERROR,
"Failed to load specified ResourceBundle: " + contributorURI, e); //$NON-NLS-1$
}
- } else if (resourcePath.length() > 0) {
+ } else if (resourcePath != null && resourcePath.length() > 0) {
// the specified URI points to a resource
// therefore we try to load the .properties files into a ResourceBundle
result = getEquinoxResourceBundle(resourcePath.replace('.', '/'), locale,