public static void test() { // static method
Log.info("random int "+Random.nextInt(6));
}
----->throws a java.lang.UnsatisfiedLinkError:
com.google.gwt.user.client.Random.nextInt(I)I
BUT ...
com.google.gwt.user.client.Random;
public void test() { // non-static method
Log.info("random int: "+Random.nextInt(6));
----->IS OK!!!
--------- a l s o ----------
java.util.Random random = new Random;
public static void test() { // static method
Log.info("random int "+random.nextInt(6));
}
----->throws a nullpointer
BUT ...
public void test() { // not static
Log.info("random int "+random.nextInt(6));
}
----->is fine!!!
Aaaaaaah. Damn, I just re-factored for hours and made a static
reusable utility class...
Why can't I do that by the way?
Shawn
com.google.gwt.user.client.Random in a static method called by a
non-static method works fine.
Seems a little flakey to me but ... I'm probably just not as smart as you!
Shawn