Skip to content

Commit 05b0897

Browse files
authored
Merge branch 'stleary:master' into master
2 parents af8cb37 + f9b5587 commit 05b0897

25 files changed

+445
-668
lines changed

.github/workflows/deployment.yml

Lines changed: 0 additions & 82 deletions
This file was deleted.

.github/workflows/pipeline.yml

Lines changed: 148 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,159 @@ jobs:
3434
with:
3535
name: Create java 1.6 JAR
3636
path: target/*.jar
37-
build:
37+
38+
build-8:
39+
runs-on: ubuntu-latest
40+
strategy:
41+
fail-fast: false
42+
max-parallel: 1
43+
matrix:
44+
# build against supported Java LTS versions:
45+
java: [ 8 ]
46+
name: Java ${{ matrix.java }}
47+
steps:
48+
- uses: actions/checkout@v3
49+
- name: Set up JDK ${{ matrix.java }}
50+
uses: actions/setup-java@v3
51+
with:
52+
distribution: 'temurin'
53+
java-version: ${{ matrix.java }}
54+
cache: 'maven'
55+
- name: Compile Java ${{ matrix.java }}
56+
run: mvn clean compile -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} -D maven.test.skip=true -D maven.site.skip=true -D maven.javadoc.skip=true
57+
- name: Run Tests ${{ matrix.java }}
58+
run: |
59+
mvn test -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }}
60+
- name: Build Test Report ${{ matrix.java }}
61+
if: ${{ always() }}
62+
run: |
63+
mvn surefire-report:report-only -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }}
64+
mvn site -D generateReports=false -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }}
65+
- name: Upload Test Results ${{ matrix.java }}
66+
if: ${{ always() }}
67+
uses: actions/upload-artifact@v3
68+
with:
69+
name: Test Results ${{ matrix.java }}
70+
path: target/surefire-reports/
71+
- name: Upload Test Report ${{ matrix.java }}
72+
if: ${{ always() }}
73+
uses: actions/upload-artifact@v3
74+
with:
75+
name: Test Report ${{ matrix.java }}
76+
path: target/site/
77+
- name: Package Jar ${{ matrix.java }}
78+
run: mvn clean package -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} -D maven.test.skip=true -D maven.site.skip=true
79+
- name: Upload Package Results ${{ matrix.java }}
80+
if: ${{ always() }}
81+
uses: actions/upload-artifact@v3
82+
with:
83+
name: Package Jar ${{ matrix.java }}
84+
path: target/*.jar
85+
86+
build-11:
87+
runs-on: ubuntu-latest
88+
strategy:
89+
fail-fast: false
90+
max-parallel: 1
91+
matrix:
92+
# build against supported Java LTS versions:
93+
java: [ 11 ]
94+
name: Java ${{ matrix.java }}
95+
steps:
96+
- uses: actions/checkout@v3
97+
- name: Set up JDK ${{ matrix.java }}
98+
uses: actions/setup-java@v3
99+
with:
100+
distribution: 'temurin'
101+
java-version: ${{ matrix.java }}
102+
cache: 'maven'
103+
- name: Compile Java ${{ matrix.java }}
104+
run: mvn clean compile -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} -D maven.test.skip=true -D maven.site.skip=true -D maven.javadoc.skip=true
105+
- name: Run Tests ${{ matrix.java }}
106+
run: |
107+
mvn test -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }}
108+
- name: Build Test Report ${{ matrix.java }}
109+
if: ${{ always() }}
110+
run: |
111+
mvn surefire-report:report-only -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }}
112+
mvn site -D generateReports=false -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }}
113+
- name: Upload Test Results ${{ matrix.java }}
114+
if: ${{ always() }}
115+
uses: actions/upload-artifact@v3
116+
with:
117+
name: Test Results ${{ matrix.java }}
118+
path: target/surefire-reports/
119+
- name: Upload Test Report ${{ matrix.java }}
120+
if: ${{ always() }}
121+
uses: actions/upload-artifact@v3
122+
with:
123+
name: Test Report ${{ matrix.java }}
124+
path: target/site/
125+
- name: Package Jar ${{ matrix.java }}
126+
run: mvn clean package -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} -D maven.test.skip=true -D maven.site.skip=true
127+
- name: Upload Package Results ${{ matrix.java }}
128+
if: ${{ always() }}
129+
uses: actions/upload-artifact@v3
130+
with:
131+
name: Package Jar ${{ matrix.java }}
132+
path: target/*.jar
133+
134+
build-17:
135+
runs-on: ubuntu-latest
136+
strategy:
137+
fail-fast: false
138+
max-parallel: 1
139+
matrix:
140+
# build against supported Java LTS versions:
141+
java: [ 17 ]
142+
name: Java ${{ matrix.java }}
143+
steps:
144+
- uses: actions/checkout@v3
145+
- name: Set up JDK ${{ matrix.java }}
146+
uses: actions/setup-java@v3
147+
with:
148+
distribution: 'temurin'
149+
java-version: ${{ matrix.java }}
150+
cache: 'maven'
151+
- name: Compile Java ${{ matrix.java }}
152+
run: mvn clean compile -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} -D maven.test.skip=true -D maven.site.skip=true -D maven.javadoc.skip=true
153+
- name: Run Tests ${{ matrix.java }}
154+
run: |
155+
mvn test -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }}
156+
- name: Build Test Report ${{ matrix.java }}
157+
if: ${{ always() }}
158+
run: |
159+
mvn surefire-report:report-only -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }}
160+
mvn site -D generateReports=false -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }}
161+
- name: Upload Test Results ${{ matrix.java }}
162+
if: ${{ always() }}
163+
uses: actions/upload-artifact@v3
164+
with:
165+
name: Test Results ${{ matrix.java }}
166+
path: target/surefire-reports/
167+
- name: Upload Test Report ${{ matrix.java }}
168+
if: ${{ always() }}
169+
uses: actions/upload-artifact@v3
170+
with:
171+
name: Test Report ${{ matrix.java }}
172+
path: target/site/
173+
- name: Package Jar ${{ matrix.java }}
174+
run: mvn clean package -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} -D maven.test.skip=true -D maven.site.skip=true
175+
- name: Upload Package Results ${{ matrix.java }}
176+
if: ${{ always() }}
177+
uses: actions/upload-artifact@v3
178+
with:
179+
name: Package Jar ${{ matrix.java }}
180+
path: target/*.jar
181+
182+
build-21:
38183
runs-on: ubuntu-latest
39184
strategy:
40185
fail-fast: false
41-
max-parallel: 2
186+
max-parallel: 1
42187
matrix:
43188
# build against supported Java LTS versions:
44-
java: [ 8, 11, 17, 21 ]
189+
java: [ 21 ]
45190
name: Java ${{ matrix.java }}
46191
steps:
47192
- uses: actions/checkout@v3

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ JSON in Java [package org.json]
1010
[![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)
1111
[![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)
1212

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

1515

1616
# Overview

docs/RELEASES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ and artifactId "json". For example:
55
[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)
66

77
~~~
8+
20240303 Revert optLong/getLong changes, and recent commits.
9+
810
20240205 Recent commits.
911
1012
20231013 First release with minimum Java version 1.8. Recent commits, including fixes for CVE-2023-5072.

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<groupId>org.json</groupId>
55
<artifactId>json</artifactId>
6-
<version>20240205</version>
6+
<version>20240303</version>
77
<packaging>bundle</packaging>
88

99
<name>JSON in Java</name>

src/main/java/org/json/CDL.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
*/
2626
public class CDL {
2727

28+
/**
29+
* Constructs a new CDL object.
30+
*/
31+
public CDL() {
32+
}
33+
2834
/**
2935
* Get the next value. The value can be wrapped in quotes. The value can
3036
* be empty.

src/main/java/org/json/Cookie.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
*/
1616
public class Cookie {
1717

18+
/**
19+
* Constructs a new Cookie object.
20+
*/
21+
public Cookie() {
22+
}
23+
1824
/**
1925
* Produce a copy of a string in which the characters '+', '%', '=', ';'
2026
* and control characters are replaced with "%hh". This is a gentle form

src/main/java/org/json/CookieList.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
*/
1212
public class CookieList {
1313

14+
/**
15+
* Constructs a new CookieList object.
16+
*/
17+
public CookieList() {
18+
}
19+
1420
/**
1521
* Convert a cookie list into a JSONObject. A cookie list is a sequence
1622
* of name/value pairs. The names are separated from the values by '='.

src/main/java/org/json/HTTP.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
*/
1414
public class HTTP {
1515

16+
/**
17+
* Constructs a new HTTP object.
18+
*/
19+
public HTTP() {
20+
}
21+
1622
/** Carriage return/line feed. */
1723
public static final String CRLF = "\r\n";
1824

src/main/java/org/json/JSONArray.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ public Number getNumber(int index) throws JSONException {
360360
if (object instanceof Number) {
361361
return (Number)object;
362362
}
363-
return NumberConversionUtil.stringToNumber(object.toString());
363+
return JSONObject.stringToNumber(object.toString());
364364
} catch (Exception e) {
365365
throw wrongValueFormatException(index, "number", object, e);
366366
}
@@ -1107,7 +1107,7 @@ public Number optNumber(int index, Number defaultValue) {
11071107

11081108
if (val instanceof String) {
11091109
try {
1110-
return NumberConversionUtil.stringToNumber((String) val);
1110+
return JSONObject.stringToNumber((String) val);
11111111
} catch (Exception e) {
11121112
return defaultValue;
11131113
}

0 commit comments

Comments
 (0)