Re: review request for 6798511/6860431: Include functionality of Surrogate in Character

2010-03-20 Thread Ulf Zibis
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++]

Re: String.lastIndexOf confused by unpaired trailing surrogate

2010-03-20 Thread Ulf Zibis
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/

Centralize bounds check in package private methods

2010-03-20 Thread Ulf Zibis
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

Re: review request for 6798511/6860431: Include functionality of Surrogate in Character

2010-03-20 Thread Ulf Zibis
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,

Re: review request for 6798511/6860431: Include functionality of Surrogate in Character

2010-03-20 Thread Ulf Zibis
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

Re: String.lastIndexOf confused by unpaired trailing surrogate

2010-03-20 Thread Ulf Zibis
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

Re: String.lastIndexOf confused by unpaired trailing surrogate

2010-03-20 Thread Ulf Zibis
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

Re: review request for 6798511/6860431: Include functionality of Surrogate in Character

2010-03-20 Thread Ulf Zibis
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

String.lastIndexOf confused by unpaired trailing surrogate

2010-03-20 Thread 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/webrevs/openjdk7/lastIndexOf/ Also includes our usual performance-oriented fiddling. public class LastIndexOf { public static