mirror of
https://github.com/magefree/mage.git
synced 2026-01-24 04:09:54 -08:00
Merge branches 'hotfix/close-unclosed-resources-mage-client', 'hotfix/close-streams-in-updater', 'hotfix/fix-non-closed-scanner' and 'hotfix/manapiechart-potential-zero-division' into feature/SonarqubeFixes
This commit is contained in:
commit
4bc5a9bd61
6 changed files with 61 additions and 19 deletions
|
|
@ -957,10 +957,11 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ {
|
|||
}
|
||||
|
||||
protected final void getSuggestedActions() {
|
||||
Scanner scanner = null;
|
||||
try {
|
||||
File file = new File(FILE_WITH_INSTRUCTIONS);
|
||||
if (file.exists()) {
|
||||
Scanner scanner = new Scanner(file);
|
||||
scanner = new Scanner(file);
|
||||
while (scanner.hasNextLine()) {
|
||||
String line = scanner.nextLine();
|
||||
if (line.startsWith("cast:")
|
||||
|
|
@ -976,6 +977,10 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ {
|
|||
} catch (Exception e) {
|
||||
// swallow
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if(scanner != null) {
|
||||
scanner.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue