1
0
mirror of synced 2026-01-06 06:04:16 -05:00

add final for params, local variables, and fields (#7084)

This commit is contained in:
Charles
2021-10-15 16:41:04 -07:00
committed by GitHub
parent 592f7fe2b2
commit ba44f700b9
747 changed files with 5815 additions and 5580 deletions

View File

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

View File

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