Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with JDK 13 and 14 #1332

Merged
merged 9 commits into from
Dec 14, 2020
20 changes: 10 additions & 10 deletions framework/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ require: &allDependencies
- antlr 2.7.7
- com.mchange -> c3p0 0.9.5.2
- com.zaxxer -> HikariCP 3.2.0
- org.ow2.asm -> asm 7.0
- org.ow2.asm -> asm-commons 7.0
- org.ow2.asm -> asm-util 7.0
- org.ow2.asm -> asm-tree 7.0
- org.ow2.asm -> asm-analysis 7.0
- org.ow2.asm -> asm 8.0.1
- org.ow2.asm -> asm-commons 8.0.1
- org.ow2.asm -> asm-util 8.0.1
- org.ow2.asm -> asm-tree 8.0.1
- org.ow2.asm -> asm-analysis 8.0.1
- cglib -> cglib 3.2.7
- com.google.code.gson -> gson 2.8.5
- com.jamonapi -> jamon 2.81
Expand All @@ -33,7 +33,7 @@ require: &allDependencies
- com.sun.mail -> javax.mail 1.6.2
- javax.inject 1.0
- javax.validation -> validation-api 1.1.0.Final
- jaxen 1.1.6
- jaxen 1.2.0
- joda-time 2.10
- org.hamcrest -> hamcrest-all 1.3
- junit 4.12
Expand All @@ -49,9 +49,9 @@ require: &allDependencies
- org.apache.ivy -> ivy 2.4.0
- org.bouncycastle -> bcprov-jdk15on 1.61
- org.bouncycastle -> bcpkix-jdk15on 1.61
- org.codehaus.groovy -> groovy 2.5.3
- org.codehaus.groovy -> groovy-xml 2.5.3
- org.eclipse.jdt -> org.eclipse.jdt.core 3.16.0
- org.codehaus.groovy -> groovy 3.0.4
- org.codehaus.groovy -> groovy-xml 3.0.4
- org.eclipse.jdt -> org.eclipse.jdt.core 3.18.0
- org.hibernate -> hibernate-core 5.4.1.Final.patched
- net.bytebuddy -> byte-buddy 1.9.5
- javax.persistence -> javax.persistence-api 2.2
Expand All @@ -66,7 +66,7 @@ require: &allDependencies
- org.hibernate -> hibernate-c3p0 5.4.1.Final
- org.hibernate -> hibernate-ehcache 5.4.1.Final
- com.mchange -> mchange-commons-java 0.2.12
- org.javassist -> javassist 3.24.0-GA
- org.javassist -> javassist 3.27.0-GA
- io.netty -> netty 3.10.6.Final
- org.postgresql -> postgresql 42.2.4
- org.slf4j -> slf4j-api 1.7.22
Expand Down
Binary file removed framework/lib/asm-7.0.jar
Binary file not shown.
Binary file added framework/lib/asm-8.0.1.jar
Binary file not shown.
Binary file removed framework/lib/asm-analysis-7.0.jar
Binary file not shown.
Binary file added framework/lib/asm-analysis-8.0.1.jar
Binary file not shown.
Binary file removed framework/lib/asm-commons-7.0.jar
Binary file not shown.
Binary file added framework/lib/asm-commons-8.0.1.jar
Binary file not shown.
Binary file removed framework/lib/asm-tree-7.0.jar
Binary file not shown.
Binary file added framework/lib/asm-tree-8.0.1.jar
Binary file not shown.
Binary file removed framework/lib/asm-util-7.0.jar
Binary file not shown.
Binary file added framework/lib/asm-util-8.0.1.jar
Binary file not shown.
Binary file removed framework/lib/groovy-2.5.3.jar
Binary file not shown.
Binary file added framework/lib/groovy-3.0.4.jar
Binary file not shown.
Binary file removed framework/lib/groovy-xml-2.5.3.jar
Binary file not shown.
Binary file added framework/lib/groovy-xml-3.0.4.jar
Binary file not shown.
Binary file not shown.
Binary file removed framework/lib/jaxen-1.1.6.jar
Binary file not shown.
Binary file added framework/lib/jaxen-1.2.0.jar
Binary file not shown.
Binary file not shown.
15 changes: 7 additions & 8 deletions framework/src/play/classloading/ApplicationCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,13 @@ public class ApplicationCompiler {
ApplicationClasses applicationClasses;
Map<String, String> settings;
private static final String JAVA_SOURCE_DEFAULT_VERSION = "1.8";
static final Map<String, String> compatibleJavaVersions = new HashMap<>();

static {
compatibleJavaVersions.put("1.8", CompilerOptions.VERSION_1_8);
compatibleJavaVersions.put("9", CompilerOptions.VERSION_9);
compatibleJavaVersions.put("10", CompilerOptions.VERSION_10);
compatibleJavaVersions.put("11", CompilerOptions.VERSION_11);
}
static final Map<String, String> compatibleJavaVersions = org.apache.groovy.util.Maps.of( //
"1.8", CompilerOptions.VERSION_1_8, //
"9", CompilerOptions.VERSION_9, //
"10", CompilerOptions.VERSION_10, //
"11", CompilerOptions.VERSION_11, //
"12", CompilerOptions.VERSION_12 //
xael-fry marked this conversation as resolved.
Show resolved Hide resolved
);

/**
* Try to guess the magic configuration options
Expand Down
2 changes: 1 addition & 1 deletion framework/src/play/mvc/Scope.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class Scope {
public static final String COOKIE_EXPIRE = Play.configuration.getProperty("application.session.maxAge");
public static final boolean SESSION_HTTPONLY = Play.configuration.getProperty("application.session.httpOnly", "false").toLowerCase()
.equals("true");
public static final boolean SESSION_SEND_ONLY_IF_CHANGED = Play.configuration
public static boolean SESSION_SEND_ONLY_IF_CHANGED = Play.configuration
.getProperty("application.session.sendOnlyIfChanged", "false").toLowerCase().equals("true");

public static SessionStore sessionStore = createSessionStore();
Expand Down
3 changes: 2 additions & 1 deletion framework/src/play/templates/GroovyTemplate.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
Expand Down Expand Up @@ -144,7 +145,7 @@ public void compile() {

Field phasesF = compilationUnit.getClass().getDeclaredField("phaseOperations");
phasesF.setAccessible(true);
LinkedList[] phases = (LinkedList[]) phasesF.get(compilationUnit);
Collection[] phases = (Collection[]) phasesF.get(compilationUnit);
LinkedList<GroovyClassOperation> output = new LinkedList<>();
phases[Phases.OUTPUT] = output;
output.add(new GroovyClassOperation() {
Expand Down
16 changes: 1 addition & 15 deletions framework/test-src/play/mvc/SessionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,7 @@ private static void mockRequestAndResponse() {
}

public static void setSendOnlyIfChangedConstant(boolean value) {
try {
/*
* Set the final static value Scope.SESSION_SEND_ONLY_IF_CHANGED using reflection.
*/
Field field = Scope.class.getField("SESSION_SEND_ONLY_IF_CHANGED");
field.setAccessible(true);
Field modifiersField = Field.class.getDeclaredField("modifiers");
modifiersField.setAccessible(true);
modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);

// Set the new value
field.setBoolean(null, value);
} catch(Exception e) {
throw new RuntimeException(e);
}
Scope.SESSION_SEND_ONLY_IF_CHANGED = value;
}

@Test
Expand Down