mirror of
https://github.com/magefree/mage.git
synced 2025-12-27 22:12:03 -08:00
Sonar cleanups 03032019
This commit is contained in:
parent
f46f321635
commit
45f665eb1d
13 changed files with 37 additions and 41 deletions
|
|
@ -121,10 +121,8 @@ public enum ServerMessagesUtil {
|
|||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
Scanner scanner = null;
|
||||
List<String> newMessages = new ArrayList<>();
|
||||
try {
|
||||
scanner = new Scanner(is);
|
||||
try(Scanner scanner = new Scanner(is)) {
|
||||
while (scanner.hasNextLine()) {
|
||||
String message = scanner.nextLine();
|
||||
if (!message.trim().isEmpty()) {
|
||||
|
|
@ -134,7 +132,6 @@ public enum ServerMessagesUtil {
|
|||
} catch (Exception e) {
|
||||
log.error(e, e);
|
||||
} finally {
|
||||
StreamUtils.closeQuietly(scanner);
|
||||
StreamUtils.closeQuietly(is);
|
||||
}
|
||||
return newMessages;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue