Numeric enhancements, Refactoring, Fix spelling #336
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is mostly cleanup of comments with a few changes to also remove some compile time warnings.
increment
I replaced the autoboxing calls with explicit accessors and also prevented runtime casting by using the proper long/float/double literals.Null
I added a hashcode function that explicitly returns 0 everytime, the same as most hash functions when handling null :return someField == null ? 0 : someField.hashCode();
put
function forfloat
... for some reason we have code that handles floats in multiple places, but no way to directly add them into the JSONObject. Previously these would get converted todouble
put(literalNumber)
methods to use the valueOf static instead of always creating new instances.this.
constructor
parameters to be final.toString(String, String)
updated parameters to be finalLet me know if I should roll any of the changes back and just keep the comment fixes.