Code cleanup (#1461)
* Code cleanup * Fix flux tests * Fix checkstyle errors * Fix compile error
This commit is contained in:
@ -35,7 +35,7 @@ public class Fruit {
|
||||
ORANGE, APPLE, LEMON
|
||||
}
|
||||
|
||||
private FruitType type;
|
||||
private final FruitType type;
|
||||
|
||||
public Fruit(FruitType type) {
|
||||
this.type = type;
|
||||
|
@ -31,7 +31,7 @@ import java.util.List;
|
||||
*/
|
||||
public class FruitBowl {
|
||||
|
||||
private List<Fruit> fruit = new ArrayList<>();
|
||||
private final List<Fruit> fruit = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Returns the amount of fruits left in bowl.
|
||||
|
@ -31,7 +31,7 @@ public class FruitShop {
|
||||
/**
|
||||
* The FruitBowl instances stored in the class.
|
||||
*/
|
||||
private FruitBowl[] bowls = {
|
||||
private final FruitBowl[] bowls = {
|
||||
new FruitBowl(),
|
||||
new FruitBowl(),
|
||||
new FruitBowl()
|
||||
@ -40,7 +40,7 @@ public class FruitShop {
|
||||
/**
|
||||
* Access flags for each of the FruitBowl instances.
|
||||
*/
|
||||
private boolean[] available = {
|
||||
private final boolean[] available = {
|
||||
true,
|
||||
true,
|
||||
true
|
||||
@ -49,7 +49,7 @@ public class FruitShop {
|
||||
/**
|
||||
* The Semaphore that controls access to the class resources.
|
||||
*/
|
||||
private Semaphore semaphore;
|
||||
private final Semaphore semaphore;
|
||||
|
||||
/**
|
||||
* FruitShop constructor.
|
||||
|
Reference in New Issue
Block a user