Run some auto code inspections

This commit is contained in:
Luck 2020-03-26 17:01:55 +00:00
parent 0729be0f0a
commit 497846e5a6
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
4 changed files with 3 additions and 16 deletions

View File

@ -78,6 +78,7 @@ public class ReflectionClassLoader implements PluginClassLoader {
}
}
@SuppressWarnings("JavaReflectionMemberAccess")
private static boolean isJava9OrNewer() {
try {
// method was added in the Java 9 release

View File

@ -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();

View File

@ -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);
}

View File

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