Skip to content

Commit

Permalink
Fix JPMS module setup (fixes #1315) (#1402)
Browse files Browse the repository at this point in the history
* Fix JPMS module setup (fixes #1315)

* Re-added cause to AssertionErrors
  • Loading branch information
pietvandongen authored and inder123 committed Oct 18, 2018
1 parent 27c9335 commit 5bbc768
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 13 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
language: java

jdk:
- openjdk7
- oraclejdk8
- oraclejdk9

install: mvn -f gson install -DskipTests=true
script: mvn -f gson test
Expand Down
2 changes: 1 addition & 1 deletion gson/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'java'
apply plugin: 'maven'

group = 'com.google.code.gson'
version = '2.8.4-SNAPSHOT'
version = '2.8.6-SNAPSHOT'

sourceCompatibility = 1.6
targetCompatibility = 1.6
Expand Down
2 changes: 1 addition & 1 deletion gson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<version>3.1.0</version>
<version>4.0.0</version>
<executions>
<execution>
<goals>
Expand Down
12 changes: 9 additions & 3 deletions gson/src/main/java/com/google/gson/Gson.java
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,9 @@ public void toJson(Object src, Type typeOfSrc, JsonWriter writer) throws JsonIOE
} catch (IOException e) {
throw new JsonIOException(e);
} catch (AssertionError e) {
throw new AssertionError("AssertionError (GSON " + GsonBuildConfig.VERSION + "): " + e.getMessage(), e);
AssertionError error = new AssertionError("AssertionError (GSON " + GsonBuildConfig.VERSION + "): " + e.getMessage());
error.initCause(e);
throw error;
} finally {
writer.setLenient(oldLenient);
writer.setHtmlSafe(oldHtmlSafe);
Expand Down Expand Up @@ -783,7 +785,9 @@ public void toJson(JsonElement jsonElement, JsonWriter writer) throws JsonIOExce
} catch (IOException e) {
throw new JsonIOException(e);
} catch (AssertionError e) {
throw new AssertionError("AssertionError (GSON " + GsonBuildConfig.VERSION + "): " + e.getMessage(), e);
AssertionError error = new AssertionError("AssertionError (GSON " + GsonBuildConfig.VERSION + "): " + e.getMessage());
error.initCause(e);
throw error;
} finally {
writer.setLenient(oldLenient);
writer.setHtmlSafe(oldHtmlSafe);
Expand Down Expand Up @@ -941,7 +945,9 @@ public <T> T fromJson(JsonReader reader, Type typeOfT) throws JsonIOException, J
// TODO(inder): Figure out whether it is indeed right to rethrow this as JsonSyntaxException
throw new JsonSyntaxException(e);
} catch (AssertionError e) {
throw new AssertionError("AssertionError (GSON " + GsonBuildConfig.VERSION + "): " + e.getMessage(), e);
AssertionError error = new AssertionError("AssertionError (GSON " + GsonBuildConfig.VERSION + "): " + e.getMessage());
error.initCause(e);
throw error;
} finally {
reader.setLenient(oldLenient);
}
Expand Down
File renamed without changes.
27 changes: 21 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,28 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<version>3.8.0</version>
<executions>
<execution>
<id>default-compile</id>
<configuration>
<release>9</release>
</configuration>
</execution>
<execution>
<id>base-compile</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<excludes>
<exclude>module-info.java</exclude>
</excludes>
</configuration>
</execution>
</executions>
<configuration>
<excludes>
<exclude>**/module-info.java</exclude>
</excludes>
<source>${java.version}</source>
<target>${java.version}</target>
<release>6</release>
</configuration>
</plugin>
<plugin>
Expand Down

0 comments on commit 5bbc768

Please sign in to comment.