Skip to content

Commit

Permalink
Merge branch 'stleary:master' into fix_xml_test
Browse files Browse the repository at this point in the history
  • Loading branch information
Madjosz committed Oct 7, 2023
2 parents 720c2b0 + 79af389 commit 9294765
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -20,7 +20,7 @@ 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:4.2.0'
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -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>
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/org/json/JSONArray.java
Expand Up @@ -1646,9 +1646,7 @@ public String toString() {
@SuppressWarnings("resource")
public String toString(int indentFactor) throws JSONException {
StringWriter sw = new StringWriter();
synchronized (sw.getBuffer()) {
return this.write(sw, indentFactor, 0).toString();
}
return this.write(sw, indentFactor, 0).toString();
}

/**
Expand Down
16 changes: 6 additions & 10 deletions src/main/java/org/json/JSONObject.java
Expand Up @@ -2183,13 +2183,11 @@ public Object optQuery(JSONPointer jsonPointer) {
@SuppressWarnings("resource")
public static String quote(String string) {
StringWriter sw = new StringWriter();
synchronized (sw.getBuffer()) {
try {
return quote(string, sw).toString();
} catch (IOException ignored) {
// will never happen - we are writing to a string writer
return "";
}
try {
return quote(string, sw).toString();
} catch (IOException ignored) {
// will never happen - we are writing to a string writer
return "";
}
}

Expand Down Expand Up @@ -2576,9 +2574,7 @@ public String toString() {
@SuppressWarnings("resource")
public String toString(int indentFactor) throws JSONException {
StringWriter w = new StringWriter();
synchronized (w.getBuffer()) {
return this.write(w, indentFactor, 0).toString();
}
return this.write(w, indentFactor, 0).toString();
}

/**
Expand Down

0 comments on commit 9294765

Please sign in to comment.