mirror of
https://github.com/fankes/JSON-java-compat.git
synced 2025-09-06 02:35:33 +08:00
removed 6 unnecessary @SuppressWarnings("unchecked") annotations.
This commit is contained in:
@@ -1661,12 +1661,10 @@ public class JSONObject {
|
|||||||
return value.toString();
|
return value.toString();
|
||||||
}
|
}
|
||||||
if (value instanceof Map) {
|
if (value instanceof Map) {
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
Map<?, ?> map = (Map<?, ?>) value;
|
Map<?, ?> map = (Map<?, ?>) value;
|
||||||
return new JSONObject(map).toString();
|
return new JSONObject(map).toString();
|
||||||
}
|
}
|
||||||
if (value instanceof Collection) {
|
if (value instanceof Collection) {
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
Collection<?> coll = (Collection<?>) value;
|
Collection<?> coll = (Collection<?>) value;
|
||||||
return new JSONArray(coll).toString();
|
return new JSONArray(coll).toString();
|
||||||
}
|
}
|
||||||
@@ -1705,7 +1703,6 @@ public class JSONObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (object instanceof Collection) {
|
if (object instanceof Collection) {
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
Collection<?> coll = (Collection<?>) object;
|
Collection<?> coll = (Collection<?>) object;
|
||||||
return new JSONArray(coll);
|
return new JSONArray(coll);
|
||||||
}
|
}
|
||||||
@@ -1713,7 +1710,6 @@ public class JSONObject {
|
|||||||
return new JSONArray(object);
|
return new JSONArray(object);
|
||||||
}
|
}
|
||||||
if (object instanceof Map) {
|
if (object instanceof Map) {
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
Map<?, ?> map = (Map<?, ?>) object;
|
Map<?, ?> map = (Map<?, ?>) object;
|
||||||
return new JSONObject(map);
|
return new JSONObject(map);
|
||||||
}
|
}
|
||||||
@@ -1753,11 +1749,9 @@ public class JSONObject {
|
|||||||
} else if (value instanceof JSONArray) {
|
} else if (value instanceof JSONArray) {
|
||||||
((JSONArray) value).write(writer, indentFactor, indent);
|
((JSONArray) value).write(writer, indentFactor, indent);
|
||||||
} else if (value instanceof Map) {
|
} else if (value instanceof Map) {
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
Map<?, ?> map = (Map<?, ?>) value;
|
Map<?, ?> map = (Map<?, ?>) value;
|
||||||
new JSONObject(map).write(writer, indentFactor, indent);
|
new JSONObject(map).write(writer, indentFactor, indent);
|
||||||
} else if (value instanceof Collection) {
|
} else if (value instanceof Collection) {
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
Collection<?> coll = (Collection<?>) value;
|
Collection<?> coll = (Collection<?>) value;
|
||||||
new JSONArray(coll).write(writer, indentFactor, indent);
|
new JSONArray(coll).write(writer, indentFactor, indent);
|
||||||
} else if (value.getClass().isArray()) {
|
} else if (value.getClass().isArray()) {
|
||||||
|
Reference in New Issue
Block a user