Update some dependencies

This commit is contained in:
Luck
2018-01-25 23:31:31 +00:00
Unverified
parent 54dbede130
commit e28d15456c
14 changed files with 43 additions and 76 deletions
@@ -34,20 +34,15 @@ public class ApiRegistrationUtil {
private static final Method REGISTER;
private static final Method UNREGISTER;
static {
Method register;
Method unregister;
try {
register = LuckPerms.class.getDeclaredMethod("registerProvider", LuckPermsApi.class);
register.setAccessible(true);
REGISTER = LuckPerms.class.getDeclaredMethod("registerProvider", LuckPermsApi.class);
REGISTER.setAccessible(true);
unregister = LuckPerms.class.getDeclaredMethod("unregisterProvider");
unregister.setAccessible(true);
UNREGISTER = LuckPerms.class.getDeclaredMethod("unregisterProvider");
UNREGISTER.setAccessible(true);
} catch (NoSuchMethodException e) {
throw new ExceptionInInitializerError(e);
}
REGISTER = register;
UNREGISTER = unregister;
}
public static void registerProvider(LuckPermsApi luckPermsApi) {
@@ -61,22 +61,22 @@ public enum Dependency {
CAFFEINE(
"com{}github{}ben-manes{}caffeine",
"caffeine",
"2.6.0",
"JmT16VQnCnVBAjRJCQkkkjmSVx2jajpzeBuKwpbzDA8=",
"2.6.1",
"5F55lb0PmSThBWkRJ9mwkvN+8xT6uDZKIwKk37QW0co=",
Relocation.of("caffeine", "com{}github{}benmanes{}caffeine")
),
MARIADB_DRIVER(
"org{}mariadb{}jdbc",
"mariadb-java-client",
"2.2.0",
"/q0LPGHrp3L9rvKr7TuA6urbtXBqvXis92mP4KhxzUw=",
"2.2.1",
"K/WUWx66IX2PpclGA6Eeczs5FyuzqBdcmS/IzNLzKW8=",
Relocation.of("mariadb", "org{}mariadb{}jdbc")
),
MYSQL_DRIVER(
"mysql",
"mysql-connector-java",
"5.1.44",
"d4RZVzTeWpoHBPB/tQP3mSafNy7L9MDUSOt4Ku9LGCc=",
"5.1.45",
"WbqXFalbltVXkMdH8kxUmr1kXNHpQdrlSxOMATMwDWQ=",
Relocation.of("mysql", "com{}mysql")
),
POSTGRESQL_DRIVER(
@@ -105,8 +105,8 @@ public enum Dependency {
HIKARI(
"com{}zaxxer",
"HikariCP",
"2.7.4",
"y9JE6/VmbydCqlV1z468+oqdkBswBk6aw+ECT178AT4=",
"2.7.6",
"gEhb0Z6eOIgGT5mG9NhyyEtbBxJx/Rks6aDiWUnmqK4=",
Relocation.of("hikari", "com{}zaxxer{}hikari")
),
SLF4J_SIMPLE(
@@ -124,8 +124,8 @@ public enum Dependency {
MONGODB_DRIVER(
"org.mongodb",
"mongo-java-driver",
"3.5.0",
"gxrbKVSI/xM6r+6uL7g7I0DzNV+hlNTtfw4UL13XdK8=",
"3.6.1",
"Po8eyOBWv8XjREKSFrQh/NKHvLabtOysxbEFiD35cEk=",
Relocation.allOf(
Relocation.of("mongodb", "com{}mongodb"),
Relocation.of("bson", "org{}bson")
@@ -36,14 +36,12 @@ public class ReflectionClassLoader implements PluginClassLoader {
private static final Method ADD_URL_METHOD;
static {
Method addUrlMethod;
try {
addUrlMethod = URLClassLoader.class.getDeclaredMethod("addURL", URL.class);
addUrlMethod.setAccessible(true);
ADD_URL_METHOD = URLClassLoader.class.getDeclaredMethod("addURL", URL.class);
ADD_URL_METHOD.setAccessible(true);
} catch (NoSuchMethodException e) {
throw new ExceptionInInitializerError(e);
}
ADD_URL_METHOD = addUrlMethod;
}
private final URLClassLoader classLoader;
@@ -28,6 +28,7 @@ package me.lucko.luckperms.common.storage.dao.mongodb;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList;
import com.mongodb.MongoClient;
import com.mongodb.MongoClientOptions;
import com.mongodb.MongoCredential;
import com.mongodb.ServerAddress;
import com.mongodb.client.MongoCollection;
@@ -61,7 +62,6 @@ import me.lucko.luckperms.common.storage.dao.AbstractDao;
import org.bson.Document;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
@@ -102,9 +102,9 @@ public class MongoDao extends AbstractDao {
ServerAddress address = new ServerAddress(host, port);
if (credential == null) {
this.mongoClient = new MongoClient(address, Collections.emptyList());
this.mongoClient = new MongoClient(address);
} else {
this.mongoClient = new MongoClient(address, Collections.singletonList(credential));
this.mongoClient = new MongoClient(address, credential, MongoClientOptions.builder().build());
}
this.database = this.mongoClient.getDatabase(this.configuration.getDatabase());
@@ -37,9 +37,9 @@ import java.util.concurrent.TimeUnit;
public final class CollationKeyCache implements Comparator<String> {
private static final CollationKeyCache INSTANCE = new CollationKeyCache();
private static final Collator COLLATOR = Collator.getInstance(Locale.ENGLISH);
private static final Collator COLLATOR;
static {
COLLATOR = Collator.getInstance(Locale.ENGLISH);
COLLATOR.setStrength(Collator.IDENTICAL);
COLLATOR.setDecomposition(Collator.FULL_DECOMPOSITION);
}
@@ -78,14 +78,11 @@ public final class CollationKeyCache implements Comparator<String> {
return i;
}
}
// fallback to standard string comparison
return o1.compareTo(o2);
} catch (Exception e) {
// ignored
}
// shrug
return 0;
// fallback to standard string comparison
return o1.compareTo(o2);
}
}
@@ -50,7 +50,7 @@ public class Cycle<E> {
/**
* The current position of the cursor
*/
private AtomicInteger cursor = new AtomicInteger(0);
private final AtomicInteger cursor = new AtomicInteger(0);
public Cycle(List<E> objects) {
if (objects == null || objects.isEmpty()) {
@@ -71,7 +71,7 @@ public class VerboseListener {
// the sender to notify each time the listener processes a check which passes the filter
private final Sender notifiedSender;
// the filter
private VerboseFilter filter;
private final VerboseFilter filter;
// if we should notify the sender
private final boolean notify;
// the number of checks we have processed