Fix warnings in eclipse

Close scanner instead of doing it with a warning

Make the scanner final..
This commit is contained in:
TheJulianJES 2015-05-09 22:23:09 +02:00 committed by PetaByteBoy
parent 064acc21ee
commit 34f78a7ce4
2 changed files with 11 additions and 3 deletions

View File

@ -86,7 +86,11 @@ public final class VersionParser
{
assert PATTERN_VALID_REVISION.matcher( rawRevision ).matches();
final int revision = new Scanner( rawRevision ).useDelimiter( PATTERN_REVISION ).nextInt();
final Scanner scanner = new Scanner( rawRevision );
final int revision = scanner.useDelimiter( PATTERN_REVISION ).nextInt();
scanner.close();
return revision;
}
@ -124,7 +128,11 @@ public final class VersionParser
{
assert PATTERN_NATURAL.matcher( rawBuild ).matches();
final int build = new Scanner( rawBuild ).useDelimiter( PATTERN_BUILD ).nextInt();
final Scanner scanner = new Scanner( rawBuild );
final int build = scanner.useDelimiter( PATTERN_BUILD ).nextInt();
scanner.close();
return build;
}

View File

@ -4,7 +4,7 @@ package appeng.services.version.github;
/**
* Template class for Gson to write values from the Json Object into an actual class
*/
@SuppressWarnings( "ALL" )
@SuppressWarnings( "all" )
public class Release
{
/**