8043342: Replace uses of StringBuffer with StringBuilder within crypto code
JCE components of 8041679 here due to code signing process. Reviewed-by: xuelei, wetmore
This commit is contained in:
parent
c82d0f2418
commit
ec539d9064
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -131,14 +131,14 @@ public final class DHParameters extends AlgorithmParametersSpi {
|
||||
protected String engineToString() {
|
||||
String LINE_SEP = System.getProperty("line.separator");
|
||||
|
||||
StringBuffer strbuf
|
||||
= new StringBuffer("SunJCE Diffie-Hellman Parameters:"
|
||||
StringBuilder sb
|
||||
= new StringBuilder("SunJCE Diffie-Hellman Parameters:"
|
||||
+ LINE_SEP + "p:" + LINE_SEP
|
||||
+ Debug.toHexString(this.p)
|
||||
+ LINE_SEP + "g:" + LINE_SEP
|
||||
+ Debug.toHexString(this.g));
|
||||
if (this.l != 0)
|
||||
strbuf.append(LINE_SEP + "l:" + LINE_SEP + " " + this.l);
|
||||
return strbuf.toString();
|
||||
sb.append(LINE_SEP + "l:" + LINE_SEP + " " + this.l);
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -260,8 +260,8 @@ javax.crypto.interfaces.DHPublicKey, Serializable {
|
||||
public String toString() {
|
||||
String LINE_SEP = System.getProperty("line.separator");
|
||||
|
||||
StringBuffer strbuf
|
||||
= new StringBuffer("SunJCE Diffie-Hellman Public Key:"
|
||||
StringBuilder sb
|
||||
= new StringBuilder("SunJCE Diffie-Hellman Public Key:"
|
||||
+ LINE_SEP + "y:" + LINE_SEP
|
||||
+ Debug.toHexString(this.y)
|
||||
+ LINE_SEP + "p:" + LINE_SEP
|
||||
@ -269,8 +269,8 @@ javax.crypto.interfaces.DHPublicKey, Serializable {
|
||||
+ LINE_SEP + "g:" + LINE_SEP
|
||||
+ Debug.toHexString(this.g));
|
||||
if (this.l != 0)
|
||||
strbuf.append(LINE_SEP + "l:" + LINE_SEP + " " + this.l);
|
||||
return strbuf.toString();
|
||||
sb.append(LINE_SEP + "l:" + LINE_SEP + " " + this.l);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
private void parseKeyBits() throws InvalidKeyException {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -238,7 +238,7 @@ public final class OAEPParameters extends AlgorithmParametersSpi {
|
||||
}
|
||||
|
||||
protected String engineToString() {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("MD: " + mdName + "\n");
|
||||
sb.append("MGF: MGF1" + mgfSpec.getDigestAlgorithm() + "\n");
|
||||
sb.append("PSource: PSpecified " +
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -166,7 +166,7 @@ public final class P11Util {
|
||||
if (b == null) {
|
||||
return "(null)";
|
||||
}
|
||||
StringBuffer sb = new StringBuffer(b.length * 3);
|
||||
StringBuilder sb = new StringBuilder(b.length * 3);
|
||||
for (int i = 0; i < b.length; i++) {
|
||||
int k = b[i] & 0xff;
|
||||
if (i != 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user