diff options
author | Abhishek Koneru <akoneru@redhat.com> | 2012-05-18 16:12:17 -0400 |
---|---|---|
committer | Ade Lee <alee@redhat.com> | 2012-05-24 23:08:51 -0400 |
commit | 9db76ed1d1f8969e93aaff320e49662f53688e2e (patch) | |
tree | 2e7af87ca0f72cdf4eb982764757d2884b21ce7b /base/common/src/com/netscape/cmscore/dbs/RevocationInfoMapper.java | |
parent | a4db0f39e257950a5c89203452c1184c7080e5bd (diff) | |
download | pki-9db76ed1d1f8969e93aaff320e49662f53688e2e.tar.gz pki-9db76ed1d1f8969e93aaff320e49662f53688e2e.tar.xz pki-9db76ed1d1f8969e93aaff320e49662f53688e2e.zip |
Fixes for Coverity Defects of Category : FB.SBSC_USE_STRINGBUFFER_CONCATENATION
Diffstat (limited to 'base/common/src/com/netscape/cmscore/dbs/RevocationInfoMapper.java')
-rw-r--r-- | base/common/src/com/netscape/cmscore/dbs/RevocationInfoMapper.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/base/common/src/com/netscape/cmscore/dbs/RevocationInfoMapper.java b/base/common/src/com/netscape/cmscore/dbs/RevocationInfoMapper.java index 396067c79..2b9bca3d5 100644 --- a/base/common/src/com/netscape/cmscore/dbs/RevocationInfoMapper.java +++ b/base/common/src/com/netscape/cmscore/dbs/RevocationInfoMapper.java @@ -66,11 +66,12 @@ public class RevocationInfoMapper implements IDBAttrMapper { throws EBaseException { try { // in format of <date>;<extensions> - String value = ""; + StringBuffer value = new StringBuffer(); + RevocationInfo info = (RevocationInfo) obj; Date d = info.getRevocationDate(); - value = DateMapper.dateToDB(d); + value.append(DateMapper.dateToDB(d)); CRLExtensions exts = info.getCRLEntryExtensions(); // CRLExtension's DER encoding and decoding does not work! // That is why we need to do our own serialization. @@ -83,20 +84,20 @@ public class RevocationInfoMapper implements IDBAttrMapper { RevocationReason reason = ((CRLReasonExtension) ext).getReason(); - value = value + ";CRLReasonExtension=" + - Integer.toString(reason.toInt()); + value.append(";CRLReasonExtension=" + + Integer.toString(reason.toInt())); } else if (ext instanceof InvalidityDateExtension) { Date invalidityDate = ((InvalidityDateExtension) ext).getInvalidityDate(); - value = value + ";InvalidityDateExtension=" + - DateMapper.dateToDB(invalidityDate); + value.append(";InvalidityDateExtension=" + + DateMapper.dateToDB(invalidityDate)); } else { Debug.trace("XXX skipped extension"); } } attrs.add(new LDAPAttribute(CertDBSchema.LDAP_ATTR_REVO_INFO, - value)); + value.toString())); } catch (Exception e) { Debug.trace(e.toString()); throw new EDBException( |