Code cleanup (#1461)
* Code cleanup * Fix flux tests * Fix checkstyle errors * Fix compile error
This commit is contained in:
@ -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
|
||||
|
@ -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) {
|
||||
|
@ -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,
|
||||
|
@ -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() {
|
||||
|
@ -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.
|
||||
|
@ -43,7 +43,7 @@ import org.junit.jupiter.api.Test;
|
||||
*/
|
||||
class LotteryTest {
|
||||
|
||||
private Injector injector;
|
||||
private final Injector injector;
|
||||
@Inject
|
||||
private LotteryAdministration administration;
|
||||
@Inject
|
||||
|
Reference in New Issue
Block a user