gwtproject / gwt

GWT Open Source Project
http://www.gwtproject.org
1.53k stars 377 forks source link

Possible caching problem while using the -war parameter #9600

Open dangerground opened 6 years ago

dangerground commented 6 years ago

GWT version: 2.8.2 Browser (with version): all Operating System: debian testing


Description

the gwt compiler shows some problems when using -war parameter and adding an for the GridFastNavigation vaadin plugin element to the Widgetset. It does work on a clean project.

Steps to reproduce

Unfortunatly I can't provide an always working minimal example, but using https://gist.github.com/dangerground/8b5db377eca3896917037e37f0dd8f1d

You need to initialize a new gradle project then comment-out the GridFastNavigation inherit build the project and then comment-in again and build again. It will fail with the following log

Caused by: java.lang.ClassCastException: com.google.gwt.dev.jjs.ast.JClassType cannot be cast to com.google.gwt.dev.jjs.ast.JInterfaceType
        at com.google.gwt.dev.jjs.impl.ReferenceMapper.get(ReferenceMapper.java:160)
        at com.google.gwt.dev.jjs.impl.ReferenceMapper.createMethod(ReferenceMapper.java:246)
        at com.google.gwt.dev.jjs.impl.ReferenceMapper.get(ReferenceMapper.java:110)
        at com.google.gwt.dev.jjs.impl.GwtAstBuilder$AstVisitor$JsniReferenceCollector.endVisit(GwtAstBuilder.java:315)
        at com.google.gwt.dev.js.ast.JsNameRef.traverse(JsNameRef.java:113)
        at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:467)
        ... 54 more
   [ERROR] at GridViolators.java(38): escallator.@com.vaadin.client.widgets.Escalator::getBody()
      com.google.gwt.dev.js.ast.JsNameRef
   [ERROR] at GridViolators.java(38): escallator.@com.vaadin.client.widgets.Escalator::getBody()()
      com.google.gwt.dev.js.ast.JsInvocation
   [ERROR] at GridViolators.java(38): conBody = escallator.@com.vaadin.client.widgets.Escalator::getBody()()
      com.google.gwt.dev.js.ast.JsVars$JsVar
   [ERROR] at GridViolators.java(38): var conBody = escallator.@com.vaadin.client.widgets.Escalator::getBody()()
      com.google.gwt.dev.js.ast.JsVars
   [ERROR] at GridViolators.java(33): {
  var cfh = grid.@com.vaadin.client.widgets.Grid::cellFocusHandler;
  var row = cfh.@com.vaadin.client.widgets.Grid.CellFocusHandler::rowWithFocus;
  var contWithFocus = cfh.@com.vaadin.client.widgets.Grid.CellFocusHandler::containerWithFocus;
  var escallator = grid.@com.vaadin.client.widgets.Grid::getEscalator()();
  [...]
}

      com.google.gwt.dev.js.ast.JsBlock
   [ERROR] at GridViolators.java(33): function(grid){
  var cfh = grid.@com.vaadin.client.widgets.Grid::cellFocusHandler;
  var row = cfh.@com.vaadin.client.widgets.Grid.CellFocusHandler::rowWithFocus;
  var contWithFocus = cfh.@com.vaadin.client.widgets.Grid.CellFocusHandler::containerWithFocus;
  var escallator = grid.@com.vaadin.client.widgets.Grid::getEscalator()();
  [...]
}

      com.google.gwt.dev.js.ast.JsFunction
   [ERROR] at GridViolators.java(33): public static final native int getFocusedRow(Grid<?> grid);
      org.eclipse.jdt.internal.compiler.ast.MethodDeclaration
Known workarounds
Links to further discussions

Related issue in the Vaadin plugin

mirkoliver commented 6 years ago

I have the same problem - thank you for the workarounds - with cleaning beetween builds it worked for me. For sure it's only a workaround ...