File tree Expand file tree Collapse file tree 4 files changed +7
-7
lines changed
thread-pool/src/main/java/com/iluwatar Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 77 */
88public class CoffeeMakingTask extends Task {
99
10- private static int TIME_PER_CUP = 300 ;
10+ private static final int TIME_PER_CUP = 300 ;
1111
1212 public CoffeeMakingTask (int numCups ) {
1313 super (numCups * TIME_PER_CUP );
Original file line number Diff line number Diff line change 77 */
88public class PotatoPeelingTask extends Task {
99
10- private static int TIME_PER_POTATO = 500 ;
10+ private static final int TIME_PER_POTATO = 500 ;
1111
1212 public PotatoPeelingTask (int numPotatoes ) {
1313 super (numPotatoes * TIME_PER_POTATO );
Original file line number Diff line number Diff line change @@ -9,10 +9,10 @@ public abstract class Task {
99
1010 private static int nextId = 1 ;
1111
12- private int id ;
13- private int timeMs ;
12+ private final int id ;
13+ private final int timeMs ;
1414
15- public Task (int timeMs ) {
15+ public Task (final int timeMs ) {
1616 this .id = nextId ++;
1717 this .timeMs = timeMs ;
1818 }
Original file line number Diff line number Diff line change 77 */
88public class Worker implements Runnable {
99
10- private Task task ;
10+ private final Task task ;
1111
12- public Worker (Task task ) {
12+ public Worker (final Task task ) {
1313 this .task = task ;
1414 }
1515
You can’t perform that action at this time.
0 commit comments