Skip to content

Commit 312f751

Browse files
committed
JsonReader.setStrictness(Strictness.LENIENT) instead of setLenient(true)
- JsonReader.setLenient latter is deprecated in 2.11.0 and setStrictness is new to 2.11.0.
1 parent 3a4f6ff commit 312f751

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ua/org.eclipse.tips.json/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.29.0",
1010
Export-Package: org.eclipse.tips.json,
1111
org.eclipse.tips.json.internal;x-internal:=true
1212
Automatic-Module-Name: org.eclipse.tips.json
13-
Import-Package: com.google.gson;version="[2.8.6,3.0.0)"
13+
Import-Package: com.google.gson;version="[2.11.0,3.0.0)"
1414
Bundle-Vendor: %Bundle-Vendor

ua/org.eclipse.tips.json/src/org/eclipse/tips/json/JsonTipProvider.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import com.google.gson.JsonElement;
4242
import com.google.gson.JsonObject;
4343
import com.google.gson.JsonParser;
44+
import com.google.gson.Strictness;
4445
import com.google.gson.stream.JsonReader;
4546

4647
/**
@@ -110,7 +111,7 @@ private JsonObject loadJsonObject() throws IOException {
110111
try (InputStream stream = fJsonUrl.openStream();
111112
InputStreamReader reader = new InputStreamReader(stream, StandardCharsets.UTF_8)) {
112113
JsonReader jreader = new JsonReader(reader);
113-
jreader.setLenient(true);
114+
jreader.setStrictness(Strictness.LENIENT);
114115
Object result = JsonParser.parseReader(jreader);
115116
if (result instanceof JsonObject) {
116117
return (JsonObject) result;

0 commit comments

Comments
 (0)