Tom Terrace
unread,Sep 13, 2011, 4:01:58 PM9/13/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to GWTP
Using GWT 2.3 & GWTP 0.6, I have an error that's popping up in web
mode only (hosted mode works fine). The problem is that the
getCurrentPlaceRequest method in the PlaceManagerImpl class tries to
access the placeHierarchy list and has a catch block for
ArrayIndexOutOfBoundsException:
public PlaceRequest getCurrentPlaceRequest() {
try {
return placeHierarchy.get(placeHierarchy.size() - 1);
} catch (ArrayIndexOutOfBoundsException e) {
return new PlaceRequest();
}
}
However, in GWT's compiled javascript, ArrayIndexOutOfBoundsException
is never thrown, only IndexOutOfBoundsException. Here's the relevant
line from -style DETAILED javascript:
(index < 0 || index >= size) &&
java_util_AbstractList_indexOutOfBounds__IIV(index, size);
So the catch block misses the exception and causes an error. This is
easily fixed by checking the size of the list instead of trying to
catch the exception (which is probably cleaner anyway), but can anyone
else reproduce this behavior? Would this be a GWT bug since Java's
ArrayList behaves differently than the compiled javascript?
Thanks for the help,
Tom