summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--base/ca/src/com/netscape/ca/CRLIssuingPoint.java27
-rw-r--r--base/common/src/com/netscape/certsrv/acls/ACLEntry.java2
-rw-r--r--base/common/src/com/netscape/certsrv/base/MetaInfo.java4
-rw-r--r--base/common/src/com/netscape/cms/servlet/admin/PublisherAdminServlet.java2
-rw-r--r--base/common/src/com/netscape/cmscore/cert/PrettyPrintFormat.java3
-rw-r--r--base/common/src/com/netscape/cmscore/dbs/CertRecord.java3
-rw-r--r--base/common/src/com/netscape/cmscore/dbs/DBRegistry.java1
-rw-r--r--base/common/src/com/netscape/cmscore/ldap/LdapRule.java15
-rw-r--r--base/common/src/com/netscape/cmscore/ldap/PublisherProcessor.java6
-rw-r--r--base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java2
-rw-r--r--base/common/src/com/netscape/cmscore/realm/PKIJNDIRealm.java4
-rw-r--r--base/common/src/com/netscape/cmscore/security/JssSubsystem.java10
-rw-r--r--base/common/src/com/netscape/cmscore/security/PWsdrCache.java7
-rw-r--r--base/common/src/com/netscape/cmscore/usrgrp/UGSubsystem.java3
-rw-r--r--base/java-tools/src/com/netscape/cmstools/CMCRequest.java8
-rw-r--r--base/java-tools/src/com/netscape/cmstools/DRMTool.java4
-rw-r--r--base/java-tools/src/com/netscape/cmstools/PasswordCache.java6
-rw-r--r--base/java-tools/src/com/netscape/cmstools/PrettyPrintCrl.java2
-rw-r--r--base/silent/src/com/netscape/pkisilent/common/ComCrypto.java6
-rw-r--r--base/silent/src/com/netscape/pkisilent/common/ServerInfo.java1
-rw-r--r--base/silent/src/com/netscape/pkisilent/common/UserEnroll.java1
-rw-r--r--base/silent/src/com/netscape/pkisilent/common/Utilities.java5
-rw-r--r--base/util/src/com/netscape/cmsutil/crypto/CryptoUtil.java12
-rw-r--r--base/util/src/netscape/security/extensions/ExtendedKeyUsageExtension.java1
-rw-r--r--base/util/src/netscape/security/extensions/OCSPNoCheckExtension.java2
-rw-r--r--base/util/src/netscape/security/pkcs/PKCS7.java18
-rw-r--r--base/util/src/netscape/security/x509/Attribute.java3
-rw-r--r--base/util/src/netscape/security/x509/GeneralSubtrees.java2
-rw-r--r--base/util/src/netscape/security/x509/IPAddressName.java3
-rw-r--r--base/util/src/netscape/security/x509/PolicyQualifiers.java3
-rwxr-xr-xbase/util/src/netscape/security/x509/RevokedCertImpl.java4
-rwxr-xr-xbase/util/src/netscape/security/x509/X509CRLImpl.java9
-rwxr-xr-xbase/util/src/netscape/security/x509/X509CertImpl.java6
-rw-r--r--base/util/src/netscape/security/x509/X509CertInfo.java15
34 files changed, 84 insertions, 116 deletions
diff --git a/base/ca/src/com/netscape/ca/CRLIssuingPoint.java b/base/ca/src/com/netscape/ca/CRLIssuingPoint.java
index 29bb1d1a1..ff61970f9 100644
--- a/base/ca/src/com/netscape/ca/CRLIssuingPoint.java
+++ b/base/ca/src/com/netscape/ca/CRLIssuingPoint.java
@@ -2483,8 +2483,7 @@ public class CRLIssuingPoint implements ICRLIssuingPoint, Runnable {
mDeltaCRLSize = deltaCRLCerts.size();
long totalTime = 0;
- StringBuffer splitTimes = new StringBuffer();
- splitTimes.append(" (");
+ StringBuffer splitTimes = new StringBuffer(" (");
for (int i = 1; i < mSplits.length && i < 5; i++) {
totalTime += mSplits[i];
if (i > 1)
@@ -2493,18 +2492,18 @@ public class CRLIssuingPoint implements ICRLIssuingPoint, Runnable {
}
splitTimes.append(")");
mLogger.log(ILogger.EV_AUDIT, ILogger.S_OTHER,
- AuditFormat.LEVEL,
- CMS.getLogMessage("CMSCORE_CA_CA_DELTA_CRL_UPDATED"),
- new Object[] {
- getId(),
- getNextCRLNumber(),
- getCRLNumber(),
- getLastUpdate(),
- getNextDeltaUpdate(),
- Long.toString(mDeltaCRLSize),
- Long.toString(totalTime) + splitTimes.toString()
- }
- );
+ AuditFormat.LEVEL,
+ CMS.getLogMessage("CMSCORE_CA_CA_DELTA_CRL_UPDATED"),
+ new Object[] {
+ getId(),
+ getNextCRLNumber(),
+ getCRLNumber(),
+ getLastUpdate(),
+ getNextDeltaUpdate(),
+ Long.toString(mDeltaCRLSize),
+ Long.toString(totalTime) + splitTimes.toString()
+ }
+ );
} catch (EBaseException e) {
log(ILogger.LL_FAILURE, CMS.getLogMessage("CMSCORE_CA_ISSUING_SIGN_OR_STORE_DELTA", e.toString()));
mDeltaCRLSize = -1;
diff --git a/base/common/src/com/netscape/certsrv/acls/ACLEntry.java b/base/common/src/com/netscape/certsrv/acls/ACLEntry.java
index 76924ed93..ca08fb551 100644
--- a/base/common/src/com/netscape/certsrv/acls/ACLEntry.java
+++ b/base/common/src/com/netscape/certsrv/acls/ACLEntry.java
@@ -239,7 +239,7 @@ public class ACLEntry implements IACLEntry, java.io.Serializable {
if (e.hasMoreElements())
entry.append(",");
}
- entry.append(") ").append(getAttributeExpressions());
+ entry.append(") " + getAttributeExpressions());
return entry.toString();
}
}
diff --git a/base/common/src/com/netscape/certsrv/base/MetaInfo.java b/base/common/src/com/netscape/certsrv/base/MetaInfo.java
index 64f9fe821..514c5c64e 100644
--- a/base/common/src/com/netscape/certsrv/base/MetaInfo.java
+++ b/base/common/src/com/netscape/certsrv/base/MetaInfo.java
@@ -53,10 +53,8 @@ public class MetaInfo implements IAttrSet {
* @return information about this certificate attribute.
*/
public String toString() {
- StringBuffer sb = new StringBuffer();
+ StringBuffer sb = new StringBuffer("[\n" + " Meta information:\n");
- sb.append("[\n");
- sb.append(" Meta information:\n");
Enumeration<String> enum1 = content.keys();
while (enum1.hasMoreElements()) {
diff --git a/base/common/src/com/netscape/cms/servlet/admin/PublisherAdminServlet.java b/base/common/src/com/netscape/cms/servlet/admin/PublisherAdminServlet.java
index 0d1ab7eb5..7d06ee5ae 100644
--- a/base/common/src/com/netscape/cms/servlet/admin/PublisherAdminServlet.java
+++ b/base/common/src/com/netscape/cms/servlet/admin/PublisherAdminServlet.java
@@ -3016,7 +3016,7 @@ public class PublisherAdminServlet extends AdminServlet {
StringBuffer buffer = new StringBuffer(s[0]);
if (s.length > 1) {
for (int i = 1; i < s.length; i++) {
- buffer.append(delimiter).append(s[i].trim());
+ buffer.append(delimiter + s[i].trim());
}
}
return buffer.toString();
diff --git a/base/common/src/com/netscape/cmscore/cert/PrettyPrintFormat.java b/base/common/src/com/netscape/cmscore/cert/PrettyPrintFormat.java
index 7b7ce64f9..60bc8c8f6 100644
--- a/base/common/src/com/netscape/cmscore/cert/PrettyPrintFormat.java
+++ b/base/common/src/com/netscape/cmscore/cert/PrettyPrintFormat.java
@@ -107,7 +107,7 @@ public class PrettyPrintFormat implements IPrettyPrintFormat {
if (in == null) return "";
- StringBuffer sb = new StringBuffer();
+ StringBuffer sb = new StringBuffer(indent(indentSize));
int hexCount = 0;
char c[];
int j = 0;
@@ -120,7 +120,6 @@ public class PrettyPrintFormat implements IPrettyPrintFormat {
char sep = separator.charAt(0);
- sb.append(indent(indentSize));
for (int i = 0; i < in.length; i++) {
if (lineLen > 0 && hexCount == lineLen) {
c[j++] = '\n';
diff --git a/base/common/src/com/netscape/cmscore/dbs/CertRecord.java b/base/common/src/com/netscape/cmscore/dbs/CertRecord.java
index b70c8cd36..422d506d5 100644
--- a/base/common/src/com/netscape/cmscore/dbs/CertRecord.java
+++ b/base/common/src/com/netscape/cmscore/dbs/CertRecord.java
@@ -274,9 +274,8 @@ public class CertRecord implements IDBObj, ICertRecord {
* String representation
*/
public String toString() {
- StringBuffer buf = new StringBuffer();
+ StringBuffer buf = new StringBuffer("CertRecord: ");
- buf.append("CertRecord: ");
if (getSerialNumber() != null)
buf.append(" " + getSerialNumber().toString());
return buf.toString();
diff --git a/base/common/src/com/netscape/cmscore/dbs/DBRegistry.java b/base/common/src/com/netscape/cmscore/dbs/DBRegistry.java
index 250ebf394..63b00b6bf 100644
--- a/base/common/src/com/netscape/cmscore/dbs/DBRegistry.java
+++ b/base/common/src/com/netscape/cmscore/dbs/DBRegistry.java
@@ -272,6 +272,7 @@ public class DBRegistry implements IDBRegistry, ISubsystem {
*/
private String inStringFormat(Vector<String> v){
StringBuffer result = new StringBuffer();
+
for (int i = 0; i < v.size(); i++) {
result.append(v.elementAt(i));
}
diff --git a/base/common/src/com/netscape/cmscore/ldap/LdapRule.java b/base/common/src/com/netscape/cmscore/ldap/LdapRule.java
index eaf5e763a..2fb148492 100644
--- a/base/common/src/com/netscape/cmscore/ldap/LdapRule.java
+++ b/base/common/src/com/netscape/cmscore/ldap/LdapRule.java
@@ -66,20 +66,20 @@ public class LdapRule implements ILdapRule, IExtendedPluginInfo {
mProcessor = processor;
Enumeration<String> mappers = mProcessor.getMapperInsts().keys();
Enumeration<String> publishers = mProcessor.getPublisherInsts().keys();
- StringBuffer map=new StringBuffer();
+ StringBuffer map = new StringBuffer();
map.append(NOMAPPER);
for (; mappers.hasMoreElements();) {
String name = mappers.nextElement();
- map.append(",").append(name);
+ map.append("," + name);
}
StringBuffer publish = new StringBuffer();
for (; publishers.hasMoreElements();) {
String name = publishers.nextElement();
- publish.append(",").append(name);
+ publish.append("," + name);
}
epi_params = new String[] {
@@ -176,21 +176,20 @@ public class LdapRule implements ILdapRule, IExtendedPluginInfo {
*
* Enumeration<String> mappers = mProcessor.getMapperInsts().keys();
Enumeration<String> publishers = mProcessor.getPublisherInsts().keys();
- StringBuffer map=new StringBuffer();
+ StringBuffer map = new StringBuffer();
map.append(NOMAPPER);
for (; mappers.hasMoreElements();) {
String name = mappers.nextElement();
- map.append(",").append(name);
+ map.append("," + name);
}
- StringBuffer publish=new StringBuffer();
-
+ StringBuffer publish = new StringBuffer();
for (; publishers.hasMoreElements();) {
String name = publishers.nextElement();
- publish.append(",").append(name);
+ publish.append("," + name);
}*/
/*
diff --git a/base/common/src/com/netscape/cmscore/ldap/PublisherProcessor.java b/base/common/src/com/netscape/cmscore/ldap/PublisherProcessor.java
index e5aef45a5..62e4b8bef 100644
--- a/base/common/src/com/netscape/cmscore/ldap/PublisherProcessor.java
+++ b/base/common/src/com/netscape/cmscore/ldap/PublisherProcessor.java
@@ -955,7 +955,7 @@ public class PublisherProcessor implements
// continue publishing even publisher has errors
//log(ILogger.LL_WARN, e.toString());
error = true;
- errorRule.append(" ").append(rule.getInstanceName());
+ errorRule.append(" " + rule.getInstanceName());
}
}
@@ -1072,7 +1072,7 @@ public class PublisherProcessor implements
// continue publishing even publisher has errors
//log(ILogger.LL_WARN, e.toString());
error = true;
- errorRule.append(" ").append(rule.getInstanceName());
+ errorRule.append(" " + rule.getInstanceName());
}
}
// set the ldap published flag.
@@ -1138,7 +1138,7 @@ public class PublisherProcessor implements
// continue publishing even publisher has errors
//log(ILogger.LL_WARN, e.toString());
error = true;
- errorRule.append(" ").append(rule.getInstanceName());
+ errorRule.append(" " + rule.getInstanceName());
}
}
diff --git a/base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java b/base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java
index 1be949183..53d4fa14a 100644
--- a/base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java
+++ b/base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java
@@ -160,7 +160,7 @@ public class ProfileSubsystem implements IProfileSubsystem {
String element = tokenizer.nextToken();
if (!element.equals(id)) {
- list.append(element).append(",");
+ list.append(element + ",");
}
}
if (list.length() != 0)
diff --git a/base/common/src/com/netscape/cmscore/realm/PKIJNDIRealm.java b/base/common/src/com/netscape/cmscore/realm/PKIJNDIRealm.java
index 685c1e5f4..abd27fddf 100644
--- a/base/common/src/com/netscape/cmscore/realm/PKIJNDIRealm.java
+++ b/base/common/src/com/netscape/cmscore/realm/PKIJNDIRealm.java
@@ -495,7 +495,7 @@ public class PKIJNDIRealm extends JNDIRealm {
if (orIndex == -1 && andIndex == -1) {
boolean passed = evaluateExpression(principal, s.trim());
- v.addElement(passed);
+ v.addElement(Boolean.valueOf(passed));
break;
// || first
@@ -511,7 +511,7 @@ public class PKIJNDIRealm extends JNDIRealm {
String s1 = s.substring(0, andIndex);
boolean passed = evaluateExpression(principal, s1.trim());
- v.addElement(passed);
+ v.addElement(Boolean.valueOf(passed));
v.addElement("&&");
s = s.substring(andIndex + 2);
}
diff --git a/base/common/src/com/netscape/cmscore/security/JssSubsystem.java b/base/common/src/com/netscape/cmscore/security/JssSubsystem.java
index 2d6fe7d88..12bf8d95a 100644
--- a/base/common/src/com/netscape/cmscore/security/JssSubsystem.java
+++ b/base/common/src/com/netscape/cmscore/security/JssSubsystem.java
@@ -539,7 +539,7 @@ public final class JssSubsystem implements ICryptoSubsystem {
if (tokenList.length()==0)
return Constants.PR_INTERNAL_TOKEN;
else
- return tokenList.append(",").append(Constants.PR_INTERNAL_TOKEN).toString();
+ return tokenList.append("," + Constants.PR_INTERNAL_TOKEN).toString();
}
public boolean isTokenLoggedIn(String name) throws EBaseException {
@@ -610,9 +610,11 @@ public final class JssSubsystem implements ICryptoSubsystem {
for (int i = 0; i < list.length; i++) {
String nickname = list[i].getNickname();
- if (i > 0)
- certNames.append(",");
- certNames.append(nickname);
+ if (certNames.length() < 1) {
+ certNames.append(nickname);
+ } else {
+ certNames.append("," + nickname);
+ }
}
}
} catch (TokenException e) {
diff --git a/base/common/src/com/netscape/cmscore/security/PWsdrCache.java b/base/common/src/com/netscape/cmscore/security/PWsdrCache.java
index e4e8a432b..17cc9f0a7 100644
--- a/base/common/src/com/netscape/cmscore/security/PWsdrCache.java
+++ b/base/common/src/com/netscape/cmscore/security/PWsdrCache.java
@@ -230,13 +230,12 @@ public class PWsdrCache {
* add passwd in pwcache.
*/
public void addEntry(String tag, String pwd, Hashtable<String, String> tagPwds) throws EBaseException {
-
StringBuffer stringToAdd = new StringBuffer();
String bufs = null;
if (tagPwds == null) {
- stringToAdd.append(tag + ":" + pwd + System.getProperty("line.separator"));
+ stringToAdd.append(tag + ":" + pwd + "\n");
} else {
Enumeration<String> enum1 = tagPwds.keys();
@@ -245,7 +244,7 @@ public class PWsdrCache {
pwd = tagPwds.get(tag);
debug("password tag: " + tag + " stored in " + mPWcachedb);
- stringToAdd.append(tag + ":" + pwd + System.getProperty("line.separator"));
+ stringToAdd.append(tag + ":" + pwd + "\n");
}
}
@@ -438,7 +437,7 @@ public class PWsdrCache {
while (enum1.hasMoreElements()) {
String tag = enum1.nextElement();
String pwd = ht.get(tag);
- returnString.append(tag + ":" + pwd + System.getProperty("line.separator"));
+ returnString.append(tag + ":" + pwd + "\n");
}
return returnString.toString();
}
diff --git a/base/common/src/com/netscape/cmscore/usrgrp/UGSubsystem.java b/base/common/src/com/netscape/cmscore/usrgrp/UGSubsystem.java
index 382cc249c..7cca70002 100644
--- a/base/common/src/com/netscape/cmscore/usrgrp/UGSubsystem.java
+++ b/base/common/src/com/netscape/cmscore/usrgrp/UGSubsystem.java
@@ -275,8 +275,7 @@ public final class UGSubsystem implements IUGSubsystem {
hasSlash = up.indexOf('\\');
while (hasSlash != -1) {
- stripped.append(up.substring(0, hasSlash)).append(
- "\\5c");
+ stripped.append(up.substring(0, hasSlash) + "\\5c");
up = up.substring(hasSlash + 1);
hasSlash = up.indexOf('\\');
diff --git a/base/java-tools/src/com/netscape/cmstools/CMCRequest.java b/base/java-tools/src/com/netscape/cmstools/CMCRequest.java
index dc359a8b0..f1bc93f68 100644
--- a/base/java-tools/src/com/netscape/cmstools/CMCRequest.java
+++ b/base/java-tools/src/com/netscape/cmstools/CMCRequest.java
@@ -673,10 +673,9 @@ public class CMCRequest {
try {
byte bvalue[] = str.getBytes();
System.out.println("Data Return Control: ");
- StringBuffer ss = new StringBuffer();
- ss.append(" Value: ");
+ StringBuffer ss = new StringBuffer(" Value: ");
for (int m = 0; m < bvalue.length; m++) {
- ss.append(bvalue[m]).append(" ");
+ ss.append(bvalue[m] + " ");
}
System.out.println(ss.toString());
OCTET_STRING s = new OCTET_STRING(bvalue);
@@ -758,9 +757,8 @@ public class CMCRequest {
byte bb[] = sn.getBytes();
System.out.println("SenderNonce control: ");
- StringBuffer ss = new StringBuffer();
+ StringBuffer ss = new StringBuffer(" Value: ");
- ss.append(" Value: ");
for (int m = 0; m < bb.length; m++) {
ss.append(bb[m] + " ");
}
diff --git a/base/java-tools/src/com/netscape/cmstools/DRMTool.java b/base/java-tools/src/com/netscape/cmstools/DRMTool.java
index 164931d6c..bb53f1bb3 100644
--- a/base/java-tools/src/com/netscape/cmstools/DRMTool.java
+++ b/base/java-tools/src/com/netscape/cmstools/DRMTool.java
@@ -2006,7 +2006,7 @@ public class DRMTool {
}
// terminate first line
- revised_data.append(System.getProperty("line.separator"));
+ revised_data.append("\n");
// process remaining lines
int j = 0;
@@ -2020,7 +2020,7 @@ public class DRMTool {
j++;
if (j == 76) {
- revised_data.append(System.getProperty("line.separator"));
+ revised_data.append("\n");
j = 0;
}
}
diff --git a/base/java-tools/src/com/netscape/cmstools/PasswordCache.java b/base/java-tools/src/com/netscape/cmstools/PasswordCache.java
index 1e123b17a..f5b4e2c2c 100644
--- a/base/java-tools/src/com/netscape/cmstools/PasswordCache.java
+++ b/base/java-tools/src/com/netscape/cmstools/PasswordCache.java
@@ -446,7 +446,7 @@ class PWsdrCache {
String bufs = null;
if (tagPwds == null) {
- stringToAdd.append(tag + ":" + pwd + System.getProperty("line.separator"));
+ stringToAdd.append(tag + ":" + pwd + "\n");
} else {
Enumeration<String> enum1 = tagPwds.keys();
@@ -455,7 +455,7 @@ class PWsdrCache {
pwd = tagPwds.get(tag);
debug("password tag: " + tag + " stored in " + mPWcachedb);
- stringToAdd.append(tag + ":" + pwd + System.getProperty("line.separator"));
+ stringToAdd.append(tag + ":" + pwd + "\n");
}
}
@@ -672,7 +672,7 @@ class PWsdrCache {
while (enum1.hasMoreElements()) {
String tag = enum1.nextElement();
String pwd = ht.get(tag);
- returnString.append(tag + ":" + pwd + System.getProperty("line.separator"));
+ returnString.append(tag + ":" + pwd + "\n");
}
return returnString.toString();
diff --git a/base/java-tools/src/com/netscape/cmstools/PrettyPrintCrl.java b/base/java-tools/src/com/netscape/cmstools/PrettyPrintCrl.java
index 86bb82155..e9056dd48 100644
--- a/base/java-tools/src/com/netscape/cmstools/PrettyPrintCrl.java
+++ b/base/java-tools/src/com/netscape/cmstools/PrettyPrintCrl.java
@@ -73,7 +73,7 @@ public class PrettyPrintCrl {
BufferedReader inputCrl = null;
String encodedBASE64CrlChunk = "";
- StringBuffer encodedBASE64Crl = new StringBuffer(0);
+ StringBuffer encodedBASE64Crl = new StringBuffer();
byte decodedBASE64Crl[] = null;
X509CRLImpl crl = null;
diff --git a/base/silent/src/com/netscape/pkisilent/common/ComCrypto.java b/base/silent/src/com/netscape/pkisilent/common/ComCrypto.java
index 2dacaabbf..9b5cf7b52 100644
--- a/base/silent/src/com/netscape/pkisilent/common/ComCrypto.java
+++ b/base/silent/src/com/netscape/pkisilent/common/ComCrypto.java
@@ -314,12 +314,11 @@ public class ComCrypto {
*/
public String normalizeForLDAP(String s) {
-
StringBuffer val = new StringBuffer();
for (int i = 0; i < s.length(); i++) {
if ((s.charAt(i) == '\\') && (s.charAt(i + 1) == 'n')) {
- val.append(System.getProperty("line.separator") + " ");
+ val.append("\n" + " ");
i++;
continue;
} else if ((s.charAt(i) == '\\') && (s.charAt(i + 1) == 'r')) {
@@ -338,7 +337,6 @@ public class ComCrypto {
*/
public String pkcs7Convertcert(String s) {
-
StringBuffer val = new StringBuffer();
int len = s.length();
@@ -346,7 +344,7 @@ public class ComCrypto {
for (int i = 0; i < len; i = i + 64) {
if (i + 64 < len) {
- val.append(s.substring(i, i + 64)+System.getProperty("line.separator"));
+ val.append(s.substring(i, i + 64) + "\n");
} else {
val.append(s.substring(i, len));
}
diff --git a/base/silent/src/com/netscape/pkisilent/common/ServerInfo.java b/base/silent/src/com/netscape/pkisilent/common/ServerInfo.java
index 706d4ccee..637f0c1ee 100644
--- a/base/silent/src/com/netscape/pkisilent/common/ServerInfo.java
+++ b/base/silent/src/com/netscape/pkisilent/common/ServerInfo.java
@@ -243,7 +243,6 @@ public class ServerInfo {
}
private String stripSpace(String s) {
-
StringBuffer val = new StringBuffer();
for (int i = 0; i < s.length(); i++) {
diff --git a/base/silent/src/com/netscape/pkisilent/common/UserEnroll.java b/base/silent/src/com/netscape/pkisilent/common/UserEnroll.java
index 3f7f92791..0e31eeb57 100644
--- a/base/silent/src/com/netscape/pkisilent/common/UserEnroll.java
+++ b/base/silent/src/com/netscape/pkisilent/common/UserEnroll.java
@@ -299,7 +299,6 @@ public class UserEnroll extends TestClient {
}
private void buildquery() throws UnsupportedEncodingException {
-
StringBuffer queryStrBuf = new StringBuffer();
if (certType.equals("client")) {
diff --git a/base/silent/src/com/netscape/pkisilent/common/Utilities.java b/base/silent/src/com/netscape/pkisilent/common/Utilities.java
index 08c96e194..23fd2c54e 100644
--- a/base/silent/src/com/netscape/pkisilent/common/Utilities.java
+++ b/base/silent/src/com/netscape/pkisilent/common/Utilities.java
@@ -38,7 +38,6 @@ public class Utilities {
}
public String cleanupQuotes(String token) {
-
StringBuffer buf = new StringBuffer();
int length = token.length();
int curIndex = 0;
@@ -141,7 +140,7 @@ public class Utilities {
for (int i = 0; i < s.length(); i++) {
if ((s.charAt(i) == '\\') && (s.charAt(i + 1) == 'n')) {
- val.append(System.getProperty("line.separator"));
+ val.append("\n");
i++;
continue;
} else if ((s.charAt(i) == '\\') && (s.charAt(i + 1) == 'r')) {
@@ -327,7 +326,7 @@ public class Utilities {
RDN[] rdns = dname.getNames();
for (int i = rdns.length - 1; i >= 0; i--) {
- pp.append(rdns[i] + System.getProperty("line.separator"));
+ pp.append(rdns[i] + "\n");
}
cr.subject = pp.toString();
diff --git a/base/util/src/com/netscape/cmsutil/crypto/CryptoUtil.java b/base/util/src/com/netscape/cmsutil/crypto/CryptoUtil.java
index 65e5ad9b3..c54f76489 100644
--- a/base/util/src/com/netscape/cmsutil/crypto/CryptoUtil.java
+++ b/base/util/src/com/netscape/cmsutil/crypto/CryptoUtil.java
@@ -404,14 +404,14 @@ public class CryptoUtil {
*/
public static String reqFormat(String content) {
StringBuffer result = new StringBuffer();
- result.append(CERTREQ_BEGIN_HEADING + System.getProperty("line.separator"));
+ result.append(CERTREQ_BEGIN_HEADING + "\n");
while (content.length() >= LINE_COUNT) {
- result.append(content.substring(0, LINE_COUNT) + System.getProperty("line.separator"));
+ result.append(content.substring(0, LINE_COUNT) + "\n");
content = content.substring(LINE_COUNT);
}
if (content.length() > 0) {
- result.append(content).append(System.getProperty("line.separator") + CERTREQ_END_HEADING);
+ result.append(content + "\n" + CERTREQ_END_HEADING);
} else {
result.append(CERTREQ_END_HEADING);
}
@@ -465,14 +465,14 @@ public class CryptoUtil {
return "";
}
StringBuffer result = new StringBuffer();
- result.append(CERT_BEGIN_HEADING + System.getProperty("line.separator"));
+ result.append(CERT_BEGIN_HEADING + "\n");
while (content.length() >= LINE_COUNT) {
- result.append(content.substring(0, LINE_COUNT) + System.getProperty("line.separator"));
+ result.append(content.substring(0, LINE_COUNT) + "\n");
content = content.substring(LINE_COUNT);
}
if (content.length() > 0) {
- result.append(content + System.getProperty("line.separator") + CERT_END_HEADING);
+ result.append(content + "\n" + CERT_END_HEADING);
} else {
result.append(CERT_END_HEADING);
}
diff --git a/base/util/src/netscape/security/extensions/ExtendedKeyUsageExtension.java b/base/util/src/netscape/security/extensions/ExtendedKeyUsageExtension.java
index 7c9f8450d..391df90dc 100644
--- a/base/util/src/netscape/security/extensions/ExtendedKeyUsageExtension.java
+++ b/base/util/src/netscape/security/extensions/ExtendedKeyUsageExtension.java
@@ -132,7 +132,6 @@ public class ExtendedKeyUsageExtension extends Extension implements CertAttrSet
}
public String toString() {
-
String presentation = "oid=" + ExtendedKeyUsageExtension.OID + " ";
if (critical) {
diff --git a/base/util/src/netscape/security/extensions/OCSPNoCheckExtension.java b/base/util/src/netscape/security/extensions/OCSPNoCheckExtension.java
index 323cfbdbe..511255e3a 100644
--- a/base/util/src/netscape/security/extensions/OCSPNoCheckExtension.java
+++ b/base/util/src/netscape/security/extensions/OCSPNoCheckExtension.java
@@ -96,7 +96,7 @@ public class OCSPNoCheckExtension extends Extension implements CertAttrSet {
}
public String toString() {
- String presentation = "oid=" + ExtendedKeyUsageExtension.OID + " ";
+ String presentation = "oid=" + OID + " ";
if (critical) {
presentation += "critical=true";
diff --git a/base/util/src/netscape/security/pkcs/PKCS7.java b/base/util/src/netscape/security/pkcs/PKCS7.java
index b53918233..4bedc06fe 100644
--- a/base/util/src/netscape/security/pkcs/PKCS7.java
+++ b/base/util/src/netscape/security/pkcs/PKCS7.java
@@ -425,22 +425,20 @@ public class PKCS7 {
* Returns the PKCS7 block in a printable string form.
*/
public String toString() {
- StringBuffer out=new StringBuffer();
+ StringBuffer out = new StringBuffer("PKCS7 :: version: " + version + "\n");
-
- out.append("PKCS7 :: version: " + version+System.getProperty("line.separator"));
- out.append("PKCS7 :: digest AlgorithmIds: "+System.getProperty("line.separator"));
+ out.append("PKCS7 :: digest AlgorithmIds: " + "\n");
for (int i = 0; i < digestAlgorithmIds.length; i++) {
- out.append("\t" + digestAlgorithmIds[i]+System.getProperty("line.separator"));
+ out.append("\t" + digestAlgorithmIds[i] + "\n");
}
- out.append(contentInfo).append(System.getProperty("line.separator"));
- out.append("PKCS7 :: certificates: "+System.getProperty("line.separator"));
+ out.append(contentInfo + "\n");
+ out.append("PKCS7 :: certificates: " + "\n");
for (int i = 0; i < certificates.length; i++) {
- out.append("\t" + i + ". " + certificates[i]+System.getProperty("line.separator"));
+ out.append("\t" + i + ". " + certificates[i] + "\n");
}
- out.append("PKCS7 :: signer infos: "+System.getProperty("line.separator"));
+ out.append("PKCS7 :: signer infos: " + "\n");
for (int i = 0; i < signerInfos.length; i++) {
- out.append("\t" + i + ". " + signerInfos[i]+System.getProperty("line.separator"));
+ out.append("\t" + i + ". " + signerInfos[i] + "\n");
}
return out.toString();
}
diff --git a/base/util/src/netscape/security/x509/Attribute.java b/base/util/src/netscape/security/x509/Attribute.java
index 8c3fc1fbd..760d0a805 100644
--- a/base/util/src/netscape/security/x509/Attribute.java
+++ b/base/util/src/netscape/security/x509/Attribute.java
@@ -214,8 +214,7 @@ public final class Attribute implements Serializable, DerEncoder {
*/
public String toString() {
String theoid = "Attribute: " + oid + "\n";
- StringBuffer values = new StringBuffer();
- values.append("Values: ");
+ StringBuffer values = new StringBuffer("Values: ");
Enumeration<String> n = valueSet.elements();
if (n.hasMoreElements()) {
values.append(n.nextElement());
diff --git a/base/util/src/netscape/security/x509/GeneralSubtrees.java b/base/util/src/netscape/security/x509/GeneralSubtrees.java
index d24774ab4..66ccdba84 100644
--- a/base/util/src/netscape/security/x509/GeneralSubtrees.java
+++ b/base/util/src/netscape/security/x509/GeneralSubtrees.java
@@ -80,7 +80,7 @@ public class GeneralSubtrees {
for (Enumeration<GeneralSubtree> e = trees.elements(); e.hasMoreElements();) {
element = e.nextElement();
- s.append(pp.indent(indent + 4) + element.toPrint(indent) + System.getProperty("line.separator"));
+ s.append(pp.indent(indent + 4) + element.toPrint(indent) + "\n");
}
return (s.toString());
diff --git a/base/util/src/netscape/security/x509/IPAddressName.java b/base/util/src/netscape/security/x509/IPAddressName.java
index 4ff8b8a0c..bb27548a3 100644
--- a/base/util/src/netscape/security/x509/IPAddressName.java
+++ b/base/util/src/netscape/security/x509/IPAddressName.java
@@ -142,8 +142,7 @@ public class IPAddressName implements GeneralNameInterface {
+ (address[1] & 0xff) + "."
+ (address[2] & 0xff) + "." + (address[3] & 0xff));
} else {
- StringBuffer r = new StringBuffer();
- r.append("IPAddress: " + Integer.toHexString(address[0] & 0xff));
+ StringBuffer r = new StringBuffer("IPAddress: " + Integer.toHexString(address[0] & 0xff));
String hexString = Integer.toHexString(address[1] & 0xff);
if (hexString.length() == 1) {
r.append("0" + hexString);
diff --git a/base/util/src/netscape/security/x509/PolicyQualifiers.java b/base/util/src/netscape/security/x509/PolicyQualifiers.java
index def90066e..de946a6d5 100644
--- a/base/util/src/netscape/security/x509/PolicyQualifiers.java
+++ b/base/util/src/netscape/security/x509/PolicyQualifiers.java
@@ -78,8 +78,7 @@ public class PolicyQualifiers implements java.io.Serializable {
* Returns a printable representation of the CertificatePolicyId.
*/
public String toString() {
- StringBuffer s = new StringBuffer();
- s.append("PolicyQualifiers: [");
+ StringBuffer s = new StringBuffer("PolicyQualifiers: [");
for (int i = 0; i < mInfo.size(); i++) {
PolicyQualifierInfo pq = mInfo.elementAt(i);
s.append(pq.toString());
diff --git a/base/util/src/netscape/security/x509/RevokedCertImpl.java b/base/util/src/netscape/security/x509/RevokedCertImpl.java
index 866f1c0d9..df3bc37a8 100755
--- a/base/util/src/netscape/security/x509/RevokedCertImpl.java
+++ b/base/util/src/netscape/security/x509/RevokedCertImpl.java
@@ -281,10 +281,8 @@ public class RevokedCertImpl extends RevokedCertificate implements Serializable
* @return value of this revoked certificate in a printable form.
*/
public String toString() {
- StringBuffer sb = new StringBuffer();
+ StringBuffer sb = new StringBuffer(serialNumber.toString() + " On: " + revocationDate.toString());
- sb.append(serialNumber.toString());
- sb.append(" On: " + revocationDate.toString());
if (extensions != null) {
sb.append("\n");
for (int i = 0; i < extensions.size(); i++)
diff --git a/base/util/src/netscape/security/x509/X509CRLImpl.java b/base/util/src/netscape/security/x509/X509CRLImpl.java
index 9725db640..6c84084c5 100755
--- a/base/util/src/netscape/security/x509/X509CRLImpl.java
+++ b/base/util/src/netscape/security/x509/X509CRLImpl.java
@@ -514,12 +514,9 @@ public class X509CRLImpl extends X509CRL {
* @return value of this CRL in a printable form.
*/
public String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append("X.509 CRL v" + (version + 1) + "\n");
- sb.append("Signature Algorithm: " + sigAlgId +
- ", OID=" + sigAlgId.getOID() + "\n");
- sb.append("Issuer: " + issuer + "\n");
- sb.append("\nThis Update: " + thisUpdate + "\n");
+ StringBuffer sb = new StringBuffer("X.509 CRL v" + (version + 1) + "\n" + "Signature Algorithm: " + sigAlgId +
+ ", OID=" + sigAlgId.getOID() + "\n" + "Issuer: " + issuer + "\n" + "\nThis Update: " + thisUpdate
+ + "\n");
if (nextUpdate != null)
sb.append("Next Update: " + nextUpdate + "\n");
if (revokedCerts.isEmpty())
diff --git a/base/util/src/netscape/security/x509/X509CertImpl.java b/base/util/src/netscape/security/x509/X509CertImpl.java
index 26b88fe3d..05de623ce 100755
--- a/base/util/src/netscape/security/x509/X509CertImpl.java
+++ b/base/util/src/netscape/security/x509/X509CertImpl.java
@@ -643,11 +643,7 @@ public class X509CertImpl extends X509Certificate
if (info == null || algId == null || signature == null)
return "";
- StringBuffer sb = new StringBuffer();
-
- sb.append("[\n");
- sb.append(info.toString() + "\n");
- sb.append(" Algorithm: [" + algId.toString() + "]\n");
+ StringBuffer sb = new StringBuffer("[\n"+info.toString() + "\n" + " Algorithm: [" + algId.toString() + "]\n");
netscape.security.util.PrettyPrintFormat pp =
new netscape.security.util.PrettyPrintFormat(" ", 20);
diff --git a/base/util/src/netscape/security/x509/X509CertInfo.java b/base/util/src/netscape/security/x509/X509CertInfo.java
index 314c3ad2b..0c44e2c92 100644
--- a/base/util/src/netscape/security/x509/X509CertInfo.java
+++ b/base/util/src/netscape/security/x509/X509CertInfo.java
@@ -333,17 +333,12 @@ public class X509CertInfo implements CertAttrSet, Serializable {
|| issuer == null || algId == null || serialNum == null) {
throw new NullPointerException("X.509 cert is incomplete");
}
- StringBuffer sb = new StringBuffer();
-
- sb.append("[\n");
- sb.append(" " + version.toString() + "\n");
- sb.append(" Subject: " + subject.toString() + "\n");
- sb.append(" Signature Algorithm: " + algId.toString() + "\n");
- sb.append(" Key: " + pubKey.toString() + "\n");
- sb.append(" " + interval.toString() + "\n");
- sb.append(" Issuer: " + issuer.toString() + "\n");
- sb.append(" " + serialNum.toString() + "\n");
+ StringBuffer sb = new StringBuffer("[\n" + " " + version.toString() + "\n" + " Subject: "
+ + subject.toString() + "\n"
+ + " Signature Algorithm: " + algId.toString() + "\n" + " Key: " + pubKey.toString() + "\n");
+ sb.append(" " + interval.toString() + "\n" + " Issuer: " + issuer.toString() + "\n"
+ + " " + serialNum.toString() + "\n");
// optional v2, v3 extras
if (issuerUniqueId != null) {
sb.append(" Issuer Id:\n" + issuerUniqueId.toString() + "\n");