Skip to content

Commit fe55d99

Browse files
committed
pass down StringBuilder as is instead of an explicit toString
1 parent 1d9473c commit fe55d99

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/jruby/ext/openssl/PKeyRSA.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ public RubyString to_text() {
379379
StringBuilder result = new StringBuilder();
380380
if (privateKey != null) {
381381
int len = privateKey.getModulus().bitLength();
382-
result.append("Private-Key: (").append(len).append(" bit)").append("\n");
382+
result.append("Private-Key: (").append(len).append(" bit)").append('\n');
383383
result.append("modulus:");
384384
addSplittedAndFormatted(result, privateKey.getModulus());
385385
result.append("publicExponent: ").append(privateKey.getPublicExponent()).append(" (0x").append(privateKey.getPublicExponent().toString(16)).append(")\n");
@@ -401,7 +401,7 @@ public RubyString to_text() {
401401
addSplittedAndFormatted(result, publicKey.getModulus());
402402
result.append("Exponent: ").append(publicKey.getPublicExponent()).append(" (0x").append(publicKey.getPublicExponent().toString(16)).append(")\n");
403403
}
404-
return getRuntime().newString(result.toString());
404+
return RubyString.newString(getRuntime(), result);
405405
}
406406

407407
@Override

0 commit comments

Comments
 (0)