From bb4c199487ef5b181ae1d13c5241e424455361de Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 23 Jun 2018 18:20:27 -0700 Subject: [PATCH] Removed code smells. --- .../database/flatfile/FlatFileDatabaseHandler.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/java/us/tastybento/bskyblock/database/flatfile/FlatFileDatabaseHandler.java b/src/main/java/us/tastybento/bskyblock/database/flatfile/FlatFileDatabaseHandler.java index c5a4cef3f..2ed59f8b4 100644 --- a/src/main/java/us/tastybento/bskyblock/database/flatfile/FlatFileDatabaseHandler.java +++ b/src/main/java/us/tastybento/bskyblock/database/flatfile/FlatFileDatabaseHandler.java @@ -142,11 +142,6 @@ public class FlatFileDatabaseHandler extends AbstractDatabaseHandler { // Get the original value Object value = config.get(storageLocation); method.invoke(instance, ((AdapterInterface)adapterNotation.value().newInstance()).deserialize(value)); - /* - * I don't know what this part is for... - if (value != null && !value.getClass().equals(MemorySection.class)) { - method.invoke(instance, deserialize(value,propertyDescriptor.getPropertyType())); - }*/ // We are done here continue; } @@ -273,7 +268,7 @@ public class FlatFileDatabaseHandler extends AbstractDatabaseHandler { // Get path for comments String parent = ""; if (storageLocation.contains(".")) { - parent = storageLocation.substring(0, storageLocation.lastIndexOf(".")) + "."; + parent = storageLocation.substring(0, storageLocation.lastIndexOf('.')) + "."; } // See if there are multiple comments ConfigComment.Line comments = field.getAnnotation(ConfigComment.Line.class); @@ -355,7 +350,7 @@ public class FlatFileDatabaseHandler extends AbstractDatabaseHandler { // Store placeholder config.set(parent + random, " "); // Create comment - yamlComments.put(random, "# " + comment.value()); + yamlComments.put(random, "# " + comment.value()); } /** @@ -412,7 +407,7 @@ public class FlatFileDatabaseHandler extends AbstractDatabaseHandler { } if (clazz.equals(Float.class) && value.getClass().equals(String.class)) { return Float.valueOf((String)value); - } + } if (clazz.equals(UUID.class)) { value = UUID.fromString((String)value); }