remove a handful of warnings

This commit is contained in:
Ben Fry
2014-02-06 23:31:58 -05:00
parent 9803d7958a
commit 434d8138cc
5 changed files with 21 additions and 9 deletions

View File

@@ -1644,10 +1644,10 @@ public class JSONObject {
return value.toString();
}
if (value instanceof Map) {
return new JSONObject((Map)value).toString();
return new JSONObject(value).toString();
}
if (value instanceof Collection) {
return new JSONArray((Collection)value).toString();
return new JSONArray(value).toString();
}
if (value.getClass().isArray()) {
return new JSONArray(value).toString();
@@ -1683,13 +1683,13 @@ public class JSONObject {
}
if (object instanceof Collection) {
return new JSONArray((Collection)object);
return new JSONArray(object);
}
if (object.getClass().isArray()) {
return new JSONArray(object);
}
if (object instanceof Map) {
return new JSONObject((Map)object);
return new JSONObject(object);
}
Package objectPackage = object.getClass().getPackage();
String objectPackageName = objectPackage != null
@@ -1732,9 +1732,9 @@ public class JSONObject {
} else if (value instanceof JSONArray) {
((JSONArray) value).write(writer, indentFactor, indent);
} else if (value instanceof Map) {
new JSONObject((Map) value).write(writer, indentFactor, indent);
new JSONObject(value).write(writer, indentFactor, indent);
} else if (value instanceof Collection) {
new JSONArray((Collection) value).write(writer, indentFactor,
new JSONArray(value).write(writer, indentFactor,
indent);
} else if (value.getClass().isArray()) {
new JSONArray(value).write(writer, indentFactor, indent);