Fast path for BMP. +1
I don't find ensureCapacityInternal() ???
shorter:
public AbstractStringBuilder appendCodePoint(int codePoint) {
int count = this.count;
if (Character.isBMPCodePoint(codePoint)) {
ensureCapacityInternal(count + 1);
value[count++]
Sherman, please again consider about shifting Surrogate.high/low to
Character.high/lowSurrogate.
-Ulf
Am 20.03.2010 19:36, schrieb Martin Buchholz:
http://cr.openjdk.java.net/~martin/webrevs/openjdk7/lastIndexOf/
What do you think about?
See attachment.
-Ulf
modified checkBounds(byte[] bytes, int offset, int length)
to package private checkBounds(int arrayLength, int offset, int count)
and added usage from constructors
diff --git a/src/share/classes/java/lang/AbstractStringBuilder.java
b/src/share/clas
Am 20.03.2010 01:13, schrieb Martin Buchholz:
We can do it for free
by switching => isValidCodePoint,
so why not?
Don't you think we should add a hint to javadoc to inform the user about
the implementation difference between isSupplementaryCodePoint and
isValidCodePoint?
It's likely,
Am 20.03.2010 01:17, schrieb Martin Buchholz:
On Fri, Mar 19, 2010 at 14:46, Ulf Zibis wrote:
Now I have two patches in my mq queue.
Martin, how do I create 2 exports in the form, you would like?
Just copy the patch files to some public web-accessible place,
as I do with cr.openjdk.j
Oops, later I looked in your webrev and saw your same idea at same time
while I was composing my before-last email.
Why don't you outsource indexOfBMP, lastIndexOfBMP, or to be sincere IMO
to much source code + byte code overhead for a only once used 3-liner.
I suspect if all the finals will
Good catch!
Additionally consider my additional twiddling on indexOf.
-Ulf
Am 20.03.2010 19:36, schrieb Martin Buchholz:
For a change, here's an actual plain old "incorrect result" bug fix
for String.lastIndexOf
Sherman, please file a bug and review.
http://cr.openjdk.java.net/~martin/webrev
Am 20.03.2010 01:13, schrieb Martin Buchholz:
Interesting benchmark results!
Your microbenchmark technique looks unusual, but seems to work.
- yes, warmup is integrated without need for coding extra loop
-- here the more sophisticated version to detect slowdowns caused by GC,
Hotspot or O
For a change, here's an actual plain old "incorrect result" bug fix
for String.lastIndexOf
Sherman, please file a bug and review.
http://cr.openjdk.java.net/~martin/webrevs/openjdk7/lastIndexOf/
Also includes our usual performance-oriented fiddling.
public class LastIndexOf {
public static