diff options
author | Adam Domurad <[email protected]> | 2012-06-19 10:26:44 -0400 |
---|---|---|
committer | Adam Domurad <[email protected]> | 2012-06-19 10:26:44 -0400 |
commit | 668f5e025a7dc811acaec6a7a3ab54fb134d5c33 (patch) | |
tree | c8f68362649df6c39b2a95c1e71804c433218719 /netx/net/sourceforge/jnlp/tools | |
parent | e1d385c63a7c72dce1286f5d6386004d77352386 (diff) |
Refactored two loops to for-each loops in JCV
Diffstat (limited to 'netx/net/sourceforge/jnlp/tools')
-rw-r--r-- | netx/net/sourceforge/jnlp/tools/JarCertVerifier.java | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/netx/net/sourceforge/jnlp/tools/JarCertVerifier.java b/netx/net/sourceforge/jnlp/tools/JarCertVerifier.java index f98241d..4e9757d 100644 --- a/netx/net/sourceforge/jnlp/tools/JarCertVerifier.java +++ b/netx/net/sourceforge/jnlp/tools/JarCertVerifier.java @@ -183,9 +183,7 @@ public class JarCertVerifier implements CertVerifier { verifiedJars = new ArrayList<String>(); unverifiedJars = new ArrayList<String>(); - for (int i = 0; i < jars.size(); i++) { - - JARDesc jar = jars.get(i); + for (JARDesc jar : jars) { try { @@ -242,10 +240,9 @@ public class JarCertVerifier implements CertVerifier { Vector<JarEntry> entriesVec = new Vector<JarEntry>(); byte[] buffer = new byte[8192]; - JarEntry je; Enumeration<JarEntry> entries = jarFile.entries(); while (entries.hasMoreElements()) { - je = entries.nextElement(); + JarEntry je = entries.nextElement(); entriesVec.addElement(je); InputStream is = jarFile.getInputStream(je); @@ -265,12 +262,10 @@ public class JarCertVerifier implements CertVerifier { if (jarFile.getManifest() != null) { if (verbose) System.out.println(); - Enumeration<JarEntry> e = entriesVec.elements(); long now = System.currentTimeMillis(); - while (e.hasMoreElements()) { - je = e.nextElement(); + for (JarEntry je : entriesVec) { String name = je.getName(); CodeSigner[] signers = je.getCodeSigners(); boolean isSigned = (signers != null); @@ -352,7 +347,6 @@ public class JarCertVerifier implements CertVerifier { addToDetails(R("SNotYetValidCert")); } } - } catch (Exception e) { e.printStackTrace(); throw e; |