diff --git a/nifi/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/TestListHDFS.java b/nifi/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/TestListHDFS.java index 499fd51132..c0b7c1e1a3 100644 --- a/nifi/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/TestListHDFS.java +++ b/nifi/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/TestListHDFS.java @@ -25,7 +25,7 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.net.URI; import java.util.HashMap; -import java.util.HashSet; +import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; @@ -191,12 +191,12 @@ public class TestListHDFS { } @Override - protected FileSystem getFileSystem(Configuration config) throws IOException { + protected FileSystem getFileSystem(final Configuration config) throws IOException { return fileSystem; } @Override - protected void persistLocalState(String directory, String serializedState) throws IOException { + protected void persistLocalState(final String directory, final String serializedState) throws IOException { super.persistLocalState(directory, serializedState); localStateSaved = true; } @@ -209,7 +209,7 @@ public class TestListHDFS { public void addFileStatus(final Path parent, final FileStatus child) { Set children = fileStatuses.get(parent); if ( children == null ) { - children = new HashSet<>(); + children = new LinkedHashSet<>(); fileStatuses.put(parent, children); } @@ -233,32 +233,32 @@ public class TestListHDFS { } @Override - public FSDataInputStream open(Path f, int bufferSize) throws IOException { + public FSDataInputStream open(final Path f, final int bufferSize) throws IOException { return null; } @Override - public FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException { + public FSDataOutputStream create(final Path f, final FsPermission permission, final boolean overwrite, final int bufferSize, final short replication, final long blockSize, final Progressable progress) throws IOException { return null; } @Override - public FSDataOutputStream append(Path f, int bufferSize, Progressable progress) throws IOException { + public FSDataOutputStream append(final Path f, final int bufferSize, final Progressable progress) throws IOException { return null; } @Override - public boolean rename(Path src, Path dst) throws IOException { + public boolean rename(final Path src, final Path dst) throws IOException { return false; } @Override - public boolean delete(Path f, boolean recursive) throws IOException { + public boolean delete(final Path f, final boolean recursive) throws IOException { return false; } @Override - public FileStatus[] listStatus(Path f) throws FileNotFoundException, IOException { + public FileStatus[] listStatus(final Path f) throws FileNotFoundException, IOException { final Set statuses = fileStatuses.get(f); if ( statuses == null ) { return new FileStatus[0]; @@ -268,7 +268,7 @@ public class TestListHDFS { } @Override - public void setWorkingDirectory(Path new_dir) { + public void setWorkingDirectory(final Path new_dir) { } @@ -278,12 +278,12 @@ public class TestListHDFS { } @Override - public boolean mkdirs(Path f, FsPermission permission) throws IOException { + public boolean mkdirs(final Path f, final FsPermission permission) throws IOException { return false; } @Override - public FileStatus getFileStatus(Path f) throws IOException { + public FileStatus getFileStatus(final Path f) throws IOException { return null; } @@ -291,7 +291,7 @@ public class TestListHDFS { private class MockCacheClient extends AbstractControllerService implements DistributedMapCacheClient { - private ConcurrentMap values = new ConcurrentHashMap<>(); + private final ConcurrentMap values = new ConcurrentHashMap<>(); private boolean failOnCalls = false; private void verifyNotFail() throws IOException { @@ -301,7 +301,7 @@ public class TestListHDFS { } @Override - public boolean putIfAbsent(K key, V value, Serializer keySerializer, Serializer valueSerializer) throws IOException { + public boolean putIfAbsent(final K key, final V value, final Serializer keySerializer, final Serializer valueSerializer) throws IOException { verifyNotFail(); final Object retValue = values.putIfAbsent(key, value); return (retValue == null); @@ -309,26 +309,26 @@ public class TestListHDFS { @Override @SuppressWarnings("unchecked") - public V getAndPutIfAbsent(K key, V value, Serializer keySerializer, Serializer valueSerializer, Deserializer valueDeserializer) throws IOException { + public V getAndPutIfAbsent(final K key, final V value, final Serializer keySerializer, final Serializer valueSerializer, final Deserializer valueDeserializer) throws IOException { verifyNotFail(); return (V) values.putIfAbsent(key, value); } @Override - public boolean containsKey(K key, Serializer keySerializer) throws IOException { + public boolean containsKey(final K key, final Serializer keySerializer) throws IOException { verifyNotFail(); return values.containsKey(key); } @Override - public void put(K key, V value, Serializer keySerializer, Serializer valueSerializer) throws IOException { + public void put(final K key, final V value, final Serializer keySerializer, final Serializer valueSerializer) throws IOException { verifyNotFail(); values.put(key, value); } @Override @SuppressWarnings("unchecked") - public V get(K key, Serializer keySerializer, Deserializer valueDeserializer) throws IOException { + public V get(final K key, final Serializer keySerializer, final Deserializer valueDeserializer) throws IOException { verifyNotFail(); return (V) values.get(key); } @@ -338,7 +338,7 @@ public class TestListHDFS { } @Override - public boolean remove(K key, Serializer serializer) throws IOException { + public boolean remove(final K key, final Serializer serializer) throws IOException { verifyNotFail(); values.remove(key); return true;