Skip to content

Commit

Permalink
Add Java 15 support.
Browse files Browse the repository at this point in the history
  • Loading branch information
raphw committed Dec 18, 2019
1 parent 93d3bad commit 9212ebc
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Install JDK and build project
run: |
. ./.github/scripts/install-jdk.sh --feature ea --os linux-x64
./mvnw verify -Pjava14
./mvnw verify -Pjava15
hotspot-supported:
name: HotSpot (supported)
strategy:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ public class ClassFileVersion implements Comparable<ClassFileVersion> {
*/
public static final ClassFileVersion JAVA_V14 = new ClassFileVersion(Opcodes.V14);

/**
* The class file version of Java 15.
*/
public static final ClassFileVersion JAVA_V15 = new ClassFileVersion(Opcodes.V14 + 1);

/**
* A version locator for the executing JVM.
*/
Expand Down Expand Up @@ -179,6 +184,8 @@ public static ClassFileVersion ofJavaVersionString(String javaVersionString) {
return JAVA_V13;
} else if (javaVersionString.equals("1.14") || javaVersionString.equals("14")) {
return JAVA_V14;
} else if (javaVersionString.equals("1.15") || javaVersionString.equals("15")) {
return JAVA_V15;
} else {
if (OpenedClassReader.EXPERIMENTAL) {
try {
Expand Down Expand Up @@ -232,6 +239,8 @@ public static ClassFileVersion ofJavaVersion(int javaVersion) {
return JAVA_V13;
case 14:
return JAVA_V14;
case 15:
return JAVA_V14;
default:
if (OpenedClassReader.EXPERIMENTAL && javaVersion > 0) {
return new ClassFileVersion(BASE_VERSION + javaVersion);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ public static Collection<Object[]> data() {
{11, 11, Arrays.asList("1.11", "11"), Opcodes.V11, (short) 55, (short) 0, true, true, true},
{12, 12, Arrays.asList("1.12", "12"), Opcodes.V12, (short) 56, (short) 0, true, true, true},
{13, 13, Arrays.asList("1.13", "13"), Opcodes.V13, (short) 57, (short) 0, true, true, true},
{14, 14, Arrays.asList("1.14", "14"), Opcodes.V14, (short) 58, (short) 0, true, true, true}
{14, 14, Arrays.asList("1.14", "14"), Opcodes.V14, (short) 58, (short) 0, true, true, true},
{15, 15, Arrays.asList("1.15", "15"), Opcodes.V14 + 1, (short) 59, (short) 0, true, true, true}
});
}

Expand Down
28 changes: 28 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,22 @@
<bytebuddy.experimental>true</bytebuddy.experimental>
</properties>
</profile>
<!-- Runs the build with compatibility for Java 15 JVMs. -->
<profile>
<id>java15-compatibility</id>
<activation>
<activeByDefault>false</activeByDefault>
<jdk>15</jdk>
</activation>
<properties>
<sourcecode.main.version>8</sourcecode.main.version>
<sourcecode.test.version>8</sourcecode.test.version>
<bytecode.main.version>8</bytecode.main.version>
<bytecode.test.version>8</bytecode.test.version>
<jacoco.skip>true</jacoco.skip>
<bytebuddy.experimental>true</bytebuddy.experimental>
</properties>
</profile>
<!-- Builds using a byte code target for Java 6. -->
<profile>
<id>java6</id>
Expand Down Expand Up @@ -644,6 +660,18 @@
<spotbugs.skip>true</spotbugs.skip>
</properties>
</profile>
<!-- Builds using a byte code target for Java 15. -->
<profile>
<id>java15</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<bytecode.main.version>15</bytecode.main.version>
<bytecode.test.version>15</bytecode.test.version>
<spotbugs.skip>true</spotbugs.skip>
</properties>
</profile>
<!-- Creates additional artifacts that are required for deployment. -->
<profile>
<id>extras</id>
Expand Down

0 comments on commit 9212ebc

Please sign in to comment.