--- a/jdk/src/java.base/share/classes/sun/security/x509/NameConstraintsExtension.java Mon May 18 17:34:48 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/NameConstraintsExtension.java Mon May 18 17:38:38 2015 +0300
@@ -214,12 +214,19 @@
* Return the printable string.
*/
public String toString() {
- return (super.toString() + "NameConstraints: [" +
- ((permitted == null) ? "" :
- ("\n Permitted:" + permitted.toString())) +
- ((excluded == null) ? "" :
- ("\n Excluded:" + excluded.toString()))
- + " ]\n");
+ StringBuilder sb = new StringBuilder();
+ sb.append(super.toString())
+ .append("NameConstraints: [");
+ if (permitted != null) {
+ sb.append("\n Permitted:")
+ .append(permitted);
+ }
+ if (excluded != null) {
+ sb.append("\n Excluded:")
+ .append(excluded);
+ }
+ sb.append(" ]\n");
+ return sb.toString();
}
/**