27 Jun
2015
27 Jun
'15
2:23 p.m.
Hello! AbstractStringBuilder, which is base for StringBuilder and StringBuffer has a method for appending a sub-sequence of a CharSequence. Internally, it copies one char at a time in a loop, picking them up with CharSequence.charAt() method. For the case when the argument is a String, it can be done more efficiently, by a call to String.getChars(). Since String is a final class, it should be safe to pass 'value' to its method. I've also found a few places in JDK where code can be done more efficient, using this optimization. Would you please help review this fix? BUGURL: https://bugs.openjdk.java.net/browse/JDK-8077242 WEBREV: http://cr.openjdk.java.net/~igerasim/8077242/02/webrev/ Sincerely yours, Ivan