Run some auto code inspections

This commit is contained in:
Luck committed 2020-03-26 17:01:55 +00:00
1 parent 0729be0f0a
commit 497846e5a6
4 files changed
+3 -16

No files matched your search

@@ -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