diff options
author | sleak <sleak@sleak-PC> | 2011-12-16 09:27:54 -0800 |
---|---|---|
committer | Nathan Adams <dinnerbone@dinnerbone.com> | 2011-12-19 16:13:07 +0000 |
commit | 189768185ca34cafa313d927e19039e2ea1d84b1 (patch) | |
tree | 2294743476d2f041cd6c4212dd8509dca2f09494 | |
parent | 28372908d7bc6716e19472a25024071a0705a129 (diff) | |
download | bukkit-189768185ca34cafa313d927e19039e2ea1d84b1.tar bukkit-189768185ca34cafa313d927e19039e2ea1d84b1.tar.gz bukkit-189768185ca34cafa313d927e19039e2ea1d84b1.tar.lz bukkit-189768185ca34cafa313d927e19039e2ea1d84b1.tar.xz bukkit-189768185ca34cafa313d927e19039e2ea1d84b1.zip |
Fix for BUKKIT-313 - this makes getString return a string representation of whatever object is present at the path, rather than only returning if the object is a string
-rw-r--r-- | src/main/java/org/bukkit/configuration/MemorySection.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/configuration/MemorySection.java b/src/main/java/org/bukkit/configuration/MemorySection.java index 99c3e819..3cae2295 100644 --- a/src/main/java/org/bukkit/configuration/MemorySection.java +++ b/src/main/java/org/bukkit/configuration/MemorySection.java @@ -289,7 +289,7 @@ public class MemorySection implements ConfigurationSection { } Object def = getDefault(path); - return getString(path, (def instanceof String) ? (String)def : null); + return getString(path, def != null ? def.toString() : null); } public String getString(String path, String def) { @@ -298,7 +298,7 @@ public class MemorySection implements ConfigurationSection { } Object val = get(path, def); - return (val instanceof String) ? (String)val : def; + return (val != null) ? val.toString() : def; } public boolean isString(String path) { |