mvel/mvel — comment on commit d7b3bd3761fa459af647f3ad4eeb47e1d308af5e
File: src/main/java/org/mvel2/util/ErrorUtil.java line 20
By mrietveld:

Mike, it looks like sometimes the newCursor value can end up being -1, which causes problems later down the road.

(In the case I ran into, this happens if the expression contains a constructor. The `caught.expr` contains the class name while `outer` does not -- so that outer does not contain `caught.expr` as a substring)

Maybe line 18 should be changed to:

caught.setCursor(newCursor >= 0 ? newCursor : 0);

If you want, I can submit a test case for this.

(Huh.. I _was_ pretty sure that primitive arrays were actually Objects, but apparently hashCode() is overwritten somewhere in the JRE for them.)