XIAYM-gh
a25f83a0e4
Strip JSONTokener#isAtStart()
2026-09-11 03:57:03 +08:00
XIAYM-gh
359b43d8df
Apply corner-case fixes under instruction
2026-09-04 08:09:14 +08:00
XIAYM-gh
bcbbc89568
Fixes corner case where strict mode isn't working when JSONTokener's next() and back() are called first
2026-09-02 20:31:40 +08:00
Sean Leary
9953b76050
max-number-length-config sonarqube fixes
2026-07-16 13:23:39 -05:00
Mirko Swillus and Claude
703ac34a55
#1063 : add JSONParserConfiguration overloads for getBigInteger/optBigInteger
...
Per review on #1067 :
- objectToBigInteger(val, dflt, JSONParserConfiguration) uses
cfg.getMaxNumberLength() for the digit-count guard; -1 disables it.
Existing 2-arg form delegates with a default config.
- New public overloads on JSONObject and JSONArray:
getBigInteger(key, cfg) / optBigInteger(key, dflt, cfg).
Existing methods delegate with a default config.
- objectToBigDecimal left unchanged (no expansion path; agreed on PR).
- Tests cover default (1000), raised (2000), lowered (5), disabled (-1),
null config, and JSONArray overloads.
Co-Authored-By: Claude <[email protected] >
2026-07-16 11:42:40 +02:00
Mirko Swillus and Claude
fce83c91bb
#1063 : bound BigDecimal->BigInteger expansion in objectToBigInteger
...
Completes the CVE-2026-59171 fix started in ab92bb9 / #1065 . The
1000-char length guard in stringToValue admits short exponent-notation
literals (e.g. 1e100000000, 11 chars) which are stored compactly as
BigDecimal and only expand when getBigInteger/optBigInteger calls
BigDecimal.toBigInteger(), materialising ~10^8 digits and stalling the
thread or throwing OOM.
Guard both toBigInteger() sites in objectToBigInteger by rejecting any
BigDecimal whose integer part would exceed
ParserConfiguration.DEFAULT_MAX_NUMBER_LENGTH decimal digits
(precision() - scale(), both O(1) reads). Returns defaultValue on
overflow, matching the method's existing behaviour for non-finite and
unparseable values.
Covers JSONObject.getBigInteger/optBigInteger and
JSONArray.getBigInteger/optBigInteger (all delegate to this helper).
Adds JSONObjectTest.getBigIntegerHugeExponentReturnsDefault with a 5s
timeout so a regression fails fast rather than hanging CI.
Co-Authored-By: Claude <[email protected] >
2026-07-14 11:59:27 +02:00
Sean Leary
90563eb877
1063-option-3 parserConfig set max len
2026-07-13 15:33:12 -05:00
Damien Warren
ab92bb9088
Fixes CVE-2026-59171
2026-07-03 09:21:58 -07:00
Sean Leary
d84fa1af88
docs-and-warnings-cleanup cleanup some doc files, update pom for deployment, fix some JSONObject warnings
2026-05-29 10:38:42 -05:00
Yuki Matsuhashi
94e340002b
Ignore static fields in JSONObject.fromJson()
2026-03-13 01:23:59 +09:00
AbhineshJha
8f3b0f1c13
Add runtime record detection for backward compatibility
2025-11-02 22:32:44 +05:30
AbhineshJha
f2acf8af69
Optimize method name exclusion using Set lookup instead of multiple equals checks
2025-11-01 19:33:29 +05:30
AbhineshJha
2550c692cf
Refactor: Extract isRecordStyleAccessor helper method
2025-11-01 19:33:29 +05:30
AbhineshJha
20f5200000
Fix: Support Java record accessors in JSONObject
2025-11-01 19:33:29 +05:30
sk02241994
42800c208a
Updating to work with java 1.6
2025-10-28 13:06:11 +11:00
sk02241994
f92f281620
Updating to work with java 1.6
2025-10-23 17:33:37 +11:00
sk02241994
8ccf5d7525
Removing the interface classes and simplifying the implementation to use if else instead
2025-10-23 17:32:07 +11:00
sk02241994
a7c193090a
Updating docs
2025-10-16 14:23:30 +11:00
sk02241994
c4c2beb874
Limiting implemetation by removing the new classes.
2025-10-16 14:19:19 +11:00
sk02241994
9adea9e12d
Updating to work with java 1.6
2025-10-13 12:39:15 +11:00
sk02241994
7465da858c
- Updating for java 1.6
...
- Resolving Sonar cube issues.
2025-10-13 12:39:15 +11:00
sk02241994
0521928463
- Added implementation for Enum and Map
...
- Moving the CustomClass to data folder.
- Removing JSONBuilder.java
- Moving the implementation of JSONBuilder to JSONObject.
2025-10-13 12:39:14 +11:00
sk02241994
fbb6b3158e
Updating to work with java 1.6
2025-10-13 12:39:14 +11:00
sk02241994
ebc13d6685
Updating to work with java 1.6
2025-10-13 12:39:13 +11:00
sk02241994
7d28955216
Updating to work with java 1.6
2025-10-13 12:39:13 +11:00
sk02241994
83a0e34be5
1003: Implement JSONObject.fromJson() with unit tests
2025-10-13 12:39:12 +11:00
marilynel
f2af220cb4
more sonarcube fixes
2025-09-14 10:59:39 -08:00
marilynel
69c87dc4db
more sonarcube optimization in jsonobject.java
2025-09-07 12:52:59 -08:00
marilynel
53cfa742a7
more sonarcube optimization in jsonobject.java
2025-09-07 12:41:37 -08:00
marilynel
4e0f62b1a6
more sonarcube optimization in jsonobject.java
2025-09-07 12:28:52 -08:00
marilynel
6ed2880f55
more sonarcube cleanup
2025-08-24 12:55:49 -08:00
marilynel
9bb26bdb34
sonar cube stuff
2025-08-03 11:52:20 -08:00
marilynel
38c3a0bb3f
more sonarcube issues
2025-07-27 11:45:07 -08:00
marilynel
ebd9a17a3b
addressing minor sonarqube concerns
2025-07-27 11:26:50 -08:00
marilynel
e762629bcc
oops one more sonarcube issue lol
2025-07-20 12:04:51 -08:00
marilynel
7fc41a6c0e
addressing cognitive complextity
2025-07-20 11:58:30 -08:00
marilynel
fdaeb486ed
fixed some strict mode issues 980
2025-07-13 12:41:17 -08:00
Sean Leary
7b0d1942b4
tech-debt-25250701 add jacoco to gradle build, refactor JSONObject to restore performance
2025-07-03 20:39:13 -05:00
Sean Leary
197afddbfb
Merge pull request #990 from Simulant87/984-refactor-cognitive-complexity-populateMap
...
Refactor JSONObject populateMap() per SonarQube
2025-07-01 07:13:18 -05:00
Alex Cai
c882783d58
Format line 2755 in JSONObject.java
2025-06-27 01:44:27 +08:00
Simulant
5063d314a5
#984 extract method for annotation value check
2025-06-25 23:08:01 +02:00
Simulant
916fba5d39
#984 extract methods reducing cognitive complexity
...
for JSONObject#populateMap
2025-06-25 23:00:07 +02:00
AlexCai2019
aac376f305
Remove a redundant condition and an empty string
...
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.
2025-06-23 01:31:51 +08:00
Sean Leary
50330430ce
remove-unused-code-jsonobject removed unused method from jsonobject
2025-06-07 16:15:43 -05:00
AlexCai2019
e800cc349f
Use constant.equals()
...
There are some equals() that are not constant.equals(variable), but variable.equals(constant)
2025-06-05 02:15:49 +08:00
hboggavarapu
dadc3e59dc
Use JSONParserConfiguration to decide on serializing null fields into JSONObject #982
2025-05-23 17:57:08 +05:30
Robert Lichtenberger
1afd7cd6bc
Use better name for parser configuration option, fix API comment.
2025-03-21 07:25:37 +01:00
Robert Lichtenberger
d1327c2da3
Allow to configure Java null handling.
2025-03-19 07:59:57 +01:00
Simulant
4c873a1db4
#947 use JSONParserConfiguration of JSONTokener in JSONObject and JSONArray constructor
2025-01-15 21:41:01 +01:00
Michael Ameri
ca1c6830c9
remove field references to JSONTokener and JSONParserConfiguration in JSONArray
...
and JSONObject
2025-01-10 18:05:27 +01:00