code cleanup, lombok update to 1.88.22 due some compile issues with a new JDK
This commit is contained in:
parent
f72416b49a
commit
ed24bc0df1
2
pom.xml
2
pom.xml
@ -24,7 +24,7 @@
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.18</version>
|
||||
<version>1.18.22</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@ -10,10 +10,10 @@ import lombok.Getter;
|
||||
* @author steam
|
||||
*
|
||||
* this is a general command implementation.
|
||||
*
|
||||
* <p>
|
||||
* The arguments as {@link String} is intentionally, to be flexible
|
||||
* define some different argument formats.
|
||||
*
|
||||
* <p>
|
||||
* Use some kind of {@link List} for arguments in futher implementations.
|
||||
*/
|
||||
|
||||
@ -27,9 +27,9 @@ public class Command {
|
||||
public static final String PLACE = "PLACE";
|
||||
public static final String REPORT = "REPORT";
|
||||
|
||||
private String command;
|
||||
private final String command;
|
||||
|
||||
private Optional<String> arguments;
|
||||
private final Optional<String> arguments;
|
||||
|
||||
public Command(final String command, Optional<String> arguments) {
|
||||
this.command = command;
|
||||
|
@ -14,8 +14,8 @@ import lombok.ToString;
|
||||
@ToString
|
||||
@EqualsAndHashCode
|
||||
public class Position {
|
||||
private int x;
|
||||
private int y;
|
||||
private final int x;
|
||||
private final int y;
|
||||
|
||||
public Position() {
|
||||
this.x = 0;
|
||||
|
@ -11,8 +11,8 @@ import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public class ToyBotField {
|
||||
private int width = 4;
|
||||
private int height = 4;
|
||||
private final int width = 4;
|
||||
private final int height = 4;
|
||||
|
||||
public boolean isInsideTheField(final Position position) {
|
||||
return (position.getX() >= 0 &&
|
||||
|
@ -13,7 +13,7 @@ import de.dj_steam.bot.domain.ToyBot;
|
||||
*/
|
||||
public class DirectionCalculator {
|
||||
|
||||
private LoopedDirectionsArrayList<Direction> directions;
|
||||
private final LoopedDirectionsArrayList<Direction> directions;
|
||||
|
||||
public DirectionCalculator() {
|
||||
directions = new LoopedDirectionsArrayList();
|
||||
|
@ -12,7 +12,7 @@ import de.dj_steam.bot.moving.DirectionCalculator;
|
||||
*/
|
||||
public class TurnStrategy implements ChangingStrategy {
|
||||
|
||||
private DirectionCalculator directionCalculator;
|
||||
private final DirectionCalculator directionCalculator;
|
||||
|
||||
public TurnStrategy() {
|
||||
directionCalculator = new DirectionCalculator();
|
||||
|
@ -15,12 +15,12 @@ public class LoopingConsoleTest {
|
||||
|
||||
|
||||
@Test(expected = InvalidUserInputException.class)
|
||||
public void createCommandExpectedUserInputExceptionOnEmptyInput() throws Exception {
|
||||
public void createCommandExpectedUserInputExceptionOnEmptyInput() {
|
||||
LoopingConsole.createCommand("");
|
||||
}
|
||||
|
||||
@Test(expected = InvalidUserInputException.class)
|
||||
public void createCommandExpectedUserInputExceptionOnMoreThenTwoParams() throws Exception {
|
||||
public void createCommandExpectedUserInputExceptionOnMoreThenTwoParams() {
|
||||
LoopingConsole.createCommand("INPUT X,Y,F WRONG_PARAM");
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@ import org.junit.Test;
|
||||
*/
|
||||
public class ToyBotFieldTest {
|
||||
@Test
|
||||
public void isInsideTheField() throws Exception {
|
||||
public void isInsideTheField() {
|
||||
ToyBotField toyBotField = new ToyBotField();
|
||||
assertTrue(toyBotField.isInsideTheField(new Position(0,0)));
|
||||
assertTrue(toyBotField.isInsideTheField(new Position(4,4)));
|
||||
|
@ -26,7 +26,7 @@ public class ToyBotEngineTest {
|
||||
private Command moveCommand;
|
||||
private Command placeCommand;
|
||||
|
||||
private ToyBotField toyBotField = new ToyBotField();
|
||||
private final ToyBotField toyBotField = new ToyBotField();
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
|
Loading…
Reference in New Issue
Block a user