# HG changeset patch # User ascarpino # Date 1402435052 25200 # Node ID a7bf63ebda64ebb4c7274ca823ea96f17806e70a # Parent bf6df3caafe4a1d27890db06ba4c9b1eaf6bf337 8046368: Code cleanup in SeedGenerator.java Reviewed-by: mullan Contributed-by: Jamil Nimeh diff -r bf6df3caafe4 -r a7bf63ebda64 jdk/src/share/classes/sun/security/provider/SeedGenerator.java --- a/jdk/src/share/classes/sun/security/provider/SeedGenerator.java Tue Jun 10 12:04:42 2014 -0700 +++ b/jdk/src/share/classes/sun/security/provider/SeedGenerator.java Tue Jun 10 14:17:32 2014 -0700 @@ -150,14 +150,13 @@ * Retrieve some system information, hashed. */ static byte[] getSystemEntropy() { - byte[] ba; final MessageDigest md; try { md = MessageDigest.getInstance("SHA"); } catch (NoSuchAlgorithmException nsae) { - throw new InternalError("internal error: SHA-1 not available." - , nsae); + throw new InternalError("internal error: SHA-1 not available.", + nsae); } // The current time in millis @@ -170,11 +169,8 @@ public Void run() { try { // System properties can change from machine to machine - String s; Properties p = System.getProperties(); - Enumeration e = p.propertyNames(); - while (e.hasMoreElements()) { - s =(String)e.nextElement(); + for (String s: p.stringPropertyNames()) { md.update(s.getBytes()); md.update(p.getProperty(s).getBytes()); }