Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Ferguson2008-03-18 15:26:50 +0000
committerAndrew Ferguson2008-03-18 15:26:50 +0000
commitb75b0925fead6030428b896f0b958e39ae8b8152 (patch)
tree6930867a04861783e0a74042127525474391dec0 /core/org.eclipse.cdt.core/templateengine/org
parent3333dfaa52904d5358d9677828330f48f6878442 (diff)
downloadorg.eclipse.cdt-b75b0925fead6030428b896f0b958e39ae8b8152.tar.gz
org.eclipse.cdt-b75b0925fead6030428b896f0b958e39ae8b8152.tar.xz
org.eclipse.cdt-b75b0925fead6030428b896f0b958e39ae8b8152.zip
222954: apply fix
Diffstat (limited to 'core/org.eclipse.cdt.core/templateengine/org')
-rw-r--r--core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateEngineHelper.java11
1 files changed, 3 insertions, 8 deletions
diff --git a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateEngineHelper.java b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateEngineHelper.java
index f82fcb250d9..3a97d3d97ef 100644
--- a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateEngineHelper.java
+++ b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateEngineHelper.java
@@ -242,8 +242,8 @@ public class TemplateEngineHelper {
}
public static String externalizeTemplateString(String pluginId, String location, String key) {
- String value = key;
- if (key.startsWith(STRING_EXTERNALIZATION_MARKER)) {
+ String value= null;
+ if (key != null && key.startsWith(STRING_EXTERNALIZATION_MARKER)) {
try {
value = location != null ? getValueFromProperties(pluginId, location, key.substring(1)) : null;
if (value == null) {
@@ -253,18 +253,13 @@ public class TemplateEngineHelper {
value = key;
e.printStackTrace();
}
-
- if (value == null) {
- value = key;
- }
}
- return value;
+ return value == null ? key : value;
}
private static String getValueFromProperties(String pluginId, String propertiesFile, String key) throws IOException {
String value = null;
Bundle b = Platform.getBundle(pluginId);
-// URL url= b.getResource(propertiesFile);
URL url= getResourceURL(b, propertiesFile);
if (url != null) {
InputStream in= url.openStream();

Back to the top