summaryrefslogtreecommitdiffstats
path: root/json
Commit message (Collapse)AuthorAgeFilesLines
* Fix org.json.JSONTokenerTest#testNextStringUnicodeEscaped.Elliott Hughes2015-01-291-3/+2
| | | | | | | | | Throwing NumberFormatException for bad Unicode escapes was a bug. The test I added when I fixed that was in a different file, and apparently I didn't re-run these tests. Bug: https://code.google.com/p/android/issues/detail?id=103641 Change-Id: I271063ef12eab1369e4ce4cbbb7dd00e15c9ce79
* Throw JSONException rather than NumberFormatException for an invalid escape.Elliott Hughes2015-01-222-6/+14
| | | | | | | | | Only our documentation claims that any of the JSON code throws NumberFormatException, and throwing JSONException seems much more in keeping with the rest of the API (and makes it easier for callers to handle errors). Bug: https://code.google.com/p/android/issues/detail?id=103641 Change-Id: I4f4ebfd983f4ccb2a1f266a0bfa5732174df26f6
* Add missing JSONObject#keySet API.Narayan Kamath2014-01-221-2/+16
| | | | | | | | | | | | Also, add type arguments to the old Iterator API. Note that this is source incompatible with wrongly generified code (example: "Iterator<Object> keys = jsonObject.keys();") but is compatible with old code that didn't use any type arguments. Users compiling against the new SDK might see compile breakages. bug: https://code.google.com/p/android/issues/detail?id=63191 Change-Id: Idf2ef1889dccb4309c843ab073f67af648b09436
* Fix docs build.Narayan Kamath2014-01-131-1/+3
| | | | | | Javadoc referred to a hidden method via a {@link} tag. Change-Id: I18fc8a05aacd17bdc5fffe4f08870aa3d6d47b93
* Implement JSONObject#append.Narayan Kamath2014-01-133-8/+85
| | | | | | | | It provides better semantics that accumulate. In particular, the type of the mapping does not depend on the number of calls to the function. Change-Id: Ib8f9d229d8de72d57b25ff9d69c69a61215c2fd7
* Fix JSONObject#test_toString_listAsMapValuesNarayan Kamath2014-01-132-5/+6
| | | | | | | | Changed the map type in JSONObject to a LinkedHashMap so that its iteration order is well defined. bug: 12476022 Change-Id: I8f2e40fd6bca5f776396aba4c9fde6e9d58f662e
* Fix JSONArrayTest.Narayan Kamath2013-11-281-1/+1
| | | | | | Whitespace issues. Change-Id: I12bf6134c9bdd060ab5362f97d2315471ecd7251
* Add a test for JSONArray and enums.Elliott Hughes2013-11-261-0/+13
| | | | | Bug: https://code.google.com/p/android/issues/detail?id=62539 Change-Id: If41b9afe801832ea796649d27b0af25657653684
* Make JSONObject summary documentation clearer.Elliott Hughes2013-10-121-20/+21
| | | | | | | | | The class documentation makes the difference between the 'get' and 'opt' methods very clear, but it's less clear to anyone just looking at the summary of methods. Bug: https://code.google.com/p/android/issues/detail?id=60998 Change-Id: I17eeaea182a9dbad7be9fbd55086977b512b6fa8
* Implement JSONObject.wrap, and use it.Elliott Hughes2013-07-114-6/+110
| | | | | Bug: https://code.google.com/p/android/issues/detail?id=55114 Change-Id: Ic2e010ac616f24dda7b8abced7eb2fc84dc7d50e
* Implement JSONArray.remove.Elliott Hughes2013-07-092-4/+28
| | | | | Bug: https://code.google.com/p/android/issues/detail?id=53461 Change-Id: I2b920fa8d63bcc8f1260669d72e33833bbd81ced
* Be explicit about how dangerous JSON "longs" are.Elliott Hughes2013-02-201-5/+9
| | | | | Bug: https://code.google.com/p/android/issues/detail?id=47878 Change-Id: I0cd05348708a2374a0e301f778bc2ed29cc38f94
* Add detail messages to all remaining NullPointerExceptions.Elliott Hughes2012-12-042-2/+2
| | | | | | I've left java.util.concurrent alone, since that's upstream code. Change-Id: I349960aaddb78e55d4c336b58b637009db69ff98
* Skip byte order mark (BOM) in org.jsonJesse Wilson2011-07-202-0/+16
| | | | | Bug: http://code.google.com/p/android/issues/detail?id=18508 Change-Id: Ib992a0a4b22e340446abab14e4f32df5efcd0b49
* Fix string to boolean coercsion.Jesse Wilson2011-07-087-15/+45
| | | | | | | | | | When we reimplemented this API I broke consistency with org.json. Bringing it back into line makes the implementation more strict (my preference) and makes us consistent with ourselves before this code was redone. Bug: http://code.google.com/p/android/issues/detail?id=16411 Change-Id: I8c1b52e382ad91932d3cf9a5b346db58df4da7c6
* Comments/javadoc should be in en_US, not en_CA.Elliott Hughes2010-12-031-1/+1
| | | | Change-Id: Ie9dde4971e0a6a8dadd14af43d631158fc488cd8
* Sorting imports.Jesse Wilson2010-08-115-11/+19
| | | | Change-Id: I8347bc625480a1c37a1ed9976193ddfedeb00bbc
* Scrubbing broken tests and removing unnecessary organization AllTests.java ↵Jesse Wilson2010-06-041-33/+0
| | | | | | | | | | | | | | | files. I've deleted as many tests as possible that duplicated coverage in Harmony. We're now running their tests directly against our codebase and having two copies of every test is quite painful; particularly when the tests need maintenance. The AllTests files aren't necessary, our test harness can automatically find tests and run them without external organization. This strategy is also more reliable, since often the AllTests files are out of sync. Change-Id: I3ee052f8839e9b146ba47f945812f5937d878110
* Remove all trailing whitespace from the dalvik team-maintained parts of libcore.Elliott Hughes2010-05-135-7/+7
| | | | | | Gentlemen, you may now set your editors to "strip trailing whitespace"... Change-Id: I85b2f6c80e5fbef1af6cab11789790b078c11b1b
* Adding support for hash '#' comments to our JSON parser.Jesse Wilson2010-04-063-30/+70
| | | | | | | | | | Neither the JSON RFC nor the documentation of Crockford's implementation mention these comments, but somehow the old parser used to support these. And so we shall also. See bug 2571423. Change-Id: I77d64c5ec53278d8df5fe1873404f1241320504b
* Test and document our handling of nulls with getString().Jesse Wilson2010-03-252-1/+26
| | | | | | | | | | Our behaviour is consistent with Crockford's. The test confirms that the behaviour is consistent with the report of that bug, which the submitter claims is not how it should behave. http://code.google.com/p/android/issues/detail?id=7257 Change-Id: Ibace4bd995e3cbc8fb6c9dc509f8f4491865a647
* Drop needless parens from Javadoc.Jesse Wilson2010-03-184-14/+14
| | | | | | | Although this violates my longstanding style preference, it agrees with almighty JJB's official ArrayList, which is Good Enough For Me. Change-Id: I7b608c12e04d0b7789bfcabeab4b7347ad22baca
* Javadoc for JSONArray.Jesse Wilson2010-03-182-24/+290
| | | | Change-Id: I3aced2607b48210f76887e0d42b591c098ce5db7
* Merge "Javadocs for JSONObject."Jesse Wilson2010-03-173-7/+374
|\
| * Javadocs for JSONObject.Jesse Wilson2010-03-173-7/+374
| | | | | | | | Change-Id: I5ec9df6a3a9baac8f4f498890cd35feff774737a
* | Fixing an @link issue that is upsetting DroidDoc.Jesse Wilson2010-03-161-4/+4
|/ | | | Change-Id: I9837cfd46684ac6d5b9ec4ac6809da3c3f61d57d
* First half of JSON Javadocs.Jesse Wilson2010-03-163-19/+214
| | | | Change-Id: I277ec3b35a28802dd7b7f82c1f4bbadbd3cc4c65
* Adding an Apache-licensed implementation of org.jsonJesse Wilson2010-03-126-0/+0
| | | | Change-Id: I1b67bac70bd25220a619e6ebe61f7f1c6f316faa
* Removing the non-free org.json implementationJesse Wilson2010-03-125-2662/+0
| | | | Change-Id: Ife53082824f5916665f198d4b2fb863271841ce0
* A cleanroom implementation of the org.json API.Jesse Wilson2010-03-1213-161/+2362
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implementation lacks documentation. I intend to write that after checking it into the master branch. By not waiting we'll have more time to exercise the code, if only in Google's own applications. This passes all of my tests. I rewrote some of the tests to make Crockford's implementation fail. The tests that fail on Crockford's implementation are: JSONArrayTest testEqualsAndHashCode equals() not consistent with hashCode() testTokenerConstructorParseFail StackOverflowError testStringConstructorParseFail StackOverflowError JSONObjectTest testOtherNumbers Object.put() accepted a NaN (via a custom Number class) testMapConstructorWithBogusEntries JSONObject constructor doesn't validate its input! JSONTokenerTest testNextNWithAllRemaining off-by-one error? testNext0 Returning an empty string should be valid testNextCleanCommentsTrailingSingleSlash nextClean doesn't consume a trailing slash assertNotClean The character line tabulation is not whitespace according to the JSON spec. testNextToDoesntStopOnNull nextTo() shouldn't stop after \0 characters testNextToConsumesNull nextTo shouldn't consume \0. testSkipToStopsOnNull skipTo shouldn't stop when it sees '\0' ParsingTest testParsingLargeHexValues For input "0x80000000" Hex values are parsed as Strings if their signed value is greater than Integer.MAX_VALUE. testSyntaxProblemUnterminatedArray Stack overflowed on input "[" Change-Id: I44c4a4a698a66bf043ed339d6bd804951e732cbf
* New tests for JSONObject and for JSON's self-use.Jesse Wilson2010-03-105-7/+1090
| | | | | | | | | Alongside development of these tests, I'm working on a new cleanroom implementation. The self use test was written to prevent me from self-using in a way that the original implementation does not. Change-Id: Ie617aca1978bd39d85b05e5c2c7bd657ed159dd6
* Fixing packages for JSON testsJesse Wilson2010-02-173-14/+3
|
* First round of tests for the subset of the org.json in Android.Jesse Wilson2010-02-174-0/+1301
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-036-0/+2662
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-036-2662/+0
|
* Initial ContributionThe Android Open Source Project2008-10-216-0/+2662