JDK-8073818 : ArrayIndexOutOfBoundsException in regular expression
  • Type: Bug
  • Component: core-libs
  • Sub-Component: jdk.nashorn
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2015-02-24
  • Updated: 2015-03-18
  • Resolved: 2015-02-25
Related Reports
Duplicate :  
Description
From http://stackoverflow.com/questions/28703208/strange-exception-with-java8-nashorn-regex-engine

jjs> var col0 = " xxxx,         xxx xxxxxx xxxxxxxxx xxxxxxx, xxxx xxxxx xxxxx ";
jjs> var name = /([^\s]+),(.*)+/.exec(col0);
java.lang.ArrayIndexOutOfBoundsException: 64

Comments
Thanks Charlie. Unfortunately the behaviour resulting from the fix is not correct for JavaScript (I'm not sure about Ruby, java.util.regex has the same wrong-for-js behaviour). I've written up what I've found out over there: https://github.com/jruby/joni/issues/15#issuecomment-83197486
18-03-2015

Fixed in original joni here: https://github.com/jruby/joni/issues/15
16-03-2015