I'm seeing an error in web mode that's not showing up in hosted mode.
I initially posted the issue on the GWT-Platform group here:
http://groups.google.com/group/gwt-platform/browse_thread/thread/08bf21467e9f2ec0
.

The gist is that ArrayLists in java throw
ArrayIndexOutOfBoundsException for negative index values and
IndexOutOfBoundsException for index values >= the list size. In all of
GWT's compiled javascript both cases throw IndexOutOfBoundsException.
Here's the offending line in the detailed js output (it shows up in
all permutations):

(index < 0 || index >= 0) &&
java_util_AbstractList_indexOutOfBounds__IIV(index);

Here's the simplest test case I could come up with that produces it:

public void onModuleLoad() {
        List<String> list = new ArrayList<String>();
        // trickery so the compiler doesn't optimize anything out
        Integer i = new Integer("-1");
        try {
                list.get(i);
        } catch (ArrayIndexOutOfBoundsException e) {
                Window.alert("caught!");
        }
}

The workaround is trivial but I can file a bug for this if necessary.

Thanks for the help!
Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to