Skip to content

Commit

Permalink
broaden gson range, bundle new gson and guava (#837)
Browse files Browse the repository at this point in the history
Fixes #836

Signed-off-by: Christian Dietrich <[email protected]>
Co-authored-by: Jonah Graham <[email protected]>
  • Loading branch information
cdietrich and jonahgraham committed May 21, 2024
1 parent 96a366a commit a44201f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
3 changes: 2 additions & 1 deletion gradle/versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ version = '0.23.1'
ext.versions = [
'xtend_lib': '2.32.0',
'guava': '[32.1.2,34)',
'gson': '[2.9.1,2.11)',
'gson': '[2.9.1,3.0)',

'websocket_jakarta': '2.0.0',
'websocket': '1.0',
'junit': '4.13.2',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -692,9 +692,9 @@ public void testMalformedJson1() throws Exception {
Launcher<MyClient> serverSideLauncher = Launcher.createLauncher(server, MyClient.class, in, out);
serverSideLauncher.startListening().get(TIMEOUT, TimeUnit.MILLISECONDS);

Assert.assertEquals("Content-Length: 214" + CRLF + CRLF
Assert.assertEquals("Content-Length: 294" + CRLF + CRLF
+ "{\"jsonrpc\":\"2.0\",\"id\":\"1\",\"error\":{\"code\":-32700,\"message\":\"Message could not be parsed.\","
+ "\"data\":{\"message\":\"com.google.gson.stream.MalformedJsonException: Expected value at line 4 column 22 path $.params.value\"}}}"
+ "\"data\":{\"message\":\"com.google.gson.stream.MalformedJsonException: Expected value at line 4 column 22 path $.params.value\\nSee https://github.com/google/gson/blob/main/Troubleshooting.md#malformed-json\"}}}"
+ "Content-Length: 51" + CRLF + CRLF
+ "{\"jsonrpc\":\"2.0\",\"id\":\"2\",\"result\":{\"value\":\"bar\"}}",
out.toString());
Expand Down Expand Up @@ -726,7 +726,8 @@ public void testMalformedJson2() throws Exception {
Launcher<MyClient> serverSideLauncher = Launcher.createLauncher(server, MyClient.class, in, out);
serverSideLauncher.startListening().get(TIMEOUT, TimeUnit.MILLISECONDS);

logMessages.await(Level.SEVERE, "com.google.gson.stream.MalformedJsonException: Expected value at line 2 column 22 path $.params.value");
logMessages.await(Level.SEVERE, "com.google.gson.stream.MalformedJsonException: Expected value at line 2 column 22 path $.params.value\n"
+ "See https://github.com/google/gson/blob/main/Troubleshooting.md#malformed-json");
Assert.assertEquals("Content-Length: 51" + CRLF + CRLF
+ "{\"jsonrpc\":\"2.0\",\"id\":\"2\",\"result\":{\"value\":\"bar\"}}",
out.toString());
Expand Down Expand Up @@ -756,9 +757,9 @@ public void testMalformedJson3() throws Exception {
Launcher<MyClient> serverSideLauncher = Launcher.createLauncher(server, MyClient.class, in, out);
serverSideLauncher.startListening().get(TIMEOUT, TimeUnit.MILLISECONDS);

Assert.assertEquals("Content-Length: 165" + CRLF + CRLF
Assert.assertEquals("Content-Length: 245" + CRLF + CRLF
+ "{\"jsonrpc\":\"2.0\",\"id\":\"1\",\"error\":{\"code\":-32700,\"message\":\"Message could not be parsed.\","
+ "\"data\":{\"message\":\"Unterminated object at line 5 column 2 path $.params\"}}}"
+ "\"data\":{\"message\":\"Unterminated object at line 5 column 2 path $.params\\nSee https://github.com/google/gson/blob/main/Troubleshooting.md#malformed-json\"}}}"
+ "Content-Length: 51" + CRLF + CRLF
+ "{\"jsonrpc\":\"2.0\",\"id\":\"2\",\"result\":{\"value\":\"bar\"}}",
out.toString());
Expand All @@ -785,9 +786,9 @@ public void testMalformedJson4() throws Exception {
Launcher<MyClient> serverSideLauncher = Launcher.createLauncher(server, MyClient.class, in, out);
serverSideLauncher.startListening().get(TIMEOUT, TimeUnit.MILLISECONDS);

Assert.assertEquals("Content-Length: 195" + CRLF + CRLF
Assert.assertEquals("Content-Length: 292" + CRLF + CRLF
+ "{\"jsonrpc\":\"2.0\",\"id\":\"1\",\"error\":{\"code\":-32700,\"message\":\"Message could not be parsed.\","
+ "\"data\":{\"message\":\"Use JsonReader.setLenient(true) to accept malformed JSON at line 5 column 3 path $\"}}}"
+ "\"data\":{\"message\":\"Use JsonReader.setStrictness(Strictness.LENIENT) to accept malformed JSON at line 5 column 3 path $\\nSee https://github.com/google/gson/blob/main/Troubleshooting.md#malformed-json\"}}}"
+ "Content-Length: 51" + CRLF + CRLF
+ "{\"jsonrpc\":\"2.0\",\"id\":\"2\",\"result\":{\"value\":\"bar\"}}",
out.toString());
Expand Down
8 changes: 4 additions & 4 deletions releng/p2/category.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<feature id="org.eclipse.lsp4j.sdk" version="0.23.1.qualifier">
<category name="lsp4j"/>
</feature>
<bundle id="com.google.gson" version="2.10.1.qualifier"/>
<bundle id="com.google.gson.source" version="2.10.1.qualifier"/>
<bundle id="com.google.guava" version="33.0.0.qualifier"/>
<bundle id="com.google.guava.source" version="33.0.0.qualifier"/>
<bundle id="com.google.gson" version="2.11.0.qualifier"/>
<bundle id="com.google.gson.source" version="2.11.0.qualifier"/>
<bundle id="com.google.guava" version="33.2.0.qualifier"/>
<bundle id="com.google.guava.source" version="33.2.0.qualifier"/>
<bundle id="jakarta.websocket-api" version="0.0.0"/>
<bundle id="jakarta.websocket-api.source" version="0.0.0"/>
<bundle id="jakarta.websocket-client-api" version="0.0.0"/>
Expand Down
10 changes: 5 additions & 5 deletions releng/releng-target/lsp4j.target.target
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<target name="org.eclipse.xtext.helios.target" sequenceNumber="0">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="false" type="InstallableUnit">
<repository location="https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/2024-03"/>
<unit id="com.google.gson" version="2.10.1"/>
<unit id="com.google.gson.source" version="2.10.1"/>
<unit id="com.google.guava" version="33.0.0.jre"/>
<unit id="com.google.guava.source" version="33.0.0.jre"/>
<repository location="https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/2024-06"/>
<unit id="com.google.gson" version="2.11.0"/>
<unit id="com.google.gson.source" version="2.11.0"/>
<unit id="com.google.guava" version="33.2.0.jre"/>
<unit id="com.google.guava.source" version="33.2.0.jre"/>
<unit id="jakarta.websocket-api" version="0.0.0"/>
<unit id="jakarta.websocket-api.source" version="0.0.0"/>
<unit id="jakarta.websocket-client-api" version="0.0.0"/>
Expand Down

0 comments on commit a44201f

Please sign in to comment.