Skip to content

Commit d66447b

Browse files
committed
fix Checkstyle violations
1 parent 9fae236 commit d66447b

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

type-object/src/main/java/com/iluwatar/typeobject/App.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
2-
* This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt).
2+
* This project is licensed under the MIT license. Module model-view-viewmodel
3+
* is using ZK framework licensed under LGPL (see lgpl-3.0.txt).
34
*
45
* The MIT License
56
* Copyright © 2014-2022 Ilkka Seppälä
@@ -27,12 +28,12 @@
2728
import lombok.extern.slf4j.Slf4j;
2829

2930
/**
30-
* <p>Type object pattern is the pattern we use when the OOP concept of creating a base class and
31+
* Type object pattern is the pattern we use when the OOP concept of creating a base class and
3132
* inheriting from it just doesn't work for the case in hand. This happens when we either don't know
3233
* what types we will need upfront, or want to be able to modify or add new types conveniently w/o
3334
* recompiling repeatedly. The pattern provides a solution by allowing flexible creation of required
34-
* objects by creating one class, which has a field which represents the 'type' of the object.</p>
35-
* <p>In this example, we have a mini candy-crush game in action. There are many different candies
35+
* objects by creating one class, which has a field which represents the 'type' of the object.
36+
* In this example, we have a mini candy-crush game in action. There are many different candies
3637
* in the game, which may change over time, as we may want to upgrade the game. To make the object
3738
* creation convenient, we have a class {@link Candy} which has a field name, parent, points and
3839
* Type. We have a json file {@link candy} which contains the details about the candies, and this is
@@ -41,7 +42,7 @@
4142
* how crushing can be done, how the matrix is to be reconfigured and how points are to be gained.
4243
* The {@link CellPool} class is a pool which reuses the candy cells that have been crushed instead
4344
* of making new ones repeatedly. The {@link CandyGame} class has the rules for the continuation of
44-
* the game and the {@link App} class has the game itself.</p>
45+
* the game and the {@link App} class has the game itself.
4546
*/
4647

4748
@Slf4j

type-object/src/main/java/com/iluwatar/typeobject/CandyGame.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,10 @@
2727
import com.iluwatar.typeobject.Candy.Type;
2828
import java.util.ArrayList;
2929
import java.util.List;
30+
import lombok.extern.slf4j.Slf4j;
3031
import org.slf4j.Logger;
3132
import org.slf4j.LoggerFactory;
3233

33-
import lombok.extern.slf4j.Slf4j;
34-
3534
/**
3635
* The CandyGame class contains the rules for the continuation of the game and has the game matrix
3736
* (field 'cells') and totalPoints gained during the game.
@@ -88,11 +87,11 @@ List<Cell> adjacentCells(int y, int x) {
8887
adjacent.add(this.cells[y][1]);
8988
}
9089
if (y == cells.length - 1 && cells.length > 1) {
91-
adjacent.add(this.cells[cells.length - 2][x]);
90+
adjacent.add(this.cells[cells.length - 2][x]);
9291
}
9392

9493
if (x == cells.length - 1 && cells.length > 1) {
95-
adjacent.add(this.cells[y][cells.length - 2]);
94+
adjacent.add(this.cells[y][cells.length - 2]);
9695
}
9796

9897

@@ -103,7 +102,7 @@ List<Cell> adjacentCells(int y, int x) {
103102
if (y >= 0 && y < cells.length && x > 0 && x < cells[y].length - 1) {
104103
adjacent.add(this.cells[y][x - 1]);
105104
adjacent.add(this.cells[y][x + 1]);
106-
}
105+
}
107106
return adjacent;
108107
}
109108

0 commit comments

Comments
 (0)