niloc132 / gxt-driver

Other
5 stars 7 forks source link

ClassCastException: ParameterizedTypeImpl cannot be cast to java.lang.Class #8

Open ledben opened 10 years ago

ledben commented 10 years ago

From a org.senchalabs.gwt.gwtdriver.gxt.models.Panel, I call find(Grid.class). This Grid.class is a org.senchalabs.gwt.gwtdriver.gxt.models.Grid.class. It fails with a

java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl cannot be cast to java.lang.Class
        at org.senchalabs.gwt.gwtdriver.models.GwtWidget.find(GwtWidget.java:155)
        at org.senchalabs.gwt.gwtdriver.models.GwtWidget.find(GwtWidget.java:117)

For make it works, I changed the Grid definition from :

@ForWidget(com.sencha.gxt.widget.core.client.grid.Grid.class)
public class Grid extends GwtWidget<GwtWidgetFinder<Grid>> {

to :

@ForWidget(com.sencha.gxt.widget.core.client.grid.Grid.class)
public class Grid extends GwtWidget<GridFinder> {

    public static class GridFinder extends GwtWidgetFinder<Grid> {
    }