Skip to content

Commit 71c6dd1

Browse files
author
John J. Aylward
committed
remove unneeded casts
1 parent 30c1bd1 commit 71c6dd1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

JSONWriter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,14 +325,14 @@ public static String valueToString(Object value) throws JSONException {
325325
return "null";
326326
}
327327
if (value instanceof JSONString) {
328-
Object object;
328+
String object;
329329
try {
330330
object = ((JSONString) value).toJSONString();
331331
} catch (Exception e) {
332332
throw new JSONException(e);
333333
}
334-
if (object instanceof String) {
335-
return (String) object;
334+
if (object != null) {
335+
return object;
336336
}
337337
throw new JSONException("Bad value from toJSONString: " + object);
338338
}

0 commit comments

Comments
 (0)