Re: Static Initializer behavior?

2010-05-26 Thread Jo
FYI - this does indeed happen with a production compile as well.

Is this a bug vs something I shouldn't try to do with GWT for some
reason?

Thanks,
jo

-- 
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-tool...@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.



Static Initializer behavior?

2010-05-21 Thread Jo
I have a situation where I think that static initializers are not
acting correctly.
I  have distilled a simple example where I get different behavior if I
compile in Java vs when I am running in development mode (this is
using GWT 2.0.3).  (I have not tried a production compile yet).

Given the following 2 classes in the same pkg, I get different results
in Java vs GWT when I invoke B.getFoo().
Java: B.getFoo() returns xxx
GWT: B.getFoo() returns null

Seems like since static initializers are supposed to be executed prior
to the class being available, that GWT is incorrect here?

Can anyone enlighten me if I'm doing something wrong or unsupported in
GWT?

public class A {
protected static String foo;

public static String getFoo() {
return foo;
}
}

public class B extends A {

static {
foo = xxx;
}
}

-- 
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-tool...@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.