Skip to content

Instantly share code, notes, and snippets.

View cancerberoSgx's full-sized avatar

Sebastián Gurin cancerberoSgx

  • home
  • Montevideo, Uruguay
View GitHub Profile
@cancerberoSgx
cancerberoSgx / gist:4725531
Created February 6, 2013 20:30
a very negative gwt JRe emulation bug dedicated to niloc132
AbtractMapImpl1 ehm = buildAM();
Set s = ehm.keySet();
ehm.put(null,"test");
th.check( s == ehm.keySet() , "same Set is returned"); //I think this fails because of javadoc keySet() sentence : The set is backed by the map, so changes to the map are reflected in the set, and vice-versa.
@cancerberoSgx
cancerberoSgx / gist:4725277
Created February 6, 2013 19:55
a "negative" bug - Arrays.fill() is not throwing expected index exceptions IllegalArgumentException and ArrayIndexOutOfBoundsException - in this example with boolean, but fails with all types:
boolean[] b3 = new boolean[2];
try {
Arrays.fill(b3, 2, 1, false);
Window.alert("error 1 - IllegalArgumentException expected");
} catch (IllegalArgumentException e) {
}
try {
Arrays.fill(b3, -1, 1, false);
Window.alert("error 1 - ArrayIndexOutOfBoundsException expected");
} catch (ArrayIndexOutOfBoundsException e) {
@cancerberoSgx
cancerberoSgx / gist:4725187
Created February 6, 2013 19:44
Collections.copy() do not seem to work. The following fails at least with two implementations: LinkedList and ArrayList, in production mode :
List<String> l1 = new LinkedList<String>();
List<String> l2 = new LinkedList<String>();
// List<String> l1 = new ArrayList<String>();
// List<String> l2 = new ArrayList<String>();
// copy empty list
Collections.copy(l2, l1);
l1.add("A");
l2.add("B");
Collections.copy(l2, l1);
int result = "abc\tABC 123".compareTo(new String());
/* notice: "abc\tABC 123".compareTo("") will work ! */
if (result != 11)
Window.alert("error, result : " + result);
else
Window.alert("OK, result: " + result);
@cancerberoSgx
cancerberoSgx / gist:4715885
Created February 5, 2013 17:06
i'm starting to run mauve project tests on GWT in my project gwtmauve. http://code.google.com/p/gwtmauve/ The following are errors trying to compile ALL java.lang related tests. I know the full java.lang is not supported but I think these errors can be fixed in GWT.
interesting compilation errors for gwtmauve tests of java.lang classes:
BOOLEAN
The method getBoolean(String) is undefined for the type Boolean