mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-12-29 12:37:40 +01:00
Run some auto code inspections
This commit is contained in:
parent
0729be0f0a
commit
497846e5a6
@ -78,6 +78,7 @@ public class ReflectionClassLoader implements PluginClassLoader {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("JavaReflectionMemberAccess")
|
||||
private static boolean isJava9OrNewer() {
|
||||
try {
|
||||
// method was added in the Java 9 release
|
||||
|
@ -70,7 +70,7 @@ public abstract class AbstractFileWatcher implements AutoCloseable {
|
||||
private final boolean autoRegisterNewSubDirectories;
|
||||
|
||||
/** The thread currently being used to wait for & process watch events */
|
||||
private AtomicReference<Thread> processingThread = new AtomicReference<>();
|
||||
private final AtomicReference<Thread> processingThread = new AtomicReference<>();
|
||||
|
||||
public AbstractFileWatcher(FileSystem fileSystem, boolean autoRegisterNewSubDirectories) throws IOException {
|
||||
this.service = fileSystem.newWatchService();
|
||||
|
@ -103,19 +103,6 @@ public class TreeNode {
|
||||
});
|
||||
}
|
||||
|
||||
public TreeNode forceInsert(String s) {
|
||||
Map<String, TreeNode> childMap = getChildMap();
|
||||
return childMap.compute(s, (key, prev) -> {
|
||||
if (prev != null) {
|
||||
return prev;
|
||||
}
|
||||
|
||||
// dirty the cache & return a new node
|
||||
this.cachedDeepSize = Integer.MIN_VALUE;
|
||||
return new TreeNode(this);
|
||||
});
|
||||
}
|
||||
|
||||
public Optional<Map<String, TreeNode>> getChildren() {
|
||||
return Optional.ofNullable(this.children);
|
||||
}
|
||||
|
@ -169,11 +169,10 @@ public final class SubjectDataProxy implements SubjectData, ProxiedServiceObject
|
||||
public boolean setOption(@NonNull Set<Context> contexts, @NonNull String key, String value) {
|
||||
if (value == null) {
|
||||
handle().thenCompose(handle -> handle.unsetOption(CompatibilityUtil.convertContexts(contexts), key));
|
||||
return true;
|
||||
} else {
|
||||
handle().thenCompose(handle -> handle.setOption(CompatibilityUtil.convertContexts(contexts), key, value));
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user