Skip to content

Commit

Permalink
fix MalformedJsonException #128
Browse files Browse the repository at this point in the history
  • Loading branch information
EcljpseB0T authored and jukzi committed Jun 9, 2023
1 parent b04f250 commit 4a5a3c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion org.eclipse.tips.json/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.tips.json;singleton:=true
Bundle-Version: 0.3.0.qualifier
Bundle-Version: 0.3.100.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-17
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.0.0",
com.google.gson,
org.eclipse.tips.core;bundle-version="0.1.0"
Export-Package: org.eclipse.tips.json,
org.eclipse.tips.json.internal;x-internal:=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.stream.JsonReader;

/**
* A special TipProvider that gets instantiated from a JSon file.
Expand Down Expand Up @@ -110,7 +111,9 @@ private JsonObject loadJsonObject() throws IOException {
// Json MUST be encoded as UTF-8, unless in a closed system.
try (InputStream stream = fJsonUrl.openStream();
InputStreamReader reader = new InputStreamReader(stream, StandardCharsets.UTF_8)) {
Object result = JsonParser.parseReader(reader);
JsonReader jreader = new JsonReader(reader);
jreader.setLenient(true);
Object result = JsonParser.parseReader(jreader);
if (result instanceof JsonObject) {
return (JsonObject) result;
} else {
Expand Down

0 comments on commit 4a5a3c9

Please sign in to comment.