Fix some Android Studio warnings.

This commit is contained in:
Peter Osterlund
2019-03-17 11:23:43 +01:00
parent bd99154def
commit eaadffa6b0
87 changed files with 652 additions and 659 deletions

View File

@@ -127,7 +127,7 @@ public class ChessBoardPainter extends JLabel {
}
}
private final void drawPiece(Graphics2D g, int xCrd, int yCrd, int p) {
private void drawPiece(Graphics2D g, int xCrd, int yCrd, int p) {
g.setColor(Piece.isWhite(p) ? Color.WHITE : Color.BLACK);
String ps;
switch (p) {
@@ -195,10 +195,10 @@ public class ChessBoardPainter extends JLabel {
}
}
private final int getXCrd(int x) {
private int getXCrd(int x) {
return x0 + sqSize * (flipped ? 7 - x : x);
}
private final int getYCrd(int y) {
private int getYCrd(int y) {
return y0 + sqSize * (flipped ? y : (7 - y));
}

View File

@@ -275,7 +275,7 @@ public class EngineControl {
engineThread.start();
}
private final void stopThread() {
private void stopThread() {
Thread myThread;
Search mySearch;
synchronized (threadMutex) {
@@ -295,13 +295,13 @@ public class EngineControl {
}
private final void setupTT() {
private void setupTT() {
int nEntries = hashSizeMB > 0 ? hashSizeMB * (1 << 20) / 24 : 1024;
int logSize = (int) Math.floor(Math.log(nEntries) / Math.log(2));
tt = new TranspositionTable(logSize);
}
private final void setupPosition(Position pos, List<Move> moves) {
private void setupPosition(Position pos, List<Move> moves) {
UndoInfo ui = new UndoInfo();
posHashList = new long[200 + moves.size()];
posHashListSize = 0;
@@ -315,7 +315,7 @@ public class EngineControl {
/**
* Try to find a move to ponder from the transposition table.
*/
private final Move getPonderMove(Position pos, Move m) {
private Move getPonderMove(Position pos, Move m) {
if (m == null) return null;
Move ret = null;
UndoInfo ui = new UndoInfo();

View File

@@ -37,6 +37,6 @@ public class SearchParams {
boolean infinite;
public SearchParams() {
searchMoves = new ArrayList<Move>();
searchMoves = new ArrayList<>();
}
}

View File

@@ -50,7 +50,7 @@ public class UCIProtocol {
public UCIProtocol() {
pos = null;
moves = new ArrayList<Move>();
moves = new ArrayList<>();
quit = false;
}