From 0a50df6557d0e3639e351f9f2fda2fb0b8fb55ae Mon Sep 17 00:00:00 2001
From: Luck
Date: Tue, 5 Mar 2019 12:36:09 +0000
Subject: [PATCH] Code style: move private constructors for singleton classes
to the top of the file
---
.../bukkit/inject/permissible/PermissibleInjector.java | 3 +--
.../me/lucko/luckperms/bukkit/migration/BukkitUuids.java | 3 +--
.../java/me/lucko/luckperms/bungee/util/RedisBungeeUtil.java | 3 +--
.../luckperms/common/actionlog/LogEntryJsonSerializer.java | 2 +-
.../main/java/me/lucko/luckperms/common/api/ApiUtils.java | 3 +--
.../luckperms/common/command/access/ArgumentPermissions.java | 4 ++--
.../lucko/luckperms/common/command/utils/MessageUtils.java | 3 +--
.../luckperms/common/command/utils/StorageAssistant.java | 2 +-
.../luckperms/common/commands/migration/MigrationUtils.java | 3 +--
.../java/me/lucko/luckperms/common/config/ConfigKeys.java | 3 +--
.../common/context/ContextSetConfigurateSerializer.java | 3 +--
.../luckperms/common/context/ContextSetJsonSerializer.java | 3 +--
.../me/lucko/luckperms/common/graph/GraphTraversers.java | 3 +--
.../luckperms/common/metastacking/StandardStackElements.java | 3 +--
.../me/lucko/luckperms/common/model/DemotionResults.java | 4 +---
.../me/lucko/luckperms/common/model/PromotionResults.java | 4 +---
.../common/node/comparator/NodeWithContextComparator.java | 3 +--
.../luckperms/common/node/factory/LegacyNodeFactory.java | 3 +--
.../me/lucko/luckperms/common/node/factory/NodeFactory.java | 4 ++--
.../java/me/lucko/luckperms/common/node/model/NodeTypes.java | 3 +--
.../java/me/lucko/luckperms/common/node/utils/NodeTools.java | 2 +-
.../lucko/luckperms/common/node/utils/ShorthandParser.java | 4 ++--
.../implementation/custom/CustomStorageProviders.java | 4 ++--
.../lucko/luckperms/common/storage/misc/DataConstraints.java | 3 +--
.../main/java/me/lucko/luckperms/common/util/DateParser.java | 4 ++--
.../java/me/lucko/luckperms/common/util/ExpiringSet.java | 3 +--
.../me/lucko/luckperms/common/util/ImmutableCollectors.java | 3 +--
.../main/java/me/lucko/luckperms/common/util/Iterators.java | 3 +--
.../main/java/me/lucko/luckperms/common/util/MoreFiles.java | 2 +-
.../java/me/lucko/luckperms/common/util/PatternCache.java | 3 +--
.../main/java/me/lucko/luckperms/common/util/Predicates.java | 3 ++-
.../me/lucko/luckperms/common/util/PrivateMethodHandles.java | 1 -
.../main/java/me/lucko/luckperms/common/util/Scripting.java | 4 ++--
.../main/java/me/lucko/luckperms/common/util/TextUtils.java | 3 +--
.../src/main/java/me/lucko/luckperms/common/util/Uuids.java | 4 ++--
.../main/java/me/lucko/luckperms/common/web/HttpClient.java | 1 -
.../main/java/me/lucko/luckperms/common/web/WebEditor.java | 4 ++--
.../nukkit/inject/permissible/PermissibleInjector.java | 3 +--
.../me/lucko/luckperms/sponge/service/CompatibilityUtil.java | 4 ++--
.../lucko/luckperms/sponge/commands/SpongeCommandUtils.java | 3 +--
.../java/me/lucko/luckperms/sponge/service/ProxyFactory.java | 4 ++--
.../sponge/service/inheritance/SubjectInheritanceGraphs.java | 5 ++---
.../lucko/luckperms/velocity/service/CompatibilityUtil.java | 3 +--
43 files changed, 53 insertions(+), 82 deletions(-)
diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/inject/permissible/PermissibleInjector.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/inject/permissible/PermissibleInjector.java
index d1b920ca9..b31b38c9c 100644
--- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/inject/permissible/PermissibleInjector.java
+++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/inject/permissible/PermissibleInjector.java
@@ -42,6 +42,7 @@ import java.util.List;
* checks made by plugins.
*/
public final class PermissibleInjector {
+ private PermissibleInjector() {}
/**
* All permission checks made on standard Bukkit objects are effectively proxied to a
@@ -151,6 +152,4 @@ public final class PermissibleInjector {
}
}
- private PermissibleInjector() {}
-
}
diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/BukkitUuids.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/BukkitUuids.java
index f39f327d9..82d7086c1 100644
--- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/BukkitUuids.java
+++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/BukkitUuids.java
@@ -33,6 +33,7 @@ import org.bukkit.Bukkit;
import java.util.UUID;
public final class BukkitUuids {
+ private BukkitUuids() {}
public static UUID lookupUuid(ProgressLogger log, String s) {
UUID uuid = Uuids.parse(s);
@@ -50,6 +51,4 @@ public final class BukkitUuids {
return uuid;
}
- private BukkitUuids() {}
-
}
diff --git a/bungee/src/main/java/me/lucko/luckperms/bungee/util/RedisBungeeUtil.java b/bungee/src/main/java/me/lucko/luckperms/bungee/util/RedisBungeeUtil.java
index fb9514cd5..6326d4edb 100644
--- a/bungee/src/main/java/me/lucko/luckperms/bungee/util/RedisBungeeUtil.java
+++ b/bungee/src/main/java/me/lucko/luckperms/bungee/util/RedisBungeeUtil.java
@@ -31,6 +31,7 @@ import java.util.Optional;
import java.util.UUID;
public final class RedisBungeeUtil {
+ private RedisBungeeUtil() {}
/**
* Looks up a UUID from username via RedisBungee's uuid cache.
@@ -46,6 +47,4 @@ public final class RedisBungeeUtil {
return Optional.ofNullable(RedisBungee.getApi()).map(a -> a.getNameFromUuid(uuid, true));
}
- private RedisBungeeUtil() {}
-
}
diff --git a/common/src/main/java/me/lucko/luckperms/common/actionlog/LogEntryJsonSerializer.java b/common/src/main/java/me/lucko/luckperms/common/actionlog/LogEntryJsonSerializer.java
index cc9949ff4..fdf4fccf9 100644
--- a/common/src/main/java/me/lucko/luckperms/common/actionlog/LogEntryJsonSerializer.java
+++ b/common/src/main/java/me/lucko/luckperms/common/actionlog/LogEntryJsonSerializer.java
@@ -35,6 +35,7 @@ import me.lucko.luckperms.api.LogEntry;
import java.util.UUID;
public final class LogEntryJsonSerializer {
+ private LogEntryJsonSerializer() {}
public static JsonObject serialize(LogEntry logEntry) {
JsonObject data = new JsonObject();
@@ -68,5 +69,4 @@ public final class LogEntryJsonSerializer {
return builder.build();
}
- private LogEntryJsonSerializer() {}
}
diff --git a/common/src/main/java/me/lucko/luckperms/common/api/ApiUtils.java b/common/src/main/java/me/lucko/luckperms/common/api/ApiUtils.java
index b8d849e7e..049606c79 100644
--- a/common/src/main/java/me/lucko/luckperms/common/api/ApiUtils.java
+++ b/common/src/main/java/me/lucko/luckperms/common/api/ApiUtils.java
@@ -34,6 +34,7 @@ import me.lucko.luckperms.common.storage.misc.DataConstraints;
import java.util.function.Predicate;
public final class ApiUtils {
+ private ApiUtils() {}
public static String checkUsername(String s, LuckPermsPlugin plugin) {
if (s == null) {
@@ -57,6 +58,4 @@ public final class ApiUtils {
return s.toLowerCase();
}
- private ApiUtils() {}
-
}
diff --git a/common/src/main/java/me/lucko/luckperms/common/command/access/ArgumentPermissions.java b/common/src/main/java/me/lucko/luckperms/common/command/access/ArgumentPermissions.java
index 68d949da1..198d00f35 100644
--- a/common/src/main/java/me/lucko/luckperms/common/command/access/ArgumentPermissions.java
+++ b/common/src/main/java/me/lucko/luckperms/common/command/access/ArgumentPermissions.java
@@ -47,6 +47,8 @@ import java.util.function.Function;
* Implements argument based permission checks for use in command implementations.
*/
public final class ArgumentPermissions {
+ private ArgumentPermissions() {}
+
private static final String USER_MODIFY_SELF = CommandPermission.ROOT + "modify.user.self";
private static final String USER_MODIFY_OTHERS = CommandPermission.ROOT + "modify.user.others";
private static final Function GROUP_MODIFY = s -> CommandPermission.ROOT + "modify.group." + s;
@@ -301,7 +303,5 @@ public final class ArgumentPermissions {
PermissionCache permissionData = user.getCachedData().getPermissionData(Contexts.global().setContexts(contextSet));
return !permissionData.getPermissionValue(NodeFactory.groupNode(targetGroupName), PermissionCheckEvent.Origin.INTERNAL).result().asBoolean();
}
-
- private ArgumentPermissions() {}
}
diff --git a/common/src/main/java/me/lucko/luckperms/common/command/utils/MessageUtils.java b/common/src/main/java/me/lucko/luckperms/common/command/utils/MessageUtils.java
index 970932d3b..45157899d 100644
--- a/common/src/main/java/me/lucko/luckperms/common/command/utils/MessageUtils.java
+++ b/common/src/main/java/me/lucko/luckperms/common/command/utils/MessageUtils.java
@@ -38,6 +38,7 @@ import java.util.List;
import java.util.Map;
public final class MessageUtils {
+ private MessageUtils() {}
/**
* Sends a message to the sender, formatted with the plugin prefix and color scheme
@@ -177,6 +178,4 @@ public final class MessageUtils {
return sb.delete(sb.length() - Message.CONTEXT_PAIR_SEP.asString(localeManager).length(), sb.length()).toString();
}
- private MessageUtils() {}
-
}
diff --git a/common/src/main/java/me/lucko/luckperms/common/command/utils/StorageAssistant.java b/common/src/main/java/me/lucko/luckperms/common/command/utils/StorageAssistant.java
index 294cafc57..5a5ef9acb 100644
--- a/common/src/main/java/me/lucko/luckperms/common/command/utils/StorageAssistant.java
+++ b/common/src/main/java/me/lucko/luckperms/common/command/utils/StorageAssistant.java
@@ -41,6 +41,7 @@ import java.util.Optional;
* Utility methods for saving users, groups and tracks.
*/
public final class StorageAssistant {
+ private StorageAssistant() {}
public static Group loadGroup(String target, Sender sender, LuckPermsPlugin plugin, boolean auditTemporary) {
// special handling for the importer
@@ -176,5 +177,4 @@ public final class StorageAssistant {
}
}
- private StorageAssistant() {}
}
diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/migration/MigrationUtils.java b/common/src/main/java/me/lucko/luckperms/common/commands/migration/MigrationUtils.java
index 75f3368fa..210d529c5 100644
--- a/common/src/main/java/me/lucko/luckperms/common/commands/migration/MigrationUtils.java
+++ b/common/src/main/java/me/lucko/luckperms/common/commands/migration/MigrationUtils.java
@@ -31,6 +31,7 @@ import me.lucko.luckperms.common.model.Group;
import me.lucko.luckperms.common.node.factory.NodeFactory;
public final class MigrationUtils {
+ private MigrationUtils() {}
public static Node.Builder parseNode(String permission, boolean value) {
if (permission.startsWith("-") || permission.startsWith("!")) {
@@ -61,6 +62,4 @@ public final class MigrationUtils {
return string.trim().replace(':', '-').replace(' ', '-').replace('.', '-').toLowerCase();
}
- private MigrationUtils() {}
-
}
diff --git a/common/src/main/java/me/lucko/luckperms/common/config/ConfigKeys.java b/common/src/main/java/me/lucko/luckperms/common/config/ConfigKeys.java
index fea3a7740..d8fac5c37 100644
--- a/common/src/main/java/me/lucko/luckperms/common/config/ConfigKeys.java
+++ b/common/src/main/java/me/lucko/luckperms/common/config/ConfigKeys.java
@@ -70,6 +70,7 @@ import static me.lucko.luckperms.common.config.ConfigKeyTypes.stringKey;
* to function a bit like an enum, but with generics.
*/
public final class ConfigKeys {
+ private ConfigKeys() {}
/**
* The name of the server
@@ -593,6 +594,4 @@ public final class ConfigKeys {
return SIZE;
}
- private ConfigKeys() {}
-
}
diff --git a/common/src/main/java/me/lucko/luckperms/common/context/ContextSetConfigurateSerializer.java b/common/src/main/java/me/lucko/luckperms/common/context/ContextSetConfigurateSerializer.java
index 58c2ad437..d510aa152 100644
--- a/common/src/main/java/me/lucko/luckperms/common/context/ContextSetConfigurateSerializer.java
+++ b/common/src/main/java/me/lucko/luckperms/common/context/ContextSetConfigurateSerializer.java
@@ -39,6 +39,7 @@ import java.util.List;
import java.util.Map;
public final class ContextSetConfigurateSerializer {
+ private ContextSetConfigurateSerializer() {}
public static ConfigurationNode serializeContextSet(ContextSet contextSet) {
ConfigurationNode data = SimpleConfigurationNode.root();
@@ -84,6 +85,4 @@ public final class ContextSetConfigurateSerializer {
return map;
}
- private ContextSetConfigurateSerializer() {}
-
}
diff --git a/common/src/main/java/me/lucko/luckperms/common/context/ContextSetJsonSerializer.java b/common/src/main/java/me/lucko/luckperms/common/context/ContextSetJsonSerializer.java
index 0ffe89182..9c6b312e2 100644
--- a/common/src/main/java/me/lucko/luckperms/common/context/ContextSetJsonSerializer.java
+++ b/common/src/main/java/me/lucko/luckperms/common/context/ContextSetJsonSerializer.java
@@ -42,6 +42,7 @@ import java.util.Map;
import java.util.Objects;
public final class ContextSetJsonSerializer {
+ private ContextSetJsonSerializer() {}
public static JsonObject serializeContextSet(ContextSet contextSet) {
JsonObject data = new JsonObject();
@@ -104,6 +105,4 @@ public final class ContextSetJsonSerializer {
return map;
}
- private ContextSetJsonSerializer() {}
-
}
diff --git a/common/src/main/java/me/lucko/luckperms/common/graph/GraphTraversers.java b/common/src/main/java/me/lucko/luckperms/common/graph/GraphTraversers.java
index 3d4aa5e6f..0484efb17 100644
--- a/common/src/main/java/me/lucko/luckperms/common/graph/GraphTraversers.java
+++ b/common/src/main/java/me/lucko/luckperms/common/graph/GraphTraversers.java
@@ -57,6 +57,7 @@ import java.util.Set;
* @author Jens Nyman
*/
public final class GraphTraversers {
+ private GraphTraversers() {}
/**
* Returns an unmodifiable {@code Iterable} over the nodes reachable from
@@ -210,6 +211,4 @@ public final class GraphTraversers {
POST_ORDER
}
- private GraphTraversers() {}
-
}
diff --git a/common/src/main/java/me/lucko/luckperms/common/metastacking/StandardStackElements.java b/common/src/main/java/me/lucko/luckperms/common/metastacking/StandardStackElements.java
index 0782ea59a..b99a01fb5 100644
--- a/common/src/main/java/me/lucko/luckperms/common/metastacking/StandardStackElements.java
+++ b/common/src/main/java/me/lucko/luckperms/common/metastacking/StandardStackElements.java
@@ -44,6 +44,7 @@ import java.util.Objects;
* Contains the standard {@link MetaStackElement}s provided by LuckPerms.
*/
public final class StandardStackElements {
+ private StandardStackElements() {}
public static MetaStackElement parseFromString(LuckPermsPlugin plugin, String s) {
s = s.toLowerCase();
@@ -317,6 +318,4 @@ public final class StandardStackElements {
}
}
- private StandardStackElements() {}
-
}
diff --git a/common/src/main/java/me/lucko/luckperms/common/model/DemotionResults.java b/common/src/main/java/me/lucko/luckperms/common/model/DemotionResults.java
index 1de198f48..0440e3084 100644
--- a/common/src/main/java/me/lucko/luckperms/common/model/DemotionResults.java
+++ b/common/src/main/java/me/lucko/luckperms/common/model/DemotionResults.java
@@ -36,6 +36,7 @@ import java.util.Optional;
* Utility class for creating instances of {@link DemotionResult}.
*/
public final class DemotionResults {
+ private DemotionResults() {}
public static DemotionResult success(String groupFrom, String groupTo) {
return new Impl(DemotionResult.Status.SUCCESS, groupFrom, groupTo);
@@ -115,7 +116,4 @@ public final class DemotionResults {
}
}
-
- private DemotionResults() {}
-
}
diff --git a/common/src/main/java/me/lucko/luckperms/common/model/PromotionResults.java b/common/src/main/java/me/lucko/luckperms/common/model/PromotionResults.java
index 7a2ecd633..10b96253c 100644
--- a/common/src/main/java/me/lucko/luckperms/common/model/PromotionResults.java
+++ b/common/src/main/java/me/lucko/luckperms/common/model/PromotionResults.java
@@ -36,6 +36,7 @@ import java.util.Optional;
* Utility class for creating instances of {@link PromotionResult}.
*/
public final class PromotionResults {
+ private PromotionResults() {}
public static PromotionResult success(String groupFrom, String groupTo) {
return new Impl(PromotionResult.Status.SUCCESS, groupFrom, groupTo);
@@ -115,7 +116,4 @@ public final class PromotionResults {
}
}
-
- private PromotionResults() {}
-
}
diff --git a/common/src/main/java/me/lucko/luckperms/common/node/comparator/NodeWithContextComparator.java b/common/src/main/java/me/lucko/luckperms/common/node/comparator/NodeWithContextComparator.java
index f3e9a0965..29b3c3ba4 100644
--- a/common/src/main/java/me/lucko/luckperms/common/node/comparator/NodeWithContextComparator.java
+++ b/common/src/main/java/me/lucko/luckperms/common/node/comparator/NodeWithContextComparator.java
@@ -34,6 +34,7 @@ import java.util.Comparator;
* Compares permission nodes based upon their supposed "priority".
*/
public class NodeWithContextComparator implements Comparator {
+ private NodeWithContextComparator() {}
private static final Comparator super Node> INSTANCE = new NodeWithContextComparator();
private static final Comparator super Node> REVERSE = INSTANCE.reversed();
@@ -46,8 +47,6 @@ public class NodeWithContextComparator implements Comparator {
return REVERSE;
}
- private NodeWithContextComparator() {}
-
@Override
public int compare(Node o1, Node o2) {
if (o1.equals(o2)) {
diff --git a/common/src/main/java/me/lucko/luckperms/common/node/factory/LegacyNodeFactory.java b/common/src/main/java/me/lucko/luckperms/common/node/factory/LegacyNodeFactory.java
index 865eaae2b..1b9c36319 100644
--- a/common/src/main/java/me/lucko/luckperms/common/node/factory/LegacyNodeFactory.java
+++ b/common/src/main/java/me/lucko/luckperms/common/node/factory/LegacyNodeFactory.java
@@ -36,6 +36,7 @@ import java.util.Map;
import java.util.regex.Pattern;
public final class LegacyNodeFactory {
+ private LegacyNodeFactory() {}
/**
* The characters which are delimited when serializing a context set
@@ -201,6 +202,4 @@ public final class LegacyNodeFactory {
}
}
- private LegacyNodeFactory() {}
-
}
diff --git a/common/src/main/java/me/lucko/luckperms/common/node/factory/NodeFactory.java b/common/src/main/java/me/lucko/luckperms/common/node/factory/NodeFactory.java
index 9b948e3a1..28db72d14 100644
--- a/common/src/main/java/me/lucko/luckperms/common/node/factory/NodeFactory.java
+++ b/common/src/main/java/me/lucko/luckperms/common/node/factory/NodeFactory.java
@@ -38,6 +38,8 @@ import java.util.Map;
* Utility class to make Node(Builder) instances from strings or existing Nodes
*/
public final class NodeFactory {
+ private NodeFactory() {}
+
public static final String DEFAULT_GROUP_NAME = "default";
public static Node.Builder builder(String s) {
@@ -344,6 +346,4 @@ public final class NodeFactory {
return sb;
}
- private NodeFactory() {}
-
}
diff --git a/common/src/main/java/me/lucko/luckperms/common/node/model/NodeTypes.java b/common/src/main/java/me/lucko/luckperms/common/node/model/NodeTypes.java
index 9fc6476f8..dc5b5c6d5 100644
--- a/common/src/main/java/me/lucko/luckperms/common/node/model/NodeTypes.java
+++ b/common/src/main/java/me/lucko/luckperms/common/node/model/NodeTypes.java
@@ -52,6 +52,7 @@ import java.util.Optional;
import java.util.regex.Pattern;
public final class NodeTypes {
+ private NodeTypes() {}
public static final String PREFIX_KEY = "prefix";
public static final String SUFFIX_KEY = "suffix";
@@ -509,6 +510,4 @@ public final class NodeTypes {
}
}
- private NodeTypes() {}
-
}
diff --git a/common/src/main/java/me/lucko/luckperms/common/node/utils/NodeTools.java b/common/src/main/java/me/lucko/luckperms/common/node/utils/NodeTools.java
index d892a4805..df194b7a3 100644
--- a/common/src/main/java/me/lucko/luckperms/common/node/utils/NodeTools.java
+++ b/common/src/main/java/me/lucko/luckperms/common/node/utils/NodeTools.java
@@ -37,6 +37,7 @@ import java.util.Set;
import java.util.function.Predicate;
public final class NodeTools {
+ private NodeTools() {}
public static void removeEqual(Iterator it, NodeEqualityPredicate equalityPredicate) {
List alreadyIn = new ArrayList<>();
@@ -78,5 +79,4 @@ public final class NodeTools {
return localizedNode -> delegate.test(localizedNode.getNode());
}
- private NodeTools() {}
}
diff --git a/common/src/main/java/me/lucko/luckperms/common/node/utils/ShorthandParser.java b/common/src/main/java/me/lucko/luckperms/common/node/utils/ShorthandParser.java
index b327515eb..78b80ce2d 100644
--- a/common/src/main/java/me/lucko/luckperms/common/node/utils/ShorthandParser.java
+++ b/common/src/main/java/me/lucko/luckperms/common/node/utils/ShorthandParser.java
@@ -38,6 +38,8 @@ import java.util.stream.Collectors;
import java.util.stream.IntStream;
public final class ShorthandParser {
+ private ShorthandParser() {}
+
private static final List>> PARSERS = ImmutableList.>>builder()
.add(new ListParser())
.add(new CharacterRangeParser())
@@ -169,6 +171,4 @@ public final class ShorthandParser {
}
}
- private ShorthandParser() {}
-
}
diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/implementation/custom/CustomStorageProviders.java b/common/src/main/java/me/lucko/luckperms/common/storage/implementation/custom/CustomStorageProviders.java
index 77fa438a9..2377c3f04 100644
--- a/common/src/main/java/me/lucko/luckperms/common/storage/implementation/custom/CustomStorageProviders.java
+++ b/common/src/main/java/me/lucko/luckperms/common/storage/implementation/custom/CustomStorageProviders.java
@@ -29,6 +29,8 @@ package me.lucko.luckperms.common.storage.implementation.custom;
* Hook to allow external code to provide a storage dao
*/
public final class CustomStorageProviders {
+ private CustomStorageProviders() {}
+
private static CustomStorageProvider provider = null;
public static void register(CustomStorageProvider provider) {
@@ -43,6 +45,4 @@ public final class CustomStorageProviders {
return provider;
}
- private CustomStorageProviders() {}
-
}
diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/misc/DataConstraints.java b/common/src/main/java/me/lucko/luckperms/common/storage/misc/DataConstraints.java
index 8032beff7..de0d215bb 100644
--- a/common/src/main/java/me/lucko/luckperms/common/storage/misc/DataConstraints.java
+++ b/common/src/main/java/me/lucko/luckperms/common/storage/misc/DataConstraints.java
@@ -29,6 +29,7 @@ import java.util.function.Predicate;
import java.util.regex.Pattern;
public final class DataConstraints {
+ private DataConstraints() {}
public static final int MAX_PERMISSION_LENGTH = 200;
@@ -59,6 +60,4 @@ public final class DataConstraints {
public static final Predicate WORLD_NAME_TEST = s -> !s.isEmpty() && s.length() <= MAX_WORLD_LENGTH;
- private DataConstraints() {}
-
}
diff --git a/common/src/main/java/me/lucko/luckperms/common/util/DateParser.java b/common/src/main/java/me/lucko/luckperms/common/util/DateParser.java
index a3a72bfec..c05ab48df 100644
--- a/common/src/main/java/me/lucko/luckperms/common/util/DateParser.java
+++ b/common/src/main/java/me/lucko/luckperms/common/util/DateParser.java
@@ -39,6 +39,8 @@ import java.util.stream.Stream;
* see: https://github.com/drtshock/Essentials/blob/2.x/Essentials/src/com/earth2me/essentials/utils/DateUtil.java
*/
public final class DateParser {
+ private DateParser() {}
+
private static final Pattern TIME_PATTERN = Pattern.compile(Stream.of("y", "mo", "w", "d", "h", "m").map(i -> "(?:([0-9]+)\\s*" + i + "[a-z]*[,\\s]*)?").collect(Collectors.joining()) + "(?:([0-9]+)\\s*(?:s[a-z]*)?)?", Pattern.CASE_INSENSITIVE);
private static final int MAX_YEARS = 100000;
@@ -130,6 +132,4 @@ public final class DateParser {
return (c.getTimeInMillis() / 1000) + 1;
}
- private DateParser() {}
-
}
\ No newline at end of file
diff --git a/common/src/main/java/me/lucko/luckperms/common/util/ExpiringSet.java b/common/src/main/java/me/lucko/luckperms/common/util/ExpiringSet.java
index 8c8401030..3ff953fc1 100644
--- a/common/src/main/java/me/lucko/luckperms/common/util/ExpiringSet.java
+++ b/common/src/main/java/me/lucko/luckperms/common/util/ExpiringSet.java
@@ -26,7 +26,6 @@
package me.lucko.luckperms.common.util;
import com.github.benmanes.caffeine.cache.Cache;
-import com.github.benmanes.caffeine.cache.Caffeine;
import com.google.common.collect.ForwardingSet;
import org.checkerframework.checker.nullness.qual.NonNull;
@@ -45,7 +44,7 @@ public class ExpiringSet extends ForwardingSet {
private final Set setView;
public ExpiringSet(long duration, TimeUnit unit) {
- this.cache = Caffeine.newBuilder().expireAfterAccess(duration, unit).build();
+ this.cache = CaffeineFactory.newBuilder().expireAfterAccess(duration, unit).build();
this.setView = this.cache.asMap().keySet();
}
diff --git a/common/src/main/java/me/lucko/luckperms/common/util/ImmutableCollectors.java b/common/src/main/java/me/lucko/luckperms/common/util/ImmutableCollectors.java
index 420834244..99c0b6627 100644
--- a/common/src/main/java/me/lucko/luckperms/common/util/ImmutableCollectors.java
+++ b/common/src/main/java/me/lucko/luckperms/common/util/ImmutableCollectors.java
@@ -37,6 +37,7 @@ import java.util.function.Function;
import java.util.stream.Collector;
public final class ImmutableCollectors {
+ private ImmutableCollectors() {}
private static final Collector