Aditya Purohit
7f1cb8bf62
refactor: decompose condition of digit checks by using extra method 'isNumericChar(...)' in NumberConversionUtil.
2023-11-19 09:51:44 -04:00
Aditya Purohit
75419e3f25
refactor: introduce explaining variable 'indentationSuffix' in XML.toString()
2023-11-19 09:21:05 -04:00
Aditya Purohit
097a401f3f
refactor: rename variable boolean 'b' to 'isEndOfPair' in CookieList.toString()
2023-11-19 09:11:32 -04:00
Sean Leary
783d298f99
Merge pull request #814 from rudrajyotib/issue813
...
Refactor duplicate code for stringToNumber() in JSONObject, JSONArray, and XML
2023-10-31 17:40:17 -05:00
rudrajyoti biswas
8ec822c575
#748 - PR comments - follow convention of configuration builder.
2023-10-28 07:36:31 +05:30
rudrajyoti biswas
c05d7058ff
#748 - javadoc updated for methods.
2023-10-27 17:17:20 +05:30
rudrajyoti biswas
c6ec2f0e4c
#748 - close XML tag explicitly for empty tags with configuration.
2023-10-25 23:23:00 +05:30
rudrajyoti biswas
5539722c69
#813 - address PR review comment - brought down visibility.
2023-10-23 23:03:35 +05:30
rudrajyoti biswas
98b79ae7bf
#813 - moved number conversion related common changes to utility static method.
2023-10-23 19:16:25 +05:30
Rudrajyoti Biswas
04a4c5a3ec
Merge branch 'stleary:master' into master
2023-10-21 12:29:31 +00:00
rudrajyoti biswas
2374766018
#790 - Update XML with changes for string to number conversion.
...
For now the code remains duplicated in JSON and XML parsers.
Unit test cases updated to comply with number expectations.
2023-10-19 14:07:53 +05:30
rudrajyoti biswas
1d0775cce7
Revert changes with feature and refactor together.
2023-10-19 10:28:11 +05:30
theKnightsOfRohan
f074bed732
fix(ParserConfiguration): add <T> params to docs
2023-10-16 17:48:03 -07:00
rudrajyoti biswas
7b2677ac5a
#790 - Update XML with changes for string to number conversion.
...
Moved the code logic to a common utility to de-duplicate.
2023-10-14 10:05:36 +05:30
rudrajyoti biswas
56cb5f84c4
#653 - review comments updated.
2023-10-12 11:03:13 +05:30
rudrajyoti biswas
0cdc38ac24
#653 - review comments updated.
2023-10-12 00:53:36 +05:30
Rudrajyoti Biswas
d5277b126b
Merge branch 'stleary:master' into master
2023-10-11 19:17:21 +00:00
Madjosz
c93014cb53
add validity check for JSONObject constructors
...
* fixes #713
* document JSONException in JavaDoc
* remove unused Comparable<T> boundary to reuse GenericBean in test
2023-10-07 09:38:54 +02:00
rudrajyoti biswas
1a38879c90
#653 - optLong vs getLong inconsistencies
...
For exponential decimal conversion, number is not touched.
Leading zeros removed from numeric number strings before converting to number.
2023-10-06 21:34:00 +05:30
Sean Leary
79af389f7a
Merge pull request #774 from mccartney/removing-synchronized
...
Removing excessive synchronization
2023-10-04 07:40:10 -05:00
Sean Leary
beb2fb5706
Merge pull request #772 from eamonnmcmanus/complexkey
...
Disallow nested objects and arrays as keys in objects.
2023-10-01 11:04:40 -05:00
Grzegorz Olędzki
61bb60e752
Removing excessive synchronization
2023-09-30 21:36:11 +02:00
Éamonn McManus
16967f322e
Simplify the check for object keys that are themselves objects.
...
For object keys, we can just skip the part of `nextValue()` that parses values
that are objects or arrays. Then the existing logic for unquoted values will
already stop at `{` or `[`, and that will produce a `Missing value` exception.
2023-09-27 12:42:04 -07:00
Edijs
284a316838
Add optJSONArray and optJSONObject methods to JSONArray with a default value
2023-09-27 19:30:45 +03:00
Edijs
db0fde2a56
Add optJSONArray method to JSONObject with a default value
2023-09-25 20:31:58 +03:00
Éamonn McManus
661114c50d
Generalize the logic to disallow nested objects and arrays as keys in objects.
...
Fixes #771 .
2023-09-20 10:50:48 -07:00
Éamonn McManus
2a4bc3420a
Apply simplification suggested by @johnjaylward.
2023-08-01 14:38:45 -07:00
Éamonn McManus
c8a9e15a57
Don't skip past \0
when parsing JSON objects.
...
A better solution might be to use -1 instead 0 to represent EOF everywhere,
which of course means changing `char` variables to `int`. The solution here is
enough to solve the immediate problem, though.
Fixes #758 .
2023-08-01 13:11:25 -07:00
dburbrid
4951ec48c8
Renamed object methods from ...Obj to ...Object.
...
Added object method for optDoubleObject (returns Double vice double).
Added similar methods in JSONArray.
Added test methods.
2023-06-29 09:39:34 +01:00
Michael Osipov
133c0cc75f
JSONTokener(InputStream) violates rfc8259#section-8.1 ( #739 )
...
Always use UTF-8 when an InputStream is passed.
This fixes #739 .
2023-05-24 11:45:25 +02:00
Sean Leary
8353b9c3f0
Merge pull request #731 from JoaoGFarias/patch-1
...
Removing commented out code in JSONObject optDouble()
2023-03-11 19:28:01 -06:00
HariBabu t
7eca507d13
Removed overriding closable interface.
2023-03-07 13:58:30 +08:00
HariBabu t
e1eabc9c27
JSONTokener implemented java.io.Closeable
2023-03-04 23:08:32 +08:00
João Farias
0d436d92e2
Removing commented out code
2023-03-02 16:39:11 +01:00
Tamas Perger
24093491a8
refactor: introduce ParserConfiguration class hierarchy
2023-02-21 19:13:07 +00:00
Tamas Perger
9234eab00a
refactor: make JSONMLParserConfiguration all-args constructor private, enforcing the builder pattern.
2023-02-13 01:09:29 +00:00
Tamas Perger
72f4c3e646
refactor: rename XMLtoJSONMLParserConfiguration to JSONMLParserConfiguration
2023-02-12 01:32:34 +00:00
Tamas Perger
df2d6f8363
fix: introduce optional XMLtoJSONMLParserConfiguration parameter for JSONML.toJSONArray(...) functions, to facilitate max nesting depth override.
2023-02-11 01:52:13 +00:00
Tamas Perger
a6e412bded
fix: limit the nesting depth in JSONML
...
Limit the XML nesting depth for CVE-2022-45688 when using the JsonML transform.
2023-02-10 01:46:44 +00:00
Tamas Perger
2391d248cc
fix: amend XMLParserConfiguration.clone() to include the new maxNestingDepth param.
...
Amend Javadoc for XML and XMLParserConfiguration classes.
2023-02-10 01:45:34 +00:00
Cleydyr de Albuquerque
448e204186
docs: remove wrong description of parse method
2023-02-02 20:16:16 +01:00
Cleydyr de Albuquerque
eb56704e68
fix: set default maximum nesting depth as 512
2023-02-02 18:15:03 +01:00
Cleydyr de Albuquerque
f566a1d9ee
fix: limit the nesting depth
2023-02-01 16:26:58 +01:00
Niranjani
c798c76ddd
move javadoc comments above the interface definition to make it visible
...
Fix #670
2022-10-30 22:10:38 +05:30
Dean
9cb8e153bf
Added JavaDocs
2022-10-07 17:57:07 +01:00
Dean
b7f708b222
Altered XML toString to allow indentation param
2022-10-06 12:01:13 +01:00
stleary
89f6e7f6a6
Merge branch 'master' into update-copyright
2022-08-26 20:59:00 -05:00
Sean Leary
346fb26f2d
Merge pull request #683 from spaffrath/Issue_682_JSONString_similarity
...
Issue 682 JSONString similarity
2022-08-26 20:57:22 -05:00
stleary
6daabb43ab
update-copyright - Replace copyright and license restrictions with Public Domain
2022-08-23 20:00:25 -05:00
stleary
e0534b3ec7
initial attempt to test for inconsistent map types in JSONObject
2022-08-20 16:14:34 -05:00