From becc1631e6dbe41e3a0245d765b01509de2608b5 Mon Sep 17 00:00:00 2001 From: simonh5 Date: Mon, 18 Sep 2023 20:20:13 -0500 Subject: [PATCH 01/17] fix: flakiness in JSONMLTest#testToJSONObject_reversibility --- build.gradle | 1 + pom.xml | 7 +++++++ src/test/java/org/json/junit/JSONMLTest.java | 3 ++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 8a3708a..5a5be37 100644 --- a/build.gradle +++ b/build.gradle @@ -23,6 +23,7 @@ dependencies { testImplementation 'junit:junit:4.13.1' testImplementation 'com.jayway.jsonpath:json-path:2.1.0' testImplementation 'org.mockito:mockito-core:4.2.0' + testImplementation 'org.skyscreamer:jsonassert:1.5.1' } subprojects { diff --git a/pom.xml b/pom.xml index 720529c..8bbcc3c 100644 --- a/pom.xml +++ b/pom.xml @@ -72,6 +72,13 @@ 4.2.0 test + + + org.skyscreamer + jsonassert + 1.5.1 + test + diff --git a/src/test/java/org/json/junit/JSONMLTest.java b/src/test/java/org/json/junit/JSONMLTest.java index 35c0af2..9b5e5b6 100644 --- a/src/test/java/org/json/junit/JSONMLTest.java +++ b/src/test/java/org/json/junit/JSONMLTest.java @@ -8,6 +8,7 @@ import static org.junit.Assert.*; import org.json.*; import org.junit.Test; +import org.skyscreamer.jsonassert.JSONAssert; /** * Tests for org.json.JSONML.java @@ -763,7 +764,7 @@ public class JSONMLTest { final JSONObject revertedObject = JSONML.toJSONObject(xml, false); final String newJson = revertedObject.toString(); assertTrue("JSON Objects are not similar",originalObject.similar(revertedObject)); - assertEquals("original JSON does not equal the new JSON",originalJson, newJson); + JSONAssert.assertEquals("original JSON does not equal the new JSON", originalJson, newJson, false); } // these tests do not pass for the following reasons: From ca88454f1cdaedf46bcce546c0a9ce79709c544c Mon Sep 17 00:00:00 2001 From: simonh5 Date: Tue, 19 Sep 2023 14:28:06 -0500 Subject: [PATCH 02/17] fix: flakiness in org.json.junit.JSONObjectTest#valueToString --- build.gradle | 1 + pom.xml | 7 +++++++ src/test/java/org/json/junit/JSONObjectTest.java | 9 +++++---- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 8a3708a..5a5be37 100644 --- a/build.gradle +++ b/build.gradle @@ -23,6 +23,7 @@ dependencies { testImplementation 'junit:junit:4.13.1' testImplementation 'com.jayway.jsonpath:json-path:2.1.0' testImplementation 'org.mockito:mockito-core:4.2.0' + testImplementation 'org.skyscreamer:jsonassert:1.5.1' } subprojects { diff --git a/pom.xml b/pom.xml index 720529c..8bbcc3c 100644 --- a/pom.xml +++ b/pom.xml @@ -72,6 +72,13 @@ 4.2.0 test + + + org.skyscreamer + jsonassert + 1.5.1 + test + diff --git a/src/test/java/org/json/junit/JSONObjectTest.java b/src/test/java/org/json/junit/JSONObjectTest.java index 2de8f81..4eefea8 100644 --- a/src/test/java/org/json/junit/JSONObjectTest.java +++ b/src/test/java/org/json/junit/JSONObjectTest.java @@ -57,6 +57,7 @@ import org.junit.Test; import com.jayway.jsonpath.Configuration; import com.jayway.jsonpath.JsonPath; +import org.skyscreamer.jsonassert.JSONAssert; /** * JSONObject, along with JSONArray, are the central classes of the reference app. @@ -2025,8 +2026,8 @@ public class JSONObjectTest { "\"key3\":\"val3\""+ "}"; JSONObject jsonObject = new JSONObject(jsonObjectStr); - assertTrue("jsonObject valueToString() incorrect", - JSONObject.valueToString(jsonObject).equals(jsonObject.toString())); + JSONAssert.assertEquals("jsonObject valueToString() incorrect", + JSONObject.valueToString(jsonObject), jsonObject.toString(), false); String jsonArrayStr = "[1,2,3]"; JSONArray jsonArray = new JSONArray(jsonArrayStr); @@ -2036,8 +2037,8 @@ public class JSONObjectTest { map.put("key1", "val1"); map.put("key2", "val2"); map.put("key3", "val3"); - assertTrue("map valueToString() incorrect", - jsonObject.toString().equals(JSONObject.valueToString(map))); + JSONAssert.assertEquals("map valueToString() incorrect", + jsonObject.toString(), JSONObject.valueToString(map), false); Collection collection = new ArrayList(); collection.add(Integer.valueOf(1)); collection.add(Integer.valueOf(2)); From e4aa7f1308722b1283fc828dcb2326915a5d29da Mon Sep 17 00:00:00 2001 From: simonh5 Date: Thu, 12 Oct 2023 21:09:27 -0500 Subject: [PATCH 03/17] fix: change from JSONAssert to checking the similarity of JSONObjects --- src/test/java/org/json/junit/JSONMLTest.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/test/java/org/json/junit/JSONMLTest.java b/src/test/java/org/json/junit/JSONMLTest.java index 9b5e5b6..4d36498 100644 --- a/src/test/java/org/json/junit/JSONMLTest.java +++ b/src/test/java/org/json/junit/JSONMLTest.java @@ -8,7 +8,6 @@ import static org.junit.Assert.*; import org.json.*; import org.junit.Test; -import org.skyscreamer.jsonassert.JSONAssert; /** * Tests for org.json.JSONML.java @@ -763,8 +762,7 @@ public class JSONMLTest { final String xml = JSONML.toString(originalObject); final JSONObject revertedObject = JSONML.toJSONObject(xml, false); final String newJson = revertedObject.toString(); - assertTrue("JSON Objects are not similar",originalObject.similar(revertedObject)); - JSONAssert.assertEquals("original JSON does not equal the new JSON", originalJson, newJson, false); + assertTrue("original JSON does not equal the new JSON", originalObject.similar(revertedObject)); } // these tests do not pass for the following reasons: From 29a7f4622d887a90e15d719f88fad770b523ed69 Mon Sep 17 00:00:00 2001 From: simonh5 Date: Fri, 13 Oct 2023 20:58:50 -0500 Subject: [PATCH 04/17] remove JSONAssert --- build.gradle | 1 - pom.xml | 7 ------- src/test/java/org/json/junit/JSONMLTest.java | 3 ++- src/test/java/org/json/junit/JSONObjectTest.java | 12 +++++++----- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/build.gradle b/build.gradle index 5a5be37..8a3708a 100644 --- a/build.gradle +++ b/build.gradle @@ -23,7 +23,6 @@ dependencies { testImplementation 'junit:junit:4.13.1' testImplementation 'com.jayway.jsonpath:json-path:2.1.0' testImplementation 'org.mockito:mockito-core:4.2.0' - testImplementation 'org.skyscreamer:jsonassert:1.5.1' } subprojects { diff --git a/pom.xml b/pom.xml index 8bbcc3c..720529c 100644 --- a/pom.xml +++ b/pom.xml @@ -72,13 +72,6 @@ 4.2.0 test - - - org.skyscreamer - jsonassert - 1.5.1 - test - diff --git a/src/test/java/org/json/junit/JSONMLTest.java b/src/test/java/org/json/junit/JSONMLTest.java index 4d36498..154af64 100644 --- a/src/test/java/org/json/junit/JSONMLTest.java +++ b/src/test/java/org/json/junit/JSONMLTest.java @@ -762,7 +762,8 @@ public class JSONMLTest { final String xml = JSONML.toString(originalObject); final JSONObject revertedObject = JSONML.toJSONObject(xml, false); final String newJson = revertedObject.toString(); - assertTrue("original JSON does not equal the new JSON", originalObject.similar(revertedObject)); + assertTrue("JSON Objects are not similar", originalObject.similar(revertedObject)); + assertTrue("JSON Strings are not similar", new JSONObject(originalJson).similar(new JSONObject(newJson))); } // these tests do not pass for the following reasons: diff --git a/src/test/java/org/json/junit/JSONObjectTest.java b/src/test/java/org/json/junit/JSONObjectTest.java index 4eefea8..ac9a287 100644 --- a/src/test/java/org/json/junit/JSONObjectTest.java +++ b/src/test/java/org/json/junit/JSONObjectTest.java @@ -57,7 +57,6 @@ import org.junit.Test; import com.jayway.jsonpath.Configuration; import com.jayway.jsonpath.JsonPath; -import org.skyscreamer.jsonassert.JSONAssert; /** * JSONObject, along with JSONArray, are the central classes of the reference app. @@ -2026,8 +2025,10 @@ public class JSONObjectTest { "\"key3\":\"val3\""+ "}"; JSONObject jsonObject = new JSONObject(jsonObjectStr); - JSONAssert.assertEquals("jsonObject valueToString() incorrect", - JSONObject.valueToString(jsonObject), jsonObject.toString(), false); + assertTrue("jsonObject valueToString() incorrect", + new JSONObject(JSONObject.valueToString(jsonObject)) + .similar(new JSONObject(jsonObject.toString())) + ); String jsonArrayStr = "[1,2,3]"; JSONArray jsonArray = new JSONArray(jsonArrayStr); @@ -2037,8 +2038,9 @@ public class JSONObjectTest { map.put("key1", "val1"); map.put("key2", "val2"); map.put("key3", "val3"); - JSONAssert.assertEquals("map valueToString() incorrect", - jsonObject.toString(), JSONObject.valueToString(map), false); + assertTrue("map valueToString() incorrect", + new JSONObject(jsonObject.toString()) + .similar(new JSONObject(JSONObject.valueToString(map)))); Collection collection = new ArrayList(); collection.add(Integer.valueOf(1)); collection.add(Integer.valueOf(2)); From 4dfd779b1c84e66e03e9ff13b46b238fd9dc72ea Mon Sep 17 00:00:00 2001 From: simonh5 Date: Sat, 14 Oct 2023 17:21:06 -0500 Subject: [PATCH 05/17] fix: flakiness in org.json.junit.XMLTest#testIndentComplicatedJsonObjectWithArrayAndWithConfig --- src/test/java/org/json/junit/XMLTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/org/json/junit/XMLTest.java b/src/test/java/org/json/junit/XMLTest.java index 22d6131..2399b81 100644 --- a/src/test/java/org/json/junit/XMLTest.java +++ b/src/test/java/org/json/junit/XMLTest.java @@ -1234,7 +1234,7 @@ public class XMLTest { for (int numRead; (numRead = in.read(buffer, 0, buffer.length)) > 0; ) { expected.append(buffer, 0, numRead); } - assertEquals(expected.toString(), actualString); + assertTrue(XML.toJSONObject(expected.toString()).similar(XML.toJSONObject(actualString))); } } catch (IOException e) { fail("file writer error: " +e.getMessage()); From 8540bb80c07eabe021ecbefce242cb83b6fa4c32 Mon Sep 17 00:00:00 2001 From: "John J. Aylward" Date: Sun, 15 Oct 2023 20:14:44 -0400 Subject: [PATCH 06/17] Validate that the `mvn package` step completes --- .github/workflows/pipeline.yml | 4 +++- pom.xml | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 5e1dd42..797b9a2 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -1,5 +1,5 @@ # This workflow will build a Java project with Maven -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# For more information see: https://docs.github.com/en/actions/learn-github-actions or https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions name: Java CI with Maven @@ -47,3 +47,5 @@ jobs: with: name: Test Report ${{ matrix.java }} path: target/site/ + - name: Package Jar ${{ matrix.java }} + run: mvn clean package -Dmaven.compiler.source=${{ matrix.java }} -Dmaven.compiler.target=${{ matrix.java }} -Dmaven.test.skip=true -Dmaven.site.skip=true diff --git a/pom.xml b/pom.xml index 77bbdac..2b3c8b2 100644 --- a/pom.xml +++ b/pom.xml @@ -52,7 +52,6 @@ UTF-8 - junit From 134074aeaa8ae47c9782e1e84e19682bd93599ee Mon Sep 17 00:00:00 2001 From: "John J. Aylward" Date: Sun, 15 Oct 2023 20:19:58 -0400 Subject: [PATCH 07/17] Revert "Reverting #761" This reverts commit b180dbedbc99bb177e5b277f1bff2a1b79cebda6. --- pom.xml | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 2b3c8b2..6812073 100644 --- a/pom.xml +++ b/pom.xml @@ -158,17 +158,35 @@ false + + org.moditect + moditect-maven-plugin + 1.0.0.Final + + + add-module-infos + package + + add-module-info + + + 9 + + + org.json + + org.json; + + + + + + + org.apache.maven.plugins maven-jar-plugin 3.3.0 - - - - org.json - - - From 9a9efac2af7068940173bf20efce9419e5206efa Mon Sep 17 00:00:00 2001 From: "John J. Aylward" Date: Mon, 16 Oct 2023 13:16:27 -0400 Subject: [PATCH 08/17] Correct moditect configuration to work on java8 --- .gitignore | 2 ++ pom.xml | 11 +++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 7794c4c..b78af4d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ # ignore eclipse project files .project .classpath +# ignore vscode files +.vscode # ignore Intellij Idea project files .idea *.iml diff --git a/pom.xml b/pom.xml index 6812073..80c111d 100644 --- a/pom.xml +++ b/pom.xml @@ -172,12 +172,11 @@ 9 - - org.json - - org.json; - - + + module org.json { + exports org.json; + } + From 2b41cf44b52b25cae7c189b54f9bab87ff47eda6 Mon Sep 17 00:00:00 2001 From: "John J. Aylward" Date: Mon, 16 Oct 2023 13:24:40 -0400 Subject: [PATCH 09/17] include jar in job artifacts --- .github/workflows/pipeline.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 797b9a2..59a7658 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -37,15 +37,21 @@ jobs: mvn site -DgenerateReports=false -Dmaven.compiler.source=${{ matrix.java }} -Dmaven.compiler.target=${{ matrix.java }} - name: Upload Test Results ${{ matrix.java }} if: ${{ always() }} - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 with: name: Test Results ${{ matrix.java }} path: target/surefire-reports/ - name: Upload Test Report ${{ matrix.java }} if: ${{ always() }} - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 with: name: Test Report ${{ matrix.java }} path: target/site/ - name: Package Jar ${{ matrix.java }} run: mvn clean package -Dmaven.compiler.source=${{ matrix.java }} -Dmaven.compiler.target=${{ matrix.java }} -Dmaven.test.skip=true -Dmaven.site.skip=true + - name: Upload Package Results ${{ matrix.java }} + if: ${{ always() }} + uses: actions/upload-artifact@v3 + with: + name: Package Jar ${{ matrix.java }} + path: target/*.jar From be115059e9455d5f434027204b6fe02d4c6b07a9 Mon Sep 17 00:00:00 2001 From: "John J. Aylward" Date: Mon, 16 Oct 2023 13:19:16 -0400 Subject: [PATCH 10/17] Correct supported java versions --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9f01342..cd856ab 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Project goals include: * No external dependencies * Fast execution and low memory footprint * Maintain backward compatibility -* Designed and tested to use on Java versions 1.6 - 1.11 +* Designed and tested to use on Java versions 1.8 - 17 The files in this package implement JSON encoders and decoders. The package can also convert between JSON and XML, HTTP headers, Cookies, and CDL. From 3894483560216341ea4c9b58ac6c06ab19f6dc4d Mon Sep 17 00:00:00 2001 From: "John J. Aylward" Date: Mon, 16 Oct 2023 15:30:55 -0400 Subject: [PATCH 11/17] Add build badges to README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index cd856ab..32b59bb 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ JSON in Java [package org.json] =============================== [![Maven Central](https://img.shields.io/maven-central/v/org.json/json.svg)](https://mvnrepository.com/artifact/org.json/json) +[![Java CI with Maven](https://github.com/stleary/JSON-java/actions/workflows/pipeline.yml/badge.svg)](https://github.com/stleary/JSON-java/actions/workflows/pipeline.yml) +[![CodeQL](https://github.com/stleary/JSON-java/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/stleary/JSON-java/actions/workflows/codeql-analysis.yml) **[Click here if you just want the latest release jar file.](https://search.maven.org/remotecontent?filepath=org/json/json/20231013/json-20231013.jar)** From 7c4f98c42c5d1ee27d6ce73c9bd0e4e5e3f4aea2 Mon Sep 17 00:00:00 2001 From: "John J. Aylward" Date: Mon, 16 Oct 2023 17:30:57 -0400 Subject: [PATCH 12/17] Add new deployment pipeline. This should only trigger when a release is published --- .github/workflows/deployment.yml | 40 ++++++++++++++++++++++++++++++++ pom.xml | 7 ++++++ 2 files changed, 47 insertions(+) create mode 100644 .github/workflows/deployment.yml diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml new file mode 100644 index 0000000..d69b478 --- /dev/null +++ b/.github/workflows/deployment.yml @@ -0,0 +1,40 @@ +# For more information see: https://docs.github.com/en/actions/learn-github-actions or https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions + +name: Deployment workflow + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v4 + - name: Set up Java for publishing to Maven Central Repository + uses: actions/setup-java@v3 + with: + # Use lowest supported LTS Java version + java-version: '8' + distribution: 'temurin' + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + - name: Publish to the Maven Central Repository + run: mvn --batch-mode deploy + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + # - name: Set up Java for publishing to GitHub Packages + # uses: actions/setup-java@v3 + # with: + # # Use lowest supported LTS Java version + # java-version: '8' + # distribution: 'temurin' + # - name: Publish to GitHub Packages + # run: mvn --batch-mode deploy + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/pom.xml b/pom.xml index 77bbdac..fb983f0 100644 --- a/pom.xml +++ b/pom.xml @@ -52,6 +52,13 @@ UTF-8 + + + ossrh + Central Repository OSSRH + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + From a86786a5f5c40701b053a6f1b88cd1af3bcaa053 Mon Sep 17 00:00:00 2001 From: "John J. Aylward" Date: Mon, 16 Oct 2023 18:03:39 -0400 Subject: [PATCH 13/17] Add snapshot repository --- pom.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pom.xml b/pom.xml index fb983f0..fae575b 100644 --- a/pom.xml +++ b/pom.xml @@ -58,6 +58,10 @@ Central Repository OSSRH https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + From ed183e61427589dea729c42be519ce75437b1dc0 Mon Sep 17 00:00:00 2001 From: "John J. Aylward" Date: Mon, 16 Oct 2023 18:22:08 -0400 Subject: [PATCH 14/17] remove deprecated parent pom per Sonatype docs --- pom.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pom.xml b/pom.xml index fae575b..7b77542 100644 --- a/pom.xml +++ b/pom.xml @@ -21,12 +21,6 @@ https://github.com/douglascrockford/JSON-java - - org.sonatype.oss - oss-parent - 9 - - https://github.com/douglascrockford/JSON-java.git scm:git:git://github.com/douglascrockford/JSON-java.git From e8f125fb6ea827448408698b1a50a61984cea6b3 Mon Sep 17 00:00:00 2001 From: "John J. Aylward" Date: Mon, 16 Oct 2023 18:22:22 -0400 Subject: [PATCH 15/17] update workflow to use GPG --- .github/workflows/deployment.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index d69b478..54457d9 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -1,4 +1,8 @@ -# For more information see: https://docs.github.com/en/actions/learn-github-actions or https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions +# For more information see: +# * https://docs.github.com/en/actions/learn-github-actions +# * https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions +# * https://github.com/actions/setup-java/blob/v3.13.0/docs/advanced-usage.md#Publishing-using-Apache-Maven +# name: Deployment workflow @@ -20,14 +24,18 @@ jobs: # Use lowest supported LTS Java version java-version: '8' distribution: 'temurin' - server-id: ossrh - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD + server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml + server-username: MAVEN_USERNAME # env variable for username in deploy + server-password: MAVEN_PASSWORD # env variable for token in deploy + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import + gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase + - name: Publish to the Maven Central Repository run: mvn --batch-mode deploy env: MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} # - name: Set up Java for publishing to GitHub Packages # uses: actions/setup-java@v3 # with: From f074bed732dbccccf7e4dd2b4414790249358ffd Mon Sep 17 00:00:00 2001 From: theKnightsOfRohan Date: Mon, 16 Oct 2023 17:48:03 -0700 Subject: [PATCH 16/17] fix(ParserConfiguration): add params to docs --- src/main/java/org/json/ParserConfiguration.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/json/ParserConfiguration.java b/src/main/java/org/json/ParserConfiguration.java index 519e209..36fa508 100644 --- a/src/main/java/org/json/ParserConfiguration.java +++ b/src/main/java/org/json/ParserConfiguration.java @@ -71,7 +71,8 @@ public class ParserConfiguration { * * @param newVal * new value to use for the keepStrings configuration option. - * + * @param the type of the configuration object + * * @return The existing configuration will not be modified. A new configuration is returned. */ public T withKeepStrings(final boolean newVal) { @@ -96,6 +97,8 @@ public class ParserConfiguration { * Using any negative value as a parameter is equivalent to setting no limit to the nesting depth, * which means the parses will go as deep as the maximum call stack size allows. * @param maxNestingDepth the maximum nesting depth allowed to the XML parser + * @param the type of the configuration object + * * @return The existing configuration will not be modified. A new configuration is returned. */ public T withMaxNestingDepth(int maxNestingDepth) { From de745e9c810c2d121437aee492624d928e6f71a0 Mon Sep 17 00:00:00 2001 From: Yeikel Date: Mon, 16 Oct 2023 12:38:42 -0400 Subject: [PATCH 17/17] ci: test with Java 21 --- .github/workflows/pipeline.yml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 5e1dd42..8b4c87e 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: # build against supported Java LTS versions: - java: [ 8, 11, 17 ] + java: [ 8, 11, 17, 21 ] name: Java ${{ matrix.java }} steps: - uses: actions/checkout@v3 diff --git a/README.md b/README.md index 9f01342..a351a48 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Project goals include: * No external dependencies * Fast execution and low memory footprint * Maintain backward compatibility -* Designed and tested to use on Java versions 1.6 - 1.11 +* Designed and tested to use on Java versions 1.8 - 21 The files in this package implement JSON encoders and decoders. The package can also convert between JSON and XML, HTTP headers, Cookies, and CDL.