Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: stleary/JSON-java
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 20230618
Choose a base ref
...
head repository: stleary/JSON-java
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 20231013
Choose a head ref

Commits on Jun 26, 2023

  1. Correction of bug when compiling/testing on Windows: Issue537 file mu…

    …st be read as UTF-8 (Issue 745)
    dburbrid authored and dburbrid committed Jun 26, 2023
    Copy the full SHA
    3d52434 View commit details

Commits on Jun 29, 2023

  1. Merge pull request #752 from davejbur/issue-745-compile-error

    Correction of bug when compiling/testing on Windows
    stleary authored Jun 29, 2023
    Copy the full SHA
    8ce0019 View commit details
  2. Renamed object methods from ...Obj to ...Object.

    Added object method for optDoubleObject (returns Double vice double).
    Added similar methods in JSONArray.
    Added test methods.
    dburbrid authored and dburbrid committed Jun 29, 2023
    Copy the full SHA
    4951ec4 View commit details

Commits on Jul 15, 2023

  1. Merge pull request #753 from davejbur/add-object-methods-and-test

    Updated new object methods
    stleary authored Jul 15, 2023
    Copy the full SHA
    402db6a View commit details

Commits on Aug 1, 2023

  1. 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.
    eamonnmcmanus committed Aug 1, 2023
    Copy the full SHA
    c8a9e15 View commit details
  2. Copy the full SHA
    b6ff0db View commit details
  3. Copy the full SHA
    2a4bc34 View commit details

Commits on Aug 5, 2023

  1. Merge pull request #759 from eamonnmcmanus/eofnull

    JSON parsing should detect embedded `\0` values
    stleary authored Aug 5, 2023
    Copy the full SHA
    60662e2 View commit details

Commits on Aug 16, 2023

  1. Copy the full SHA
    b2943eb View commit details
  2. Copy the full SHA
    50dfcc5 View commit details

Commits on Aug 28, 2023

  1. Copy the full SHA
    e563dbc View commit details
  2. Updated mockito

    javadev committed Aug 28, 2023
    Copy the full SHA
    bae0b0d View commit details
  3. Correction of bug when compiling/testing on Windows: Issue537 file mu…

    …st be read as UTF-8 (Issue 745)
    dburbrid authored and javadev committed Aug 28, 2023
    Copy the full SHA
    3dd8f2e View commit details
  4. Update pipeline.yml

    javadev committed Aug 28, 2023
    Copy the full SHA
    a4e152f View commit details
  5. Update pipeline.yml

    javadev committed Aug 28, 2023
    Copy the full SHA
    48089a4 View commit details
  6. Update README.md

    javadev committed Aug 28, 2023
    Copy the full SHA
    be33deb View commit details
  7. Update pipeline.yml

    javadev committed Aug 28, 2023
    Copy the full SHA
    2c674be View commit details
  8. update CodeQL action version

    John J. Aylward committed Aug 28, 2023
    Copy the full SHA
    9b69ec4 View commit details

Commits on Aug 29, 2023

  1. Merge pull request #764 from johnjaylward/CodeQl_Pipeline_Update

    Update CodeQL action version
    stleary authored Aug 29, 2023
    Copy the full SHA
    6409336 View commit details
  2. Copy the full SHA
    af6d07c View commit details
  3. Update build.gradle

    javadev authored Aug 29, 2023
    Copy the full SHA
    e27da22 View commit details

Commits on Sep 3, 2023

  1. Merge pull request #761 from bowbahdoe/master

    Add module-info
    stleary authored Sep 3, 2023
    Copy the full SHA
    a309931 View commit details
  2. Copy the full SHA
    db122e5 View commit details
  3. Update CONTRIBUTING.md

    Updated for Hacktoberfest 2023
    stleary authored Sep 3, 2023
    Copy the full SHA
    7c1b653 View commit details
  4. Merge pull request #741 from jscrdev/setup-java-11

    Configure Java 8 as the minimum required version
    stleary authored Sep 3, 2023
    Copy the full SHA
    c29d488 View commit details

Commits on Sep 8, 2023

  1. Addressed compile warnings

    javadev committed Sep 8, 2023
    Copy the full SHA
    74cd73f View commit details

Commits on Sep 16, 2023

  1. Merge pull request #769 from jscrdev/fixed-warnings

    Addressed Java 17 compile warnings
    stleary authored Sep 16, 2023
    Copy the full SHA
    01727fd View commit details

Commits on Sep 19, 2023

  1. Small test fixes.

    One test method was missing `@Test` so it was never run.
    
    One test method used another test class as the base for finding a test
    resource. While this works in practice with Maven, it is not strictly
    right.
    eamonnmcmanus committed Sep 19, 2023
    Copy the full SHA
    3e688af View commit details

Commits on Sep 20, 2023

  1. Copy the full SHA
    661114c View commit details

Commits on Sep 25, 2023

  1. Copy the full SHA
    db0fde2 View commit details

Commits on Sep 26, 2023

  1. Merge pull request #770 from eamonnmcmanus/testfixes

    Small test fixes.
    stleary authored Sep 26, 2023
    Copy the full SHA
    4e8231c View commit details

Commits on Sep 27, 2023

  1. Copy the full SHA
    284a316 View commit details
  2. 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.
    eamonnmcmanus committed Sep 27, 2023
    Copy the full SHA
    16967f3 View commit details

Commits on Sep 28, 2023

  1. Copy the full SHA
    dbb1131 View commit details
  2. Copy the full SHA
    eaa5611 View commit details

Commits on Sep 30, 2023

  1. Merge pull request #773 from eedijs/master

    Add optJSONArray method to JSONObject with a default value
    stleary authored Sep 30, 2023
    Copy the full SHA
    ef68cdf View commit details
  2. Copy the full SHA
    61bb60e View commit details
  3. Junit 4.13.2

    mccartney committed Sep 30, 2023
    Copy the full SHA
    ff921db View commit details

Commits on Oct 1, 2023

  1. Merge pull request #772 from eamonnmcmanus/complexkey

    Disallow nested objects and arrays as keys in objects.
    stleary authored Oct 1, 2023
    Copy the full SHA
    beb2fb5 View commit details

Commits on Oct 4, 2023

  1. Merge pull request #776 from mccartney/junit-4-13-2

    JUnit 4.13.2
    stleary authored Oct 4, 2023
    Copy the full SHA
    1726b6c View commit details
  2. Merge pull request #774 from mccartney/removing-synchronized

    Removing excessive synchronization
    stleary authored Oct 4, 2023
    Copy the full SHA
    79af389 View commit details

Commits on Oct 5, 2023

  1. Fix XMLTest on Windows

    XMLTest.testIndentComplicatedJsonObjectWithArrayAndWithConfig fails
    when run on Windows due to mismatching linebreaks (that aren't
    important for the test's functionality) between the actual and
    expected strings.
    
    For the actual strings, linebreaks are canonized to the platform's
    native linebreak using `replaceAll("\\n|\\r\\n",
    System.getProperty("line.separator")`. However, the expected result is
    read from a file, and is left with the linebreaks that were originally
    used to create it.
    
    The solution is to perform the same canonization on both strings.
    
    Closes #781
    mureinik committed Oct 5, 2023
    Copy the full SHA
    fe45fa9 View commit details
  2. Use System.lineSeparator()

    Use the built-in System.lineSeparator() instead of implementing it
    ourselves with System.getProperty("line.separator") in order to clean
    up the code and make it easier to maintain.
    mureinik committed Oct 5, 2023
    Copy the full SHA
    4c8cac2 View commit details

Commits on Oct 6, 2023

  1. #653 - optLong vs getLong inconsistencies

    For exponential decimal conversion, number is not touched.
    Leading zeros removed from numeric number strings before converting to number.
    rudrajyotib committed Oct 6, 2023
    Copy the full SHA
    1a38879 View commit details

Commits on Oct 7, 2023

  1. Copy the full SHA
    0e4a94d View commit details
  2. add validity check for JSONObject constructors

    * fixes #713
    * document JSONException in JavaDoc
    * remove unused Comparable<T> boundary to reuse GenericBean in test
    Madjosz committed Oct 7, 2023
    Copy the full SHA
    c93014c View commit details

Commits on Oct 8, 2023

  1. Merge pull request #782 from mureinik/XMLTest-windows

    Fix XMLTest.testIndentComplicatedJsonObjectWithArrayAndWithConfig() for Windows - in the test
    stleary authored Oct 8, 2023
    Copy the full SHA
    bc09f90 View commit details
  2. Copy the full SHA
    fb99c06 View commit details
  3. Merge pull request #778 from Madjosz/fix_xml_test

    Fix XMLTest.testIndentComplicatedJsonObjectWithArrayAndWithConfig() for Windows - in the test
    stleary authored Oct 8, 2023
    Copy the full SHA
    776b5cc View commit details
  4. Merge pull request #779 from Madjosz/713_jsonobject_nonfinite

    add validity check for JSONObject constructors
    stleary authored Oct 8, 2023
    Copy the full SHA
    c4cd526 View commit details
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -25,11 +25,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -40,4 +40,4 @@ jobs:
- run: "mvn clean compile -Dmaven.test.skip=true -Dmaven.site.skip=true -Dmaven.javadoc.skip=true"

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
37 changes: 6 additions & 31 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -10,46 +10,21 @@ on:
branches: [ master ]

jobs:
# old-school build and jar method. No tests run or compiled.
build-1_6:
runs-on: ubuntu-latest
strategy:
matrix:
# build for java 1.6, however don't run any tests
java: [ 1.6 ]
name: Java ${{ matrix.java }}
steps:
- uses: actions/checkout@v2
- name: Setup java
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Compile Java ${{ matrix.java }}
run: |
mkdir -p target/classes
javac -d target/classes/ src/main/java/org/json/*.java
- name: Create java ${{ matrix.java }} JAR
run: |
jar cvf target/org.json.jar -C target/classes .
- name: Upload Java ${{ matrix.java }} JAR
uses: actions/upload-artifact@v1
with:
name: Java ${{ matrix.java }} JAR
path: target/org.json.jar

build:
runs-on: ubuntu-latest
strategy:
matrix:
# build against supported Java LTS versions:
java: [ 8, 11 ]
java: [ 8, 11, 17 ]
name: Java ${{ matrix.java }}
steps:
- uses: actions/checkout@v2
- name: Setup java
uses: actions/setup-java@v1
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'maven'
- name: Compile Java ${{ matrix.java }}
run: mvn clean compile -Dmaven.compiler.source=${{ matrix.java }} -Dmaven.compiler.target=${{ matrix.java }} -Dmaven.test.skip=true -Dmaven.site.skip=true -Dmaven.javadoc.skip=true
- name: Run Tests ${{ matrix.java }}
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Contribution Guidelines

Feel free to work on any issue with a #hacktoberfest label.
Feel free to work on any open issue, you don't need to ask permission first. This year, the hacktoberfest label will be added to any PR and associated issue during the month of October.

If you discover an issue you would like to work on, you can add a new issue to the list. If it meets our criteria, a hacktoberfest label will be added.
If you discover an issue you would like to work on, you can add a new issue to the list. If it meets our criteria, it will be available to work on (if not, it will be closed after review).

# Who is allowed to submit pull requests for this project?

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ 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)

**[Click here if you just want the latest release jar file.](https://search.maven.org/remotecontent?filepath=org/json/json/20230618/json-20230618.jar)**
**[Click here if you just want the latest release jar file.](https://search.maven.org/remotecontent?filepath=org/json/json/20231013/json-20231013.jar)**


# Overview
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -20,19 +20,19 @@ repositories {
}

dependencies {
testImplementation 'junit:junit:4.13.1'
testImplementation 'junit:junit:4.13.2'
testImplementation 'com.jayway.jsonpath:json-path:2.1.0'
testImplementation 'org.mockito:mockito-core:1.9.5'
testImplementation 'org.mockito:mockito-core:4.2.0'
}

subprojects {
tasks.withType(Javadoc).all { enabled = false }
}

group = 'org.json'
version = 'v20211205-SNAPSHOT'
version = 'v20230618-SNAPSHOT'
description = 'JSON in Java'
sourceCompatibility = '1.7'
sourceCompatibility = '1.8'

configurations.all {
}
2 changes: 2 additions & 0 deletions docs/RELEASES.md
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@ and artifactId "json". For example:
[https://search.maven.org/search?q=g:org.json%20AND%20a:json&core=gav](https://search.maven.org/search?q=g:org.json%20AND%20a:json&core=gav)

~~~
20231013 First release with minimum Java version 1.8. Recent commits, including fixes for CVE-2023-5072.
20230618 Final release with Java 1.6 compatibility. Future releases will require Java 1.8 or greater.
20230227 Fix for CVE-2022-45688 and recent commits
24 changes: 12 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@

<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20230618</version>
<version>20231013</version>
<packaging>bundle</packaging>

<name>JSON in Java</name>
@@ -15,7 +15,7 @@
It also includes the capability to convert between JSON and XML, HTTP
headers, Cookies, and CDL.

This is a reference implementation. There is a large number of JSON packages
This is a reference implementation. There are a large number of JSON packages
in Java. Perhaps someday the Java community will standardize on one. Until
then, choose carefully.
</description>
@@ -57,7 +57,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -69,7 +69,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.9.5</version>
<version>4.2.0</version>
<scope>test</scope>
</dependency>
</dependencies>
@@ -79,7 +79,7 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>3.0.1</version>
<version>5.1.9</version>
<extensions>true</extensions>
<configuration>
<instructions>
@@ -93,16 +93,16 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<version>3.11.0</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
<version>3.3.0</version>
<executions>
<execution>
<id>attach-sources</id>
@@ -115,7 +115,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.7</version>
<version>3.5.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
@@ -131,7 +131,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
@@ -162,7 +162,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
<configuration>
<archive>
<manifestEntries>
Loading