diff --git a/common/src/main/java/me/lucko/luckperms/commands/Util.java b/common/src/main/java/me/lucko/luckperms/commands/Util.java index d1b2bc0e5..8256fd948 100644 --- a/common/src/main/java/me/lucko/luckperms/commands/Util.java +++ b/common/src/main/java/me/lucko/luckperms/commands/Util.java @@ -44,7 +44,7 @@ public class Util { if (strings.isEmpty()) return "&6None"; StringBuilder sb = new StringBuilder(); - strings.stream().forEach(s -> sb.append("&6").append(s).append("&7, ")); + strings.forEach(s -> sb.append("&6").append(s).append("&7, ")); return sb.delete(sb.length() - 2, sb.length()).toString(); } diff --git a/common/src/main/java/me/lucko/luckperms/data/methods/FlatfileDatastore.java b/common/src/main/java/me/lucko/luckperms/data/methods/FlatfileDatastore.java index eb442e907..77016be36 100644 --- a/common/src/main/java/me/lucko/luckperms/data/methods/FlatfileDatastore.java +++ b/common/src/main/java/me/lucko/luckperms/data/methods/FlatfileDatastore.java @@ -319,9 +319,9 @@ public class FlatfileDatastore extends Datastore { @Override public boolean loadAllGroups() { - List groups = Arrays.asList(groupsDir.list((dir, name1) -> name1.endsWith(".json"))) - .stream().map(s -> s.substring(0, s.length() - 5)) - .collect(Collectors.toList()); + String[] fileNames = groupsDir.list((dir, name) -> name.endsWith(".json")); + if (fileNames == null) return false; + List groups = Arrays.stream(fileNames).map(s -> s.substring(0, s.length() - 5)).collect(Collectors.toList()); plugin.getGroupManager().unloadAll(); groups.forEach(this::loadGroup); diff --git a/common/src/main/java/me/lucko/luckperms/data/methods/MySQLDatastore.java b/common/src/main/java/me/lucko/luckperms/data/methods/MySQLDatastore.java index 3be5cbf9b..1f8ae7dc8 100644 --- a/common/src/main/java/me/lucko/luckperms/data/methods/MySQLDatastore.java +++ b/common/src/main/java/me/lucko/luckperms/data/methods/MySQLDatastore.java @@ -50,7 +50,7 @@ public class MySQLDatastore extends SQLDatastore { @Override public void shutdown() { if (hikari != null) { - hikari.shutdown(); + hikari.close(); } } diff --git a/common/src/main/java/me/lucko/luckperms/data/methods/SQLDatastore.java b/common/src/main/java/me/lucko/luckperms/data/methods/SQLDatastore.java index edbb1875a..d1a382a0b 100644 --- a/common/src/main/java/me/lucko/luckperms/data/methods/SQLDatastore.java +++ b/common/src/main/java/me/lucko/luckperms/data/methods/SQLDatastore.java @@ -19,7 +19,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.UUID; -import java.util.logging.Level; @SuppressWarnings("UnnecessaryLocalVariable") abstract class SQLDatastore extends Datastore { diff --git a/common/src/main/java/me/lucko/luckperms/users/User.java b/common/src/main/java/me/lucko/luckperms/users/User.java index 16fb5c040..b9cff9f53 100644 --- a/common/src/main/java/me/lucko/luckperms/users/User.java +++ b/common/src/main/java/me/lucko/luckperms/users/User.java @@ -96,7 +96,7 @@ public abstract class User extends PermissionObject { /** * Remove the user from a group * @param group the group to remove the user from - * @throws ObjectLacksPermissionException + * @throws ObjectLacksPermissionException if the user isn't a member of the group */ public void removeGroup(Group group) throws ObjectLacksPermissionException { removeGroup(group, "global");