Fix Java 16 dependency not for every modules (because WebAPI still run with Java 11)

This commit is contained in:
Marc Baloup 2021-07-04 16:03:21 +02:00
parent 918ab59b69
commit e9afbbe7b6
Signed by: marcbal
GPG Key ID: BBC0FE3ABC30B893
8 changed files with 56 additions and 11 deletions

View File

@ -11,6 +11,11 @@
<name>PandaLib-Bungee</name>
<properties>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
</properties>
<repositories>
<repository>
<id>papermc</id>

View File

@ -13,7 +13,7 @@
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-16">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>

View File

@ -1,8 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=16
org.eclipse.jdt.core.compiler.compliance=16
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=16
org.eclipse.jdt.core.compiler.source=11

View File

@ -255,7 +255,16 @@ public class ChatColorUtil {
public static class ChatValueGradient {
private record GradientValueColor(float value, ChatColor color) { }
//private record GradientValueColor(float value, ChatColor color) { } // Java 16
private static class GradientValueColor {
private final float value;
private final ChatColor color;
public GradientValueColor(float value, ChatColor color) {
this.value = value; this.color = color;
}
public float value() { return value; }
public ChatColor color() { return color; }
}
List<GradientValueColor> colors = new ArrayList<>();

View File

@ -2,6 +2,13 @@ package fr.pandacube.lib.core.db;
import java.util.List;
public record ParameterizedSQLString(String sqlString, List<Object> parameters) {
//public record ParameterizedSQLString(String sqlString, List<Object> parameters) { } // Java 16
public class ParameterizedSQLString {
private final String sqlString;
private final List<Object> parameters;
public ParameterizedSQLString(String sqlString, List<Object> parameters) {
this.sqlString = sqlString; this.parameters = parameters;
}
public String sqlString() { return sqlString; }
public List<Object> parameters() { return parameters; }
}

View File

@ -37,7 +37,16 @@ public class PlayerFinder {
.maximumSize(1000)
.build();
record PlayerIdCacheKey(String pName, boolean old) { }
//record PlayerIdCacheKey(String pName, boolean old) { } // Java 16
static class PlayerIdCacheKey {
private final String pName;
private final boolean old;
public PlayerIdCacheKey(String pName, boolean old) {
this.pName = pName; this.old = old;
}
public String pName() { return pName; }
public boolean old() { return old; }
}
private static Cache<PlayerIdCacheKey, UUID> playerId = CacheBuilder.newBuilder()
.expireAfterWrite(2, TimeUnit.MINUTES)
.maximumSize(1000)
@ -203,7 +212,17 @@ public class PlayerFinder {
return DIFF_CHAR_DISTANCE;
};
record NamesCacheResult(String name, UUID id) { }
// record NamesCacheResult(String name, UUID id) { } // Java 16
static class NamesCacheResult {
private final String name;
private final UUID id;
public NamesCacheResult(String name, UUID id) {
this.name = name; this.id = id;
}
public String name() { return name; }
public UUID id() { return id; }
}
private static LoadingCache<String, List<NamesCacheResult>> namesCache = CacheBuilder.newBuilder()
.expireAfterWrite(2, TimeUnit.MINUTES)
.maximumSize(1)

View File

@ -11,6 +11,11 @@
<name>PandaLib-Paper</name>
<properties>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
</properties>
<repositories>
<repository>
<id>papermc</id>

View File

@ -37,8 +37,8 @@
<properties>
<build.number>unknown</build.number>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<bungeecord.version>1.16-R0.4-SNAPSHOT</bungeecord.version>