mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-24 11:45:31 +01:00
Removed code smells.
This commit is contained in:
parent
4fc63b6de0
commit
bb4c199487
@ -142,11 +142,6 @@ public class FlatFileDatabaseHandler<T> extends AbstractDatabaseHandler<T> {
|
|||||||
// Get the original value
|
// Get the original value
|
||||||
Object value = config.get(storageLocation);
|
Object value = config.get(storageLocation);
|
||||||
method.invoke(instance, ((AdapterInterface<?,?>)adapterNotation.value().newInstance()).deserialize(value));
|
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
|
// We are done here
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -273,7 +268,7 @@ public class FlatFileDatabaseHandler<T> extends AbstractDatabaseHandler<T> {
|
|||||||
// Get path for comments
|
// Get path for comments
|
||||||
String parent = "";
|
String parent = "";
|
||||||
if (storageLocation.contains(".")) {
|
if (storageLocation.contains(".")) {
|
||||||
parent = storageLocation.substring(0, storageLocation.lastIndexOf(".")) + ".";
|
parent = storageLocation.substring(0, storageLocation.lastIndexOf('.')) + ".";
|
||||||
}
|
}
|
||||||
// See if there are multiple comments
|
// See if there are multiple comments
|
||||||
ConfigComment.Line comments = field.getAnnotation(ConfigComment.Line.class);
|
ConfigComment.Line comments = field.getAnnotation(ConfigComment.Line.class);
|
||||||
@ -355,7 +350,7 @@ public class FlatFileDatabaseHandler<T> extends AbstractDatabaseHandler<T> {
|
|||||||
// Store placeholder
|
// Store placeholder
|
||||||
config.set(parent + random, " ");
|
config.set(parent + random, " ");
|
||||||
// Create comment
|
// Create comment
|
||||||
yamlComments.put(random, "# " + comment.value());
|
yamlComments.put(random, "# " + comment.value());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -412,7 +407,7 @@ public class FlatFileDatabaseHandler<T> extends AbstractDatabaseHandler<T> {
|
|||||||
}
|
}
|
||||||
if (clazz.equals(Float.class) && value.getClass().equals(String.class)) {
|
if (clazz.equals(Float.class) && value.getClass().equals(String.class)) {
|
||||||
return Float.valueOf((String)value);
|
return Float.valueOf((String)value);
|
||||||
}
|
}
|
||||||
if (clazz.equals(UUID.class)) {
|
if (clazz.equals(UUID.class)) {
|
||||||
value = UUID.fromString((String)value);
|
value = UUID.fromString((String)value);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user