1465 Commits

Author SHA1 Message Date
Sean Leary
b959027aa2 Merge pull request #1044 from yuki-matsuhashi/1043-ignore-static
Ignore static fields in JSONObject.fromJson()
2026-03-16 09:24:24 -05:00
Yuki Matsuhashi
039f331d7d Add comment for empty test constructor 2026-03-13 01:54:58 +09:00
Yuki Matsuhashi
94e340002b Ignore static fields in JSONObject.fromJson() 2026-03-13 01:23:59 +09:00
Sean Leary
6230128f59 Merge pull request #1041 from stleary/license-clarification
Enhance README with license clarification
2026-02-22 15:14:00 -06:00
Sean Leary
ff264ef647 Enhance README with license clarification
Added license clarification
2026-02-18 14:50:17 -06:00
Sean Leary
a37aa69480 Merge pull request #1039 from pratiktiwari13/bugfix/empty-force-list
Fixes the issue of losing the array if an empty forceList element or a tag is in the middle or the end
2026-02-03 11:15:58 -06:00
Pratik Tiwari
510a03ac36 Fixes #1040, Aligns non-forceList behaviour with forceList 2026-01-31 10:34:24 +05:30
Sean Leary
538afc3d78 Merge pull request #1038 from OwenSanzas/fix-xmltokener-unescapeentity
Fix input validation in XMLTokener.unescapeEntity()
2026-01-30 08:13:34 -06:00
Sean Leary
d092d0903c Merge pull request #1037 from OwenSanzas/fix-jsonml-classcast
Fix ClassCastException in JSONML.toJSONArray and toJSONObject
2026-01-30 08:12:16 -06:00
Pratik Tiwari
7a8da886e7 Remove unnecessary conditions 2026-01-30 19:29:46 +05:30
OwenSanzas
0737e04f8a Add unit tests for JSONML ClassCastException fix
Added comprehensive test coverage for safe type casting:

Exception cases (should throw JSONException, not ClassCastException):
- Malformed XML causing type mismatch in toJSONArray()
- Type mismatch in toJSONObject()

Valid cases (should continue to work):
- Valid XML to JSONArray conversion
- Valid XML to JSONObject conversion

These tests verify the fix for issue #1034 where ClassCastException
was thrown when parse() returned unexpected types.
2026-01-28 10:07:34 +00:00
OwenSanzas
592e7828d9 Add unit tests for XMLTokener.unescapeEntity() input validation
Added comprehensive test coverage for numeric character reference parsing:

Exception cases (should throw JSONException):
- Empty numeric entity: &#;
- Invalid decimal entity: &#txx;
- Empty hex entity: &#x;
- Invalid hex characters: &#xGGG;

Valid cases (should parse correctly):
- Decimal entity: A -> 'A'
- Lowercase hex entity: A -> 'A'
- Uppercase hex entity: A -> 'A'

These tests verify the fixes for issues #1035 and #1036.
2026-01-28 09:58:35 +00:00
OwenSanzas
6c1bfbc7a5 Refactor XMLTokener.unescapeEntity() to reduce complexity
Extracted hex and decimal parsing logic into separate methods to
address SonarQube complexity warning:
- parseHexEntity(): handles ઼ format
- parseDecimalEntity(): handles { format

This reduces cyclomatic complexity while maintaining identical
functionality and all validation checks.
2026-01-28 09:52:25 +00:00
OwenSanzas
534ce3c4d1 Fix input validation in XMLTokener.unescapeEntity()
Fix StringIndexOutOfBoundsException and NumberFormatException in
XMLTokener.unescapeEntity() when parsing malformed XML numeric
character references.

Issues:
- &#; (empty numeric reference) caused StringIndexOutOfBoundsException
- &#txx; (invalid decimal) caused NumberFormatException
- &#xGGG; (invalid hex) caused NumberFormatException

Changes:
- Add length validation before accessing character positions
- Add isValidHex() and isValidDecimal() helper methods
- Throw proper JSONException with descriptive messages

Fixes #1035, Fixes #1036
2026-01-27 11:40:18 +00:00
OwenSanzas
9d14246bee Fix ClassCastException in JSONML.toJSONArray and toJSONObject
Add type checking before casting parse() results to JSONArray/JSONObject.
When parse() returns an unexpected type (e.g., String for malformed input),
the code now throws a descriptive JSONException instead of ClassCastException.

This prevents unchecked exceptions from propagating to callers who only
expect JSONException from these methods.

Fixes #1034
2026-01-27 11:36:46 +00:00
Pratik Tiwari
995fb840f7 Fixes the issue of losing the array if an empty forceList element or a tag is in the middle or the end 2026-01-02 21:20:53 +05:30
Sean Leary
e635f40238 Merge pull request #1027 from Simulant87/1023-set-default-locale
Save/restore default locale in test
2025-12-29 19:42:57 -06:00
Sean Leary
d5e744ca90 Merge pull request #1028 from Simulant87/fix-sonarqube-reliability-issues
Refactoring: Fix sonarqube reliability issues
2025-12-29 19:42:02 -06:00
Sean Leary
e0c4086168 Merge pull request #1029 from Simulant87/external-javadoc-badge
add badge to external hosted javadoc
2025-12-29 19:41:31 -06:00
Sean Leary
cf653682be Merge pull request #1030 from stleary/pre-release-20251224
pre-release-20251224 Prep for next release
20251224
2025-12-24 09:16:47 -06:00
Sean Leary
24bba97c1d pre-release-20251224 update docs and builds for next release 2025-12-24 09:05:18 -06:00
Simulant
96353de304 add badge to external hosted javadoc 2025-12-21 23:16:01 +01:00
Simulant
8cbb4d5bb3 Fix sonarqube reliability issues 2025-12-20 22:57:24 +01:00
Simulant
421abfdc1f save and restore the current default locale, to avoid any side effects on other executions in the same JVM 2025-12-20 22:27:45 +01:00
Sean Leary
128fb42ccc Merge pull request #1021 from Simulant87/update-build-script
Update github build actions, add LTS JDK 25 build
2025-11-18 07:26:35 -06:00
Simulant87
f8e6dfdc63 Merge pull request #3 from Simulant87/update-readme
Update README.md tested on java 25
2025-11-14 15:49:30 +01:00
Simulant87
3bc98dfc7f Update README.md tested on java 25 2025-11-14 15:49:09 +01:00
Simulant87
005dc7b49e add build for LTS JDK 25 2025-11-14 15:47:58 +01:00
Simulant87
d38cb064fd reset setup-java to version 1 for 1.6 build 2025-11-14 15:45:41 +01:00
Simulant87
e9a7d7c72e add distribution to java 1.6 build 2025-11-14 15:40:21 +01:00
Simulant87
73c582e129 update github actions to version 5
consistently update all actions checkout, setup-java, upload-artifactory to version 5
2025-11-14 15:29:52 +01:00
Sean Leary
a6ca84074a Merge pull request #1020 from Abhineshhh/fix/support-java-records
Fix: Support Java record accessors in JSONObject
2025-11-11 20:19:42 -06:00
Sean Leary
8c14e96c44 Merge pull request #1017 from Md-Yasir/enhancement/refactors
Code Refactors
2025-11-09 19:02:49 -06: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
fd1eee9c3b Add comprehensive edge case tests for record support 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
Sean Leary
25f355a953 Merge pull request #1006 from sk02241994/feature-1003
1003: Implement JSONObject.fromJson() with unit tests
2025-10-31 11:25:03 -05:00
sk02241994
42800c208a Updating to work with java 1.6 2025-10-28 13:06:11 +11:00
md-yasir
0cdc5e5170 Reverted Constructor access to public 2025-10-25 20:51:50 +05:30
md-yasir
ac65ee0490 Revert "Refactored stop conditions to be invariant by using while loop."
This issue can be ignored
2025-10-25 20:37:54 +05:30
md-yasir
39e8ead7cd Added java doc for deprecated decoration 2025-10-24 09:37:46 +05:30
md-yasir
6dd878d3c9 Deprecated public constructors instead of making it private. 2025-10-24 09:10:53 +05:30
md-yasir
2c6082a0a2 Refactored stop conditions to be invariant by using while loop. 2025-10-23 22:50:12 +05:30
md-yasir
5dc1031d17 Made JSONMl constructor to private and refactored ternary operations to independent statement in L243 2025-10-23 22:38:01 +05:30
md-yasir
1de42aa4fd Made CookieList constructor to private. 2025-10-23 22:37:00 +05:30
md-yasir
c13b57ca26 Made Cookie constructor to private. 2025-10-23 22:36:53 +05:30
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