From e25492f5f71b4ad4e09e485fe46b5dd60a568994 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Mon, 29 Feb 2016 17:37:56 +0100 Subject: Remove redundant explicit type declaration --- src/ch/epfl/xblast/server/Board.java | 4 ++-- src/ch/epfl/xblast/server/Ticks.java | 12 +++++------ test/ch/epfl/xblast/server/BoardTest.java | 34 +++++++++++++++---------------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/ch/epfl/xblast/server/Board.java b/src/ch/epfl/xblast/server/Board.java index 62cfd0a..5e899f6 100644 --- a/src/ch/epfl/xblast/server/Board.java +++ b/src/ch/epfl/xblast/server/Board.java @@ -111,14 +111,14 @@ public final class Board { List> rowsList = new ArrayList<>(); - List> halfInnerBoard = Lists.>mirrored(quadrantNWBlocks); + List> halfInnerBoard = Lists.mirrored(quadrantNWBlocks); for (int i = 0; i < halfInnerBoard.size(); i++) { if (halfInnerBoard.get(i).size() != 7) { throw new IllegalArgumentException(); } - rowsList.add(Lists.mirrored(halfInnerBoard.get(i))); + rowsList.add(Lists.mirrored(halfInnerBoard.get(i))); } return ofInnerBlocksWalled(rowsList); } diff --git a/src/ch/epfl/xblast/server/Ticks.java b/src/ch/epfl/xblast/server/Ticks.java index c19f073..aa08a23 100644 --- a/src/ch/epfl/xblast/server/Ticks.java +++ b/src/ch/epfl/xblast/server/Ticks.java @@ -11,31 +11,31 @@ public interface Ticks { /** * Duration of the death of a player (in ticks). */ - public static int PLAYER_DYING_TICKS = 8; + int PLAYER_DYING_TICKS = 8; /** * Duration of the invulnerability of a player (in ticks). */ - public static int PLAYER_INVULNERABLE_TICKS = 64; + int PLAYER_INVULNERABLE_TICKS = 64; /** * Duration of the timer of a bomb (in ticks). */ - public static int BOMB_FUSE_TICKS = 100; + int BOMB_FUSE_TICKS = 100; /** * Duration of an explosion (in ticks). */ - public static int EXPLOSION_TICKS = 30; + int EXPLOSION_TICKS = 30; /** * Duration of crumbling of a wall (in ticks). */ - public static int WALL_CRUMBLING_TICKS = EXPLOSION_TICKS; + int WALL_CRUMBLING_TICKS = EXPLOSION_TICKS; /** * Duration of the presence of a bonus (in ticks). */ - public static int BONUS_DISAPPEARING_TICKS = EXPLOSION_TICKS; + int BONUS_DISAPPEARING_TICKS = EXPLOSION_TICKS; } diff --git a/test/ch/epfl/xblast/server/BoardTest.java b/test/ch/epfl/xblast/server/BoardTest.java index e40769b..673ab3b 100644 --- a/test/ch/epfl/xblast/server/BoardTest.java +++ b/test/ch/epfl/xblast/server/BoardTest.java @@ -14,14 +14,14 @@ import static org.junit.Assert.*; public class BoardTest { @Test(expected=IllegalArgumentException.class) public void isBoardBuilderEmptyInputThrowingException() { - List> blocks = new ArrayList>(); + List> blocks = new ArrayList<>(); new Board(blocks); } @Test(expected=IllegalArgumentException.class) public void isBoardBuilderIllegalInputThrowingException() { - List> blocks = new ArrayList>(); + List> blocks = new ArrayList<>(); for (int i = 0;i<8;i++) { blocks.add(Sq.constant(Block.FREE)); @@ -33,14 +33,14 @@ public class BoardTest { @Test(expected=IllegalArgumentException.class) public void isOfRowsEmptyInputMatrixThrowingException() { - List> rowsList = new ArrayList>(); + List> rowsList = new ArrayList<>(); Board.ofRows(rowsList); } @Test(expected=IllegalArgumentException.class) public void isOfRowsIllegalInputThrowingException() { - List> rowsList = new ArrayList>(); - List sampleRow = new ArrayList(); + List> rowsList = new ArrayList<>(); + List sampleRow = new ArrayList<>(); for (int i = 0;i < 8 ;i++) { sampleRow.add(Block.FREE); @@ -52,10 +52,10 @@ public class BoardTest { @Test public void buildBoardFromRowsMatrix() { - List> rowsList = new ArrayList>() ; + List> rowsList = new ArrayList<>() ; for (int i = 0; i < 13; i++) { - List sampleRow = new ArrayList(); + List sampleRow = new ArrayList<>(); for (int j = 0; j < 15; j++) { sampleRow.add(Block.FREE); } @@ -67,14 +67,14 @@ public class BoardTest { @Test(expected=IllegalArgumentException.class) public void isOfInnerBlocksWalledEmptyInputMatrixThrowingException() { - List> rowsList = new ArrayList>(); + List> rowsList = new ArrayList<>(); Board.ofInnerBlocksWalled(rowsList); } @Test(expected=IllegalArgumentException.class) public void isOfInnerBlocksWalledIllegalInputThrowingException() { - List> rowsList = new ArrayList>(); - List sampleRow = new ArrayList(); + List> rowsList = new ArrayList<>(); + List sampleRow = new ArrayList<>(); for (int i = 0;i < 8 ;i++) { sampleRow.add(Block.FREE); @@ -86,10 +86,10 @@ public class BoardTest { @Test public void buildBoardFromInnerBlocks() { - List> rowsList = new ArrayList>() ; + List> rowsList = new ArrayList<>() ; for (int i = 0; i < 11; i++) { - List sampleRow = new ArrayList(); + List sampleRow = new ArrayList<>(); for (int j = 0; j < 13; j++) { sampleRow.add(Block.FREE); } @@ -101,14 +101,14 @@ public class BoardTest { @Test(expected=IllegalArgumentException.class) public void isBuildWithEmptyQuadrantThrowingException() { - List> rowsList = new ArrayList>(); + List> rowsList = new ArrayList<>(); Board.ofQuadrantNWBlocksWalled(rowsList); } @Test(expected=IllegalArgumentException.class) public void isBuildWithIllegalQuadrantThrowingException() { - List> rowsList = new ArrayList>(); - List sampleRow = new ArrayList(); + List> rowsList = new ArrayList<>(); + List sampleRow = new ArrayList<>(); for (int i = 0;i < 8 ;i++) { sampleRow.add(Block.FREE); @@ -120,10 +120,10 @@ public class BoardTest { @Test public void buildBoardFromNWQuadrant() { - List> rowsList = new ArrayList>() ; + List> rowsList = new ArrayList<>() ; for (int i = 0; i < 6; i++) { - List sampleRow = new ArrayList(); + List sampleRow = new ArrayList<>(); for (int j = 0; j < 7; j++) { sampleRow.add(Block.FREE); } -- cgit v1.2.3