-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Refactoring: Remove unused code #989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AlexCai2019 Please make this formatting change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how should I do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.