Ignore:
Timestamp:
09/18/11 13:55:15 (8 months ago)
Author:
xeraph
Branch:
default
Convert:
svn:7c3792e6-d75b-4784-96a6-b298f655ee64/trunk@2777
Message:
  • fixed potential handle leak bugs.
  • added missing license terms
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kraken-linux-api/src/main/java/org/krakenapps/linux/api/ArpCache.java

    r156 r343  
    2626        } 
    2727 
    28         public static List<ArpEntry> getEntries() { 
     28        public static List<ArpEntry> getEntries() throws FileNotFoundException { 
    2929                List<ArpEntry> entries = new ArrayList<ArpEntry>(); 
    3030 
    31                 Scanner scanner; 
     31                Scanner scanner = null; 
    3232                try { 
    3333                        scanner = new Scanner(new File("/proc/net/arp")); 
     
    9696                        } 
    9797 
    98                 } catch (FileNotFoundException e) { 
     98                } finally { 
     99                        if (scanner != null) 
     100                                scanner.close(); 
    99101                } 
    100102 
Note: See TracChangeset for help on using the changeset viewer.