summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Adams <dinnerbone@dinnerbone.com>2012-01-15 09:04:08 +0000
committerNathan Adams <dinnerbone@dinnerbone.com>2012-01-15 09:04:08 +0000
commit9e3ce5cd24d8414e58c9a0d701582e0a241c64ef (patch)
tree8679d1dadcfbdc138251270009d0098615ebe17e
parent42f7a6b8e48edd61fb075c8a29a044050e5e80b7 (diff)
downloadbukkit-9e3ce5cd24d8414e58c9a0d701582e0a241c64ef.tar
bukkit-9e3ce5cd24d8414e58c9a0d701582e0a241c64ef.tar.gz
bukkit-9e3ce5cd24d8414e58c9a0d701582e0a241c64ef.tar.lz
bukkit-9e3ce5cd24d8414e58c9a0d701582e0a241c64ef.tar.xz
bukkit-9e3ce5cd24d8414e58c9a0d701582e0a241c64ef.zip
Config .get*List will return an empty list of the appropriate type instead of null when the value does not exist. Thanks to krinsdeath for the PR.
-rw-r--r--src/main/java/org/bukkit/configuration/MemorySection.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/main/java/org/bukkit/configuration/MemorySection.java b/src/main/java/org/bukkit/configuration/MemorySection.java
index ba41232f..8e16eb7e 100644
--- a/src/main/java/org/bukkit/configuration/MemorySection.java
+++ b/src/main/java/org/bukkit/configuration/MemorySection.java
@@ -452,7 +452,7 @@ public class MemorySection implements ConfigurationSection {
List<Object> list = getList(path);
if (list == null) {
- return null;
+ return new ArrayList<String>(0);
}
List<String> result = new ArrayList<String>();
@@ -474,7 +474,7 @@ public class MemorySection implements ConfigurationSection {
List<Object> list = getList(path);
if (list == null) {
- return null;
+ return new ArrayList<Integer>(0);
}
List<Integer> result = new ArrayList<Integer>();
@@ -515,7 +515,7 @@ public class MemorySection implements ConfigurationSection {
List<Object> list = getList(path);
if (list == null) {
- return null;
+ return new ArrayList<Boolean>(0);
}
List<Boolean> result = new ArrayList<Boolean>();
@@ -543,7 +543,7 @@ public class MemorySection implements ConfigurationSection {
List<Object> list = getList(path);
if (list == null) {
- return null;
+ return new ArrayList<Double>(0);
}
List<Double> result = new ArrayList<Double>();
@@ -584,7 +584,7 @@ public class MemorySection implements ConfigurationSection {
List<Object> list = getList(path);
if (list == null) {
- return null;
+ return new ArrayList<Float>(0);
}
List<Float> result = new ArrayList<Float>();
@@ -625,7 +625,7 @@ public class MemorySection implements ConfigurationSection {
List<Object> list = getList(path);
if (list == null) {
- return null;
+ return new ArrayList<Long>(0);
}
List<Long> result = new ArrayList<Long>();
@@ -666,7 +666,7 @@ public class MemorySection implements ConfigurationSection {
List<Object> list = getList(path);
if (list == null) {
- return null;
+ return new ArrayList<Byte>(0);
}
List<Byte> result = new ArrayList<Byte>();
@@ -707,7 +707,7 @@ public class MemorySection implements ConfigurationSection {
List<Object> list = getList(path);
if (list == null) {
- return null;
+ return new ArrayList<Character>(0);
}
List<Character> result = new ArrayList<Character>();
@@ -749,7 +749,7 @@ public class MemorySection implements ConfigurationSection {
List<Object> list = getList(path);
if (list == null) {
- return null;
+ return new ArrayList<Short>(0);
}
List<Short> result = new ArrayList<Short>();