diff options
Diffstat (limited to 'netx/net/sourceforge/jnlp/config')
-rw-r--r-- | netx/net/sourceforge/jnlp/config/Defaults.java | 4 | ||||
-rw-r--r-- | netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java | 16 |
2 files changed, 13 insertions, 7 deletions
diff --git a/netx/net/sourceforge/jnlp/config/Defaults.java b/netx/net/sourceforge/jnlp/config/Defaults.java index 78e203d..8ab8347 100644 --- a/netx/net/sourceforge/jnlp/config/Defaults.java +++ b/netx/net/sourceforge/jnlp/config/Defaults.java @@ -37,6 +37,8 @@ exception statement from your version. package net.sourceforge.jnlp.config; +import static net.sourceforge.jnlp.runtime.Translator.R; + import java.io.File; import java.util.HashMap; import java.util.Map; @@ -385,7 +387,7 @@ public class Defaults { ValueValidator checker = (ValueValidator) defaults[i][1]; String actualValue = (String) defaults[i][2]; boolean locked = false; - Setting<String> value = new Setting<String>(name, name, locked, checker, actualValue, actualValue, "<internal>"); + Setting<String> value = new Setting<String>(name, R("Unknown"), locked, checker, actualValue, actualValue, R("DCSourceInternal")); result.put(name, value); } diff --git a/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java b/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java index dd329aa..a07df1f 100644 --- a/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java +++ b/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java @@ -267,7 +267,11 @@ public final class DeploymentConfiguration { } } - return currentConfiguration.get(key).getValue(); + String value = null; + if (currentConfiguration.get(key) != null) { + value = currentConfiguration.get(key).getValue(); + } + return value; } /** @@ -319,7 +323,7 @@ public final class DeploymentConfiguration { currentValue.setValue(value); } } else { - currentValue = new Setting<String>(key, key, false, null, null, value, "<unknown>"); + currentValue = new Setting<String>(key, R("Unknown"), false, null, null, value, R("Unknown")); currentConfiguration.put(key, currentValue); } } @@ -341,7 +345,7 @@ public final class DeploymentConfiguration { if (!(s.getName().equals(key))) { System.out.println(R("DCInternal", "key " + key + " does not match setting name " + s.getName())); } else if (!defaults.containsKey(key)) { - System.out.println(R("DCUnknownSettingWithVal", key)); + System.out.println(R("DCUnknownSettingWithName", key)); } else { ValueValidator checker = defaults.get(key).getValidator(); if (checker == null) { @@ -351,7 +355,7 @@ public final class DeploymentConfiguration { try { checker.validate(s.getValue()); } catch (IllegalArgumentException e) { - System.out.println(R("DCErrorInSetting", key, s.getValue(), s.getDefaultValue(), checker.getPossibleValues())); + System.out.println(R("DCIncorrectValue", key, s.getValue(), checker.getPossibleValues())); s.setValue(s.getDefaultValue()); } } @@ -546,7 +550,7 @@ public final class DeploymentConfiguration { String realKey = key.substring(0, key.length() - ".locked".length()); Setting<String> configValue = result.get(realKey); if (configValue == null) { - configValue = new Setting<String>(realKey, realKey, true, null, null, null, propertiesFile.toString()); + configValue = new Setting<String>(realKey, R("Unknown"), true, null, null, null, propertiesFile.toString()); result.put(realKey, configValue); } else { configValue.setLocked(true); @@ -556,7 +560,7 @@ public final class DeploymentConfiguration { String newValue = properties.getProperty(key); Setting<String> configValue = result.get(key); if (configValue == null) { - configValue = new Setting<String>(key, key, false, null, null, newValue, propertiesFile.toString()); + configValue = new Setting<String>(key, R("Unknown"), false, null, null, newValue, propertiesFile.toString()); result.put(key, configValue); } else { configValue.setValue(newValue); |