DroidFish: Fixed compiler warnings.

This commit is contained in:
Peter Osterlund
2015-03-13 21:43:57 +01:00
parent 7ac35ae42b
commit ed6ebbd4ab
9 changed files with 27 additions and 14 deletions

View File

@@ -81,9 +81,9 @@ public final class TreeLogger {
/** Get a logger object set up for analyzing a log file. */
public static final TreeLogger getAnalyzer(String filename) {
RandomAccessFile raf = null;
try {
TreeLogger log = new TreeLogger();
RandomAccessFile raf;
raf = new RandomAccessFile(filename, "rw");
log.fc = raf.getChannel();
long len = raf.length();
@@ -95,6 +95,8 @@ public final class TreeLogger {
throw new RuntimeException();
} catch (IOException e) {
throw new RuntimeException();
} finally {
if (raf != null) try { raf.close(); } catch (IOException e) {}
}
}

View File

@@ -268,6 +268,7 @@ public class ChessController {
}
}
pgn = out.toString();
sc.close();
}
// Parse tag section
@@ -315,6 +316,7 @@ public class ChessController {
}
// Parse move text section
sc.close();
sc = new Scanner(pgn);
sc.useDelimiter("\\s+");
while (sc.hasNext()) {
@@ -326,6 +328,7 @@ public class ChessController {
break;
game.processString(strMove);
}
sc.close();
}
public void setFENOrPGN(String fenPgn) throws ChessParseError {