Revert "reduces the use of unnecessary exceptions"#261
Conversation
|
What problem does this code solve? Risk Changes to the API? Will this require a new release? Should the documentation be updated? Change to unit tests? Note |
|
@stleary looking at the reversal, this does not solve the issue. |
|
@johnjaylward please elaborate. |
|
the functions optBoolean, optLong, optInt, etc were calling the get method internally before the original changes were made that this is reverting. |
|
https://github.com/stleary/JSON-java/blob/master/JSONObject.java#L513 it is still calling get() without a try-catch block, so the issue in #260 is not solved. |
|
oh nevermind. I thought this was merged already, but I now see it's not. I was mistaken when I saw the closed status above. |
|
No worries, let me know if you see any other reason not to revert, am otherwise strongly inclined to proceed. |
|
I ran the tests against the reverted branch just now, and they all seem to pass, while there are failures on master. At this time I see no reason to hold the revert. |
|
You may want to just add a new commit after the revert to correct the comment fixes that @Simulant87 made in #249. Those are valid fixes. |
|
@johnjaylward is right. changing
to
in all the optXXX methods fixes the bug. I think I can submit a new merge-request to fix this bug in 12 hours, if you can wait for this. Otherwise someone else can do the fix. |
Reverts #249