diff options
author | Ade Lee <alee@redhat.com> | 2014-01-28 11:21:44 -0500 |
---|---|---|
committer | Ade Lee <alee@redhat.com> | 2014-02-04 13:36:46 -0500 |
commit | fb77f3ce9f04dcaf6719497bd75edb076dd106b6 (patch) | |
tree | 1762c377bada7a8092e0645289481b5844a91863 | |
parent | 1b59b9cb9a9c3cae2eb904305fa6f3899d3dc820 (diff) | |
download | pki-fb77f3ce9f04dcaf6719497bd75edb076dd106b6.tar.gz pki-fb77f3ce9f04dcaf6719497bd75edb076dd106b6.tar.xz pki-fb77f3ce9f04dcaf6719497bd75edb076dd106b6.zip |
Fix some errors flagged by eclipse
4 files changed, 14 insertions, 11 deletions
diff --git a/base/java-tools/src/com/netscape/cmstools/AuditVerify.java b/base/java-tools/src/com/netscape/cmstools/AuditVerify.java index fb92cf12c..82323ab09 100644 --- a/base/java-tools/src/com/netscape/cmstools/AuditVerify.java +++ b/base/java-tools/src/com/netscape/cmstools/AuditVerify.java @@ -164,6 +164,7 @@ public class AuditVerify { logFiles.addElement(((String) tok.nextElement()).trim()); } } + r.close(); if (logFiles.size() == 0) { System.out.println("Error: no log files listed in " + logListFile); System.exit(1); @@ -297,7 +298,7 @@ public class AuditVerify { sigStopLine = linenum; sigStopFile = curfileName; } - + br.close(); } // Make sure there were no unsigned log entries at the end. diff --git a/base/server/cms/src/com/netscape/cms/authentication/UserPwdDirAuthentication.java b/base/server/cms/src/com/netscape/cms/authentication/UserPwdDirAuthentication.java index c5f0611a2..7bcab25d3 100644 --- a/base/server/cms/src/com/netscape/cms/authentication/UserPwdDirAuthentication.java +++ b/base/server/cms/src/com/netscape/cms/authentication/UserPwdDirAuthentication.java @@ -257,8 +257,8 @@ public class UserPwdDirAuthentication extends DirBasedAuthentication /** * Retrieves a list of names of the value parameter. */ - public Enumeration getValueNames() { - Vector v = new Vector(); + public Enumeration<String> getValueNames() { + Vector<String> v = new Vector<String>(); v.addElement(mAttr); v.addElement(CRED_PWD); diff --git a/base/util/src/netscape/security/x509/CRLExtensions.java b/base/util/src/netscape/security/x509/CRLExtensions.java index 9c844cd3d..d9eaffd89 100755 --- a/base/util/src/netscape/security/x509/CRLExtensions.java +++ b/base/util/src/netscape/security/x509/CRLExtensions.java @@ -150,7 +150,7 @@ public class CRLExtensions extends Vector<Extension> { */ public void encode(OutputStream out, boolean isExplicit) throws CRLException { - try { + try (DerOutputStream tmp = new DerOutputStream()) { // #381559 if (size() == 0) return; @@ -168,14 +168,13 @@ public class CRLExtensions extends Vector<Extension> { DerOutputStream seq = new DerOutputStream(); seq.write(DerValue.tag_Sequence, extOut); - DerOutputStream tmp = new DerOutputStream(); - if (isExplicit) + if (isExplicit) { tmp.write(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0), seq); - else - tmp = seq; - - out.write(tmp.toByteArray()); + out.write(tmp.toByteArray()); + } else { + out.write(seq.toByteArray()); + } } catch (IOException e) { throw new CRLException("Encoding error: " + e.toString()); } catch (CertificateException e) { diff --git a/base/util/src/netscape/security/x509/EDIPartyName.java b/base/util/src/netscape/security/x509/EDIPartyName.java index def86ffa5..0efb1c59c 100644 --- a/base/util/src/netscape/security/x509/EDIPartyName.java +++ b/base/util/src/netscape/security/x509/EDIPartyName.java @@ -131,8 +131,11 @@ public class EDIPartyName implements GeneralNameInterface { tagged.write(DerValue.createTag(DerValue.TAG_CONTEXT, false, TAG_ASSIGNER), tmp2); } - if (party == null) + if (party == null) { + tagged.close(); + tmp.close(); throw new IOException("Cannot have null partyName"); + } // XXX - shd check is chars fit into PrintableString tmp.putPrintableString(party); |