diff --git a/src/main/java/com/moandjiezana/toml/Toml.java b/src/main/java/com/moandjiezana/toml/Toml.java index cfb93b9..fafac03 100644 --- a/src/main/java/com/moandjiezana/toml/Toml.java +++ b/src/main/java/com/moandjiezana/toml/Toml.java @@ -18,7 +18,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; -import java.util.regex.Pattern; import com.google.gson.Gson; import com.google.gson.JsonElement; @@ -43,7 +42,6 @@ import com.google.gson.JsonElement; public class Toml { private static final Gson DEFAULT_GSON = new Gson(); - private static final Pattern ARRAY_INDEX_PATTERN = Pattern.compile("(.*)\\[(\\d+)\\]"); private Map values = new HashMap(); private final Toml defaults; @@ -143,8 +141,8 @@ public class Toml { return (Long) get(key); } - @SuppressWarnings("unchecked") public List getList(String key) { + @SuppressWarnings("unchecked") List list = (List) get(key); if (list == null) { diff --git a/src/test/java/com/moandjiezana/toml/RealWorldTest.java b/src/test/java/com/moandjiezana/toml/RealWorldTest.java index 2a86aa4..b4f99eb 100644 --- a/src/test/java/com/moandjiezana/toml/RealWorldTest.java +++ b/src/test/java/com/moandjiezana/toml/RealWorldTest.java @@ -108,8 +108,8 @@ public class RealWorldTest { assertFalse(toml.getBoolean("Booleans.False")); assertThat(toml.getList("Array.key1"), contains(1L, 2L, 3L)); assertThat(toml.getList("Array.key2"), contains("red", "yellow", "green")); - assertEquals(asList(asList(1L, 2L), asList(3L, 4L, 5L)), toml.getList("Array.key3")); - assertEquals(asList(asList(1L, 2L), asList("a", "b", "c")), toml.getList("Array.key4")); + assertEquals(asList(asList(1L, 2L), asList(3L, 4L, 5L)), toml.>getList("Array.key3")); + assertEquals(asList(asList(1L, 2L), asList("a", "b", "c")), toml.>getList("Array.key4")); assertThat(toml.getList("Array.key5"), contains(1L, 2L, 3L)); assertThat(toml.getList("Array.key6"), contains(1L, 2L)); assertEquals("Hammer", toml.getString("products[0].name"));