users@glassfish.java.net

[gf-users] Re: GF crashed

From: Andreas Junius <andreas.junius_at_gmail.com>
Date: Tue, 04 Aug 2015 10:40:56 +0930

Looks, like you are right:

...
  boolean match(Matcher matcher, int i, CharSequence seq) {
             if (i < matcher.to) {
                 int ch = Character.codePointAt(seq, i);
                 return isSatisfiedBy(ch)
                     && next.match(matcher, i+Character.charCount(ch), seq);
...

The code doesn't test if the CharSequence seq is long enough and the
Character class doesn't do it either.

Almost 6000 LoC for the Pattern class, that's actually bad style...



On 04/08/15 09:30, Will Hartung wrote:
> Wow…naively, I'd say you just stumbled upon a bug in java.util.regex.