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

@ -35,7 +35,7 @@ public class Fruit {
ORANGE, APPLE, LEMON
}
private FruitType type;
private final FruitType type;
public Fruit(FruitType type) {
this.type = type;

View File

@ -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.

View File

@ -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.