On Mon, Mar 18, 2013 at 7:44 PM, Masayoshi Okutsu < masayoshi.oku...@oracle.com> wrote:
> Thank you for catching this bug. AbstractStringBuilder.**codePointAt(int) > should have called Character.codePointAt(char[], int, int). > > As for duplicating code, I originally duplicated similar code everywhere > for performance. But someone told me probably during code review that > hotspot inlining was as good as C/C++ macros, and I agreed to replace the > duplicated code with method calls. > > For classes as important as important as StringBuilder, I think we should go the extra mile to ensure best performance, but if you guys insist, I will "merely" fix the bug. If you call the Character method, you will be doing bounds checking twice (or thrice, if you count builtin array checking), and there's a chance that hotspot will be able to optimize it away, but I am not so trusting. Martin