changeset 10068:e313c083fbb6

8046368: Code cleanup in SeedGenerator.java Reviewed-by: mullan Contributed-by: Jamil Nimeh <jamil.j.nimeh@oracle.com>
author ascarpino
date Tue, 10 Jun 2014 14:17:32 -0700
parents 7b404a7be697
children aa7632edb50c
files src/share/classes/sun/security/provider/SeedGenerator.java
diffstat 1 files changed, 3 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/security/provider/SeedGenerator.java	Tue Jun 10 12:04:42 2014 -0700
+++ b/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());
                         }