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.

Reply via email to