add final for params, local variables, and fields (#7084)
This commit is contained in:
@@ -29,18 +29,18 @@ public class OnDiskQueue extends AbstractQueue<byte[]> implements CloseableQueue
|
||||
private final AtomicBoolean closed = new AtomicBoolean(false);
|
||||
private final Path persistencePath;
|
||||
|
||||
public OnDiskQueue(Path persistencePath, String queueName) throws IOException {
|
||||
public OnDiskQueue(final Path persistencePath, final String queueName) throws IOException {
|
||||
this.persistencePath = persistencePath;
|
||||
queue = new BigQueueImpl(persistencePath.toString(), queueName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean offer(byte[] bytes) {
|
||||
public boolean offer(final byte[] bytes) {
|
||||
Preconditions.checkState(!closed.get());
|
||||
try {
|
||||
queue.enqueue(bytes);
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
} catch (final IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,7 @@ public class OnDiskQueue extends AbstractQueue<byte[]> implements CloseableQueue
|
||||
Preconditions.checkState(!closed.get());
|
||||
try {
|
||||
return queue.dequeue();
|
||||
} catch (IOException e) {
|
||||
} catch (final IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,7 @@ public class OnDiskQueue extends AbstractQueue<byte[]> implements CloseableQueue
|
||||
Preconditions.checkState(!closed.get());
|
||||
try {
|
||||
return queue.peek();
|
||||
} catch (IOException e) {
|
||||
} catch (final IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ class OnDiskQueueTest {
|
||||
}
|
||||
|
||||
@SuppressWarnings("SameParameterValue")
|
||||
private static byte[] toBytes(String string) {
|
||||
private static byte[] toBytes(final String string) {
|
||||
return string.getBytes(Charsets.UTF_8);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user