I've got a problem (I think I found a bug) with GWT 1.4.60 when
copying data-classes that were received from a servlet. I have a proof-
of-concept and can send it to anybody being interested (I don't want
to attach it to this message to save bandwith).

Here the Entry-point in short form:

public void onModuleLoad() {
    // create GUI-elements and add them to the root-panel, some of
them
    // are declared as global variables to allow to access them later
    ServerFunctionality.Util.getInstance().getTestData(new
AsyncCallback() {
        public void onSuccess(Object result) {
            data = (TestDataClass) result;
            refreshValues();
        }
        public void onFailure(Throwable caught) {
            Window.alert(caught.getMessage());
        }
    });
}
private void refreshValues(){
    label.setText(data.name);
    label_1.setText(Integer.toString(data.value));
    label_2.setText(Boolean.toString(data.truth));

    TestDataClass copy = new TestDataClass(data);

    label2.setText(copy.name);
    label_3.setText(Integer.toString(copy.value));
    label_4.setText(Boolean.toString(copy.truth));
}

Here is the source of TestDataClass:

public class TestDataClass implements Serializable {
    public TestDataClass(){
        // nothing to do
    }
    public TestDataClass(TestDataClass source){
        this.name = source.name;
        this.value = source.value;
        this.truth = source.truth;
    }

    private static final long serialVersionUID = 1L;
    public String name;
    public int value;
    public boolean truth;
}

The servlet ServerFunctionalityImpl is simply instantiating
TestDataClass
and fill in some values

When running the whole thing in Hosted Mode, everything works fine,
when pressing the Compile/Browse-Button I see the following values
in the Browser:

Text            name
Number          5
Boolean         true
Copy of Text
Copy of Number  0
Copy of Boolean false

WTF?


Best regards, Lothar

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to