MVEL

Error in FastList method remove

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 1.2.21
  • Fix Version/s: 1.3.0
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

Hello,

I use MVEL for dynamic translation and I use this sentence lots of time :

" object.list.remove( object.list.indexOf(el1)); "

but it doesn't work, I have this error :

Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at org.mvel.util.FastList.remove(FastList.java:61)
... 35 more

FastList class have a big error in the remove method :

public Object remove(int i) {
Object old = elements[i];
for (int c = i + 1; c != size; c--) { ---------- this condition doesn't work at all !!!! elements[c - 1] = elements[c]; }
size--;
return old;
}

Activity

Hide
Mike Brock added a comment -

Fixed in trunk.

Show
Mike Brock added a comment - Fixed in trunk.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: