mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-17 04:44:43 +02:00
Refractoring and Cleanup
Optimized some of the code where possible and removed some magic numbers as well.
This commit is contained in:
@ -360,7 +360,7 @@ public class JSONObject {
|
||||
}
|
||||
|
||||
public static Writer quote(final String string, final Writer w) throws IOException {
|
||||
if ((string == null) || (string.length() == 0)) {
|
||||
if ((string == null) || (string.isEmpty())) {
|
||||
w.write("\"\"");
|
||||
return w;
|
||||
}
|
||||
@ -1111,7 +1111,7 @@ public class JSONObject {
|
||||
} else if (name.startsWith("is")) {
|
||||
key = name.substring(2);
|
||||
}
|
||||
if ((key.length() > 0) && Character.isUpperCase(key.charAt(0)) && (method.getParameterTypes().length == 0)) {
|
||||
if ((!key.isEmpty()) && Character.isUpperCase(key.charAt(0)) && (method.getParameterTypes().length == 0)) {
|
||||
if (key.length() == 1) {
|
||||
key = key.toLowerCase();
|
||||
} else if (!Character.isUpperCase(key.charAt(1))) {
|
||||
|
Reference in New Issue
Block a user