Refactoring: Remove unused code#989
Conversation
Remove "NULL.equals(object)" on line 2756 of JSONObject.java since line 2752 has already tested it. Remove the empty string on line 249 of JSONPointer.java.
| } | ||
| if (object instanceof JSONObject || object instanceof JSONArray | ||
| || NULL.equals(object) || object instanceof JSONString | ||
| if (object instanceof JSONObject || object instanceof JSONArray || object instanceof JSONString |
There was a problem hiding this comment.
how should I do that?
There was a problem hiding this comment.
if ( object instanceof JSONObject || object instanceof JSONArray
|| object instanceof JSONString || object instanceof Byte
|| object instanceof Character || object instanceof Short
|| object instanceof Integer || object instanceof Long
|| object instanceof Boolean || object instanceof Float
|| object instanceof Double || object instanceof String
|| object instanceof BigInteger|| object instanceof BigDecimal
|| object instanceof Enum) {
return object;
}There was a problem hiding this comment.
how should I do that?
Just have 2 checks per line, so split line 2755 into 2 lines
|
What problem does this code solve? Does the code still compile with Java6? Risks Changes to the API? Will this require a new release? Should the documentation be updated? Does it break the unit tests? Was any code refactored in this commit? Review status Starting 3-day comment window |
|



I found these 2 can be optimized during the last refactor.
NULL.equals(object)inwarp()method on line 2756 ofJSONObject.javasince line 2752 has already tested it.readByIndexToken()method on line 249 ofJSONPointer.java.