Hello there, I have encounter an strange error that ONLY happens in
web mode when I overrides a method of an abstract class which itself
extends a class with same named private method. The exception produced
with the provided code is:

uncaught exception: [Exception... "Component returned failure code:
0x80004003 (NS_ERROR_INVALID_POINTER)" nsresult: "0x80004003
(NS_ERROR_INVALID_POINTER)" location: "JS frame ::
http://localhost:8080/GwtBugOverridePrivate/info.ningzhang.gwtbug.OverridePrivate/4AB3C7537BED92E0D4FDD3FA0AEBC301.cache.html
:: vj :: line 90" data: no]

Other error also produced with different codes. both
Error: uncaught exception: [object Object] and
IndexOutOfBoundsException index -1, size 0

I use Firefox 3.5.5 on Fedora 11, with GWT 1.7.1
here are the actual code to reproduce the error:
== BEGIN  ======================================
== OverridePrivateEntryPoint.java
======================================
package info.ningzhang.gwtbug.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;

/**
 * Main entry point.
 *
 * @author webdev
 */
public class OverridePrivateEntryPoint implements EntryPoint {
    /**
     * Creates a new instance of OverridePrivateEntryPoint
     */
    public OverridePrivateEntryPoint() {
    }

    /**
     * The entry point method, called automatically by loading a
module
     * that declares an implementing class as an entry-point
     */
    public void onModuleLoad() {
        RootPanel.get().add(new CustomWidget("Trying to over ride a
parent abstract class method who has a parent with the same named
private method."));
    }
}

== Base.java ======================================
package info.ningzhang.gwtbug.client;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

/**
 * This is a base widget class that represents a common UI.
 * @author Ning Zhang
 */
public class Base extends Composite{
  VerticalPanel panel = new VerticalPanel();
  Label label = new Label();

  public Base(){
    init();
  }

  public void add(Widget widget){
    panel.add(widget);
  }

  private void init(){
    panel.add(label);
    initWidget(panel);
  }

  public void setLabel(String labelString){
    label.setText(labelString);
  }

}


== SpecialBase.java ======================================
package info.ningzhang.gwtbug.client;

/**
 * A abstract class extends the functionalities of {...@link Base}. Will
define and call a protected {...@link init()} method on class creation.
 * @author Ning Zhang
 */
public abstract class SpecialBase extends Base{

  public SpecialBase(String labelString){
    setLabel(labelString);
    init();
  }

  protected abstract void init();
}


== CustomWidget.java ======================================
package info.ningzhang.gwtbug.client;

import com.google.gwt.user.client.ui.Button;

/**
 * This is the actual user custom widget class that overrides the init
() method defined in {...@link SpecialBase}
 * @author Ning Zhang
 */
public class CustomWidget extends SpecialBase{

  public CustomWidget(String labelString){
    super(labelString);
  }

  @Override
  protected void init() {
    add(new Button("Hello"));
  }

}

== END ======================================
the method 'init()' is the focus here. Again this works fine on hosted
mode, but not in deployed web mode. The solution currently seems to
avoid having the same method name as parents.
Has anyone experienced this problem? is it a bug or am I not thinking
straight here? Please advice.

--

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