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

2010-03-21 Thread Martin Buchholz
On Sat, Mar 20, 2010 at 17:30, Ulf Zibis wrote: > Fast path for BMP. +1 > > I don't find ensureCapacityInternal() ??? My patches are dependent on each other. I've changed my patch publishing script to publish my entire .hg/patches/ subrepo, so that others can import my patches, including their or

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

2010-03-21 Thread Martin Buchholz
On Sat, Mar 20, 2010 at 17:13, Ulf Zibis wrote: > Am 20.03.2010 01:13, schrieb Martin Buchholz: > Don't you think we should add a hint to javadoc to inform the user about the > implementation difference between isSupplementaryCodePoint and > isValidCodePoint? No. > It's likely, the user would us

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

2010-03-21 Thread Martin Buchholz
On Sat, Mar 20, 2010 at 16:50, Ulf Zibis wrote: > 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

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

2010-03-21 Thread Martin Buchholz
On Sat, Mar 20, 2010 at 14:52, Ulf Zibis wrote: > Am 20.03.2010 01:13, schrieb Martin Buchholz: > Yep, I stepmotherly revised other methods, my focus was on String(int[], > int, int) and outsourcing bond checks. > BTW, what do you think of the latter? I've done a lot of work on "out-lining" error

Re: String.lastIndexOf confused by unpaired trailing surrogate

2010-03-21 Thread Martin Buchholz
On Sat, Mar 20, 2010 at 15:50, Ulf Zibis wrote: > 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

Re: Centralize bounds check in package private methods

2010-03-21 Thread Martin Buchholz
This is definitely on the right track. We should borrow as many of the ideas and method names from LinkedList and Preconditions. But compatibility will force us to maintain our own versions of these methods. Someday I'd like to see much of google-collections/guava in the jdk. Particularly Precondi

Re: Centralize bounds check in package private methods

2010-03-21 Thread Ulf Zibis
That's great, gives me more time for other work. Preconditions seems good candidate for java.util package. Some namings appear little strange for me. Example: String errorMessageTemplate, Object... errorMessageArgs Why not just: errorFormat, errorArgs messageFormat, messageArg

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

2010-03-21 Thread Ulf Zibis
Am 21.03.2010 08:56, schrieb Martin Buchholz: On Sat, Mar 20, 2010 at 14:52, Ulf Zibis wrote: Am 20.03.2010 01:13, schrieb Martin Buchholz: Yep, I stepmotherly revised other methods, my focus was on String(int[], int, int) and outsourcing bond checks. BTW, what do you think of the latter?

Re: String.lastIndexOf confused by unpaired trailing surrogate

2010-03-21 Thread Ulf Zibis
Am 21.03.2010 09:05, schrieb Martin Buchholz: On Sat, Mar 20, 2010 at 15:50, Ulf Zibis wrote: 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'm not sure I understand your intent. I

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

2010-03-21 Thread Ulf Zibis
Am 21.03.2010 08:14, schrieb Martin Buchholz: On Sat, Mar 20, 2010 at 17:30, Ulf Zibis wrote: You need to update this.count, not count, below. To avoid this very common class of bugs, I use final when I cache a field in a local of the same name. Oops, is was late last night. -Ulf

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

2010-03-21 Thread Ulf Zibis
On Sat, Mar 20, 2010 at 17:13, Ulf Zibis wrote: Am 20.03.2010 01:13, schrieb Martin Buchholz: Don't you think we should add a hint to javadoc to inform the user about the implementation difference between isSupplementaryCodePoint and isValidCodePoint? No. It's likely, the user

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

2010-03-21 Thread Ulf Zibis
On Sat, Mar 20, 2010 at 14:52, Ulf Zibis wrote: - A little "bug" in javadoc: @exception ArrayIndexOutOfBoundsException insteadIndexOutOfBoundsException Not a bug. Yes, but decreases the users capabilities catching exceptions more precise and flexible. Imagine, a method

Re: String.lastIndexOf confused by unpaired trailing surrogate

2010-03-21 Thread Martin Buchholz
On Sun, Mar 21, 2010 at 03:24, Ulf Zibis wrote: > Am 21.03.2010 09:05, schrieb Martin Buchholz: >> >> On Sat, Mar 20, 2010 at 15:50, Ulf Zibis  wrote: > I think, we should not define a distinct method for this once-used 3-liner: >             for (; i < max-1; i++) >                 if (v[i] == hi

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

2010-03-21 Thread Ulf Zibis
diff --git a/src/share/classes/sun/nio/cs/Surrogate.java b/src/share/classes/sun/nio/cs/Surrogate.java --- a/src/share/classes/sun/nio/cs/Surrogate.java +++ b/src/share/classes/sun/nio/cs/Surrogate.java @@ -294,7 +294,7 @@ dst.put((char)uc); error = null;

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

2010-03-21 Thread Ulf Zibis
diff --git a/src/share/classes/sun/nio/cs/Surrogate.java b/src/share/classes/sun/nio/cs/Surrogate.java --- a/src/share/classes/sun/nio/cs/Surrogate.java +++ b/src/share/classes/sun/nio/cs/Surrogate.java @@ -294,7 +294,7 @@ dst.put((char)uc); error = null;

Re: String.lastIndexOf confused by unpaired trailing surrogate

2010-03-21 Thread Ulf Zibis
On Sun, Mar 21, 2010 at 03:24, Ulf Zibis wrote: Am 21.03.2010 09:05, schrieb Martin Buchholz: On Sat, Mar 20, 2010 at 15:50, Ulf Zibiswrote: I think, we should not define a distinct method for this once-used 3-liner: for (; i< max-1; i++) i

Re: String.lastIndexOf confused by unpaired trailing surrogate

2010-03-21 Thread Ulf Zibis
On Sun, Mar 21, 2010 at 03:24, Ulf Zibis wrote: Am 21.03.2010 09:05, schrieb Martin Buchholz: On Sat, Mar 20, 2010 at 15:50, Ulf Zibiswrote: I think, we should not define a distinct method for this once-used 3-liner: for (; i< max-1; i++) if (v[i] == high

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

2010-03-21 Thread Ulf Zibis
Am 21.03.2010 08:56, schrieb Martin Buchholz: On Sat, Mar 20, 2010 at 14:52, Ulf Zibis wrote: I now believe we should provide Character.highSurrogate and Character.lowSurrogate as you have been advocating. If Sherman agrees, let's put a proper patch for this together. - I too would

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

2010-03-21 Thread Martin Buchholz
On Sun, Mar 21, 2010 at 05:00, Ulf Zibis wrote: >> >> On Sat, Mar 20, 2010 at 14:52, Ulf Zibis  wrote: >> >>> >>> - A little "bug" in javadoc: >>> �...@exception ArrayIndexOutOfBoundsException >>>  instead    IndexOutOfBoundsException >>> >> >> Not a bug. >> > > Yes, but decreases the users capabi

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

2010-03-21 Thread Martin Buchholz
On Sun, Mar 21, 2010 at 04:28, Ulf Zibis wrote: > On Sat, Mar 20, 2010 at 17:13, Ulf Zibis wrote: > I don't think it's a performance problem in the real world. > > > Hm, if someone uses: > if (Character.isBMPCodePoint(codePoint)) > ...; > else if (Character.isSupplementaryCode

Re: String.lastIndexOf confused by unpaired trailing surrogate

2010-03-21 Thread Martin Buchholz
On Sun, Mar 21, 2010 at 06:35, Ulf Zibis wrote: >> >>> >>> On Sun, Mar 21, 2010 at 03:24, Ulf Zibis  wrote: Am 21.03.2010 09:05, schrieb Martin Buchholz: > > On Sat, Mar 20, 2010 at 15:50, Ulf Zibis    wrote: I think, we should not define a distinct method for this once

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

2010-03-21 Thread Martin Buchholz
On Sun, Mar 21, 2010 at 00:56, Martin Buchholz wrote: > Study also: > http://code.google.com/p/google-collections/source/browse/trunk/src/com/google/common/base/Preconditions.java Sorry, the best (most recent) version of Preconditions to study is here: http://code.google.com/p/guava-libraries/s