← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18559: Live. Try with resources for scanner

 

------------------------------------------------------------
revno: 18559
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-03-10 13:22:35 +0100
message:
  Live. Try with resources for scanner
modified:
  dhis-live/src/main/java/org/hisp/dhis/WebAppServer.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-live/src/main/java/org/hisp/dhis/WebAppServer.java'
--- dhis-live/src/main/java/org/hisp/dhis/WebAppServer.java	2014-11-26 15:44:28 +0000
+++ dhis-live/src/main/java/org/hisp/dhis/WebAppServer.java	2015-03-10 12:22:35 +0000
@@ -62,8 +62,7 @@
             throws Exception {
         
         int port;
-        try {
-            Scanner scanner = new Scanner(new File(installDir + JETTY_PORT_CONF));
+        try (Scanner scanner = new Scanner(new File(installDir + JETTY_PORT_CONF))) {
             port = scanner.nextInt();
             log.info("Loading DHIS 2 on port: " + port);
         } catch (Exception ex) {