src/java.base/share/classes/javax/crypto/CryptoPermission.java

Print this page
rev 10521 : 8055723[core]: Replace concat String to append in StringBuilder parameters
Contributed-by: Otavio Santana <otaviojava@java.net>

*** 367,392 **** * format: '("ClassName" "algorithm" "keysize" "exemption_mechanism")'. * * @return information about this CryptoPermission. */ public String toString() { ! StringBuilder buf = new StringBuilder(100); ! buf.append("(CryptoPermission " + alg + " " + maxKeySize); if (algParamSpec != null) { if (algParamSpec instanceof RC2ParameterSpec) { ! buf.append(" , effective " + ! ((RC2ParameterSpec)algParamSpec).getEffectiveKeyBits()); } else if (algParamSpec instanceof RC5ParameterSpec) { ! buf.append(" , rounds " + ! ((RC5ParameterSpec)algParamSpec).getRounds()); } } if (exemptionMechanism != null) { // OPTIONAL ! buf.append(" " + exemptionMechanism); } ! buf.append(")"); ! return buf.toString(); } private boolean impliesExemptionMechanism(String exemptionMechanism) { if (this.exemptionMechanism == null) { return true; --- 367,394 ---- * format: '("ClassName" "algorithm" "keysize" "exemption_mechanism")'. * * @return information about this CryptoPermission. */ public String toString() { ! StringBuilder sb = new StringBuilder(100); ! sb.append("(CryptoPermission ").append(alg).append(' ') ! .append(maxKeySize); if (algParamSpec != null) { if (algParamSpec instanceof RC2ParameterSpec) { ! sb.append(" , effective ") ! .append(((RC2ParameterSpec) algParamSpec) ! .getEffectiveKeyBits()); } else if (algParamSpec instanceof RC5ParameterSpec) { ! sb.append(" , rounds ").append( ! ((RC5ParameterSpec) algParamSpec).getRounds()); } } if (exemptionMechanism != null) { // OPTIONAL ! sb.append(' ').append(exemptionMechanism); } ! sb.append(')'); ! return sb.toString(); } private boolean impliesExemptionMechanism(String exemptionMechanism) { if (this.exemptionMechanism == null) { return true;