From 732b59ed1ea4f93ea0b54beb0363f78b817aae43 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Fri, 16 Dec 2011 09:27:54 -0800 Subject: [PATCH] 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 By: sleak --- .../src/main/java/org/bukkit/configuration/MemorySection.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/configuration/MemorySection.java b/paper-api/src/main/java/org/bukkit/configuration/MemorySection.java index 99c3e819c6..3cae2295e9 100644 --- a/paper-api/src/main/java/org/bukkit/configuration/MemorySection.java +++ b/paper-api/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) {