Code cleanup (#1461)

* Code cleanup

* Fix flux tests

* Fix checkstyle errors

* Fix compile error
This commit is contained in:
Ilkka Seppälä
2020-07-30 20:28:47 +03:00
committed by GitHub
parent 5381387026
commit 417f21ed3d
243 changed files with 1154 additions and 1162 deletions

View File

@ -32,7 +32,7 @@ import java.util.Map;
*/
public class InMemoryBank implements WireTransfers {
private static Map<String, Integer> accounts = new HashMap<>();
private static final Map<String, Integer> accounts = new HashMap<>();
static {
accounts

View File

@ -34,7 +34,7 @@ import java.util.Optional;
*/
public class InMemoryTicketRepository implements LotteryTicketRepository {
private static Map<LotteryTicketId, LotteryTicket> tickets = new HashMap<>();
private static final Map<LotteryTicketId, LotteryTicket> tickets = new HashMap<>();
@Override
public Optional<LotteryTicket> findById(LotteryTicketId id) {

View File

@ -116,7 +116,7 @@ public class LotteryNumbers {
*/
private static class RandomNumberGenerator {
private PrimitiveIterator.OfInt randomIterator;
private final PrimitiveIterator.OfInt randomIterator;
/**
* Initialize a new random number generator that generates random numbers in the range [min,

View File

@ -30,7 +30,7 @@ import java.util.concurrent.atomic.AtomicInteger;
*/
public class LotteryTicketId {
private static AtomicInteger numAllocated = new AtomicInteger(0);
private static final AtomicInteger numAllocated = new AtomicInteger(0);
private final int id;
public LotteryTicketId() {

View File

@ -41,7 +41,7 @@ public class MongoEventLog implements LotteryEventLog {
private MongoDatabase database;
private MongoCollection<Document> eventsCollection;
private StdOutEventLog stdOutEventLog = new StdOutEventLog();
private final StdOutEventLog stdOutEventLog = new StdOutEventLog();
/**
* Constructor.

View File

@ -43,7 +43,7 @@ import org.junit.jupiter.api.Test;
*/
class LotteryTest {
private Injector injector;
private final Injector injector;
@Inject
private LotteryAdministration administration;
@Inject