GWTC 2.9.0 has problems compiling my generics

197 views
Skip to first unread message

David Nouls

unread,
May 29, 2020, 8:07:07 AM5/29/20
to GWT Users
I switched from GWT 2.8.2 to GWT 2.9.0 and I get some GWTC compilation errors when compiling with certain generic constructs.
It compiles fine with JDK11 and in IntelliJ, but GWTC no longer seems to support this:

[INFO] --- gwt-maven-plugin:1.0.0:compile (default-compile) @ cloud.platform.ui.demo-app ---
[INFO] Compiling module com.swift.cloud.platform.ui.demo.Demo
[INFO]    Tracing compile failure path for type 'com.swift.cloud.platform.ui.webcomponent.widget.query.QueryEditor'
[INFO]       [ERROR] Errors in 'jar:file:/home/dnouls/liteevolutiontfr/platform/main/ui/webcomponent/target/cloud.platform.ui.webcomponent-0.0.5-SNAPSHOT.jar!/com/swift/cloud/platform/ui/webcomponent/widget/query/QueryEditor.java'
[INFO]          [ERROR] Line 376: The method byKey(IFilterKey<KEY>) in the type QueryConfiguration is not applicable for the arguments (capture#67-of ? extends IFilterKey<?>)
[INFO]    [ERROR] Aborting compile due to errors in some input files


A small piece of the QueryEditor class where this error is reported:

  public void setFilterKeys(Set<? extends IFilterKey<?>> filterKeys) {
    this.allowedFilterKeys = filterKeys.stream().filter(key -> config.byKey(key).isPresent()).collect(Collectors.toCollection(ArrayList::new));

    // sort by label
    allowedFilterKeys.sort(Comparator.comparing(config.getLabels()::getKeyLabel));
  }

This is the method that it is trying to call:
  @SuppressWarnings("unchecked")
  public <KEY, VO, CONFIG extends AbstractCriteria<KEY, VO, CONFIG>> Optional<CONFIG> byKey(IFilterKey<KEY> key) {
    return Optional.ofNullable((CONFIG) byKey.get(key));
  }

Gordan Krešić

unread,
May 29, 2020, 8:13:58 AM5/29/20
to google-we...@googlegroups.com
Interestingly, I've run into exactly the same issue yesterday, but other way
around: my code compiles in GWT 2.9 (and javac and Eclipse), but not in GWT
2.8.2 which refuses to accept parameters for one method with generics-heavy
signature.

I've even explored the possibility to force GWT 2.8.2 to use newer ecj, but
it's bundled in gwt.dev.jar.

Any help is appreciated.

-gkresic.
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-tool...@googlegroups.com
> <mailto:google-web-tool...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit/011da579-79ee-4bf2-946f-93e095d0c58d%40googlegroups.com
> <https://groups.google.com/d/msgid/google-web-toolkit/011da579-79ee-4bf2-946f-93e095d0c58d%40googlegroups.com?utm_medium=email&utm_source=footer>.

Jens

unread,
May 29, 2020, 9:02:00 AM5/29/20
to GWT Users
So the Eclipse JDT version GWT uses has a generics bug then. Have you tried open the project/code in Eclipse to see if Eclipse complains as well? If Eclipse does not complain then it is probably fixed and we can likely just upgrade JDT again in GWT.

-- J.

David Nouls

unread,
May 29, 2020, 10:16:14 AM5/29/20
to GWT Users
I don't have access to eclipse in my work environment - not allowed. 

David Nouls

unread,
May 29, 2020, 11:23:55 AM5/29/20
to GWT Users
I changed my maven pom to select 3.20.0 of org.eclipse.jdt:ecj as that seemed to be the only dependency from eclipse.jdt.
But the compilation still failed with the same error.

I also tried 3.21.0 but there the compilation does not seem to ever finish (cpu usage goes to 0%).

Thomas Broyer

unread,
May 29, 2020, 11:54:14 AM5/29/20
to GWT Users
Log of the error in our project:
   Tracing compile failure path for type 'org.waveprotocol.wave.model.supplement.WaveletBasedSupplement'
     
[ERROR] Errors in 'jar:file:/home/tbr/.gradle/caches/modules-2/files-2.1/org.waveprotocol.waveinabox/waveinabox-model/0.3-atolcd-1206559-patched-4/4a2a46fd36d1308d05cc705a3ee055401c6cc5e3/waveinabox-model-0.3-atolcd-1206559-patched-4-sources.jar!/org/waveprotocol/wave/model/supplement/WaveletBasedSupplement.java'
         
[ERROR] Line 948: The method createWaveletSeenVersion(DocumentEventRouter<? super E,E,?>) in the type WaveletBasedSupplement is not applicable for the arguments (DocumentEventRouter<N,capture#88-of ?,capture#90-of ? extends N>)
         
[ERROR] Line 943: The method create(ObservableMutableDocument<N,E,?>) in the type DefaultDocumentEventRouter is not applicable for the arguments (ObservableMutableDocument<N,capture#85-of ?,capture#86-of ?>)
         
[ERROR] Line 953: The method create(ObservableMutableDocument<N,E,?>) in the type DefaultDocumentEventRouter is not applicable for the arguments (ObservableMutableDocument<N,capture#91-of ?,capture#92-of ?>)
         
[ERROR] Line 918: The method createMuted(DocumentEventRouter<? super E,E,?>) in the type WaveletBasedSupplement is not applicable for the arguments (DocumentEventRouter<N,capture#70-of ?,capture#72-of ? extends N>)
         
[ERROR] Line 933: The method createPendingNotification(DocumentEventRouter<? super E,E,?>) in the type WaveletBasedSupplement is not applicable for the arguments (DocumentEventRouter<N,capture#79-of ?,capture#81-of ? extends N>)
         
[ERROR] Line 938: The method createWaveletReadState(DocumentEventRouter<? super E,E,?>, ObservablePrimitiveSupplement.Listener) in the type WaveletBasedSupplement is not applicable for the arguments (DocumentEventRouter<N,capture#82-of ?,capture#84-of ? extends N>, ObservablePrimitiveSupplement.Listener)
         
[ERROR] Line 958: The method create(ObservableMutableDocument<N,E,?>) in the type DefaultDocumentEventRouter is not applicable for the arguments (ObservableMutableDocument<N,capture#94-of ?,capture#95-of ?>)
         
[ERROR] Line 923: The method create(ObservableMutableDocument<N,E,?>) in the type DefaultDocumentEventRouter is not applicable for the arguments (ObservableMutableDocument<N,capture#73-of ?,capture#74-of ?>)
         
[ERROR] Line 913: The method createFolders(DocumentEventRouter<? super E,E,?>) in the type WaveletBasedSupplement is not applicable for the arguments (DocumentEventRouter<N,capture#67-of ?,capture#69-of ? extends N>)
         
[ERROR] Line 913: The method create(ObservableMutableDocument<N,E,?>) in the type DefaultDocumentEventRouter is not applicable for the arguments (ObservableMutableDocument<N,capture#67-of ?,capture#68-of ?>)
         
[ERROR] Line 938: The method create(ObservableMutableDocument<N,E,?>) in the type DefaultDocumentEventRouter is not applicable for the arguments (ObservableMutableDocument<N,capture#82-of ?,capture#83-of ?>)
         
[ERROR] Line 933: The method create(ObservableMutableDocument<N,E,?>) in the type DefaultDocumentEventRouter is not applicable for the arguments (ObservableMutableDocument<N,capture#79-of ?,capture#80-of ?>)
         
[ERROR] Line 943: The method createWaveletCollapsedState(DocumentEventRouter<? super E,E,?>, ObservablePrimitiveSupplement.Listener) in the type WaveletBasedSupplement is not applicable for the arguments (DocumentEventRouter<N,capture#85-of ?,capture#87-of ? extends N>, ObservablePrimitiveSupplement.Listener)
         
[ERROR] Line 948: The method create(ObservableMutableDocument<N,E,?>) in the type DefaultDocumentEventRouter is not applicable for the arguments (ObservableMutableDocument<N,capture#88-of ?,capture#89-of ?>)
         
[ERROR] Line 923: The method createCleared(DocumentEventRouter<? super E,E,?>) in the type WaveletBasedSupplement is not applicable for the arguments (DocumentEventRouter<N,capture#73-of ?,capture#75-of ? extends N>)
         
[ERROR] Line 958: The method createAbuseStore(DocumentEventRouter<? super E,E,?>) in the type WaveletBasedSupplement is not applicable for the arguments (DocumentEventRouter<N,capture#94-of ?,capture#96-of ? extends N>)
         
[ERROR] Line 953: The method createWaveletNotifiedVersion(DocumentEventRouter<? super E,E,?>) in the type WaveletBasedSupplement is not applicable for the arguments (DocumentEventRouter<N,capture#91-of ?,capture#93-of ? extends N>)
         
[ERROR] Line 918: The method create(ObservableMutableDocument<N,E,?>) in the type DefaultDocumentEventRouter is not applicable for the arguments (ObservableMutableDocument<N,capture#70-of ?,capture#71-of ?>)
         
[ERROR] Line 963: The method create(ObservableMutableDocument<N,E,?>) in the type DefaultDocumentEventRouter is not applicable for the arguments (ObservableMutableDocument<N,capture#97-of ?,capture#98-of ?>)
         
[ERROR] Line 928: The method create(ObservableMutableDocument<N,E,?>) in the type DefaultDocumentEventRouter is not applicable for the arguments (ObservableMutableDocument<N,capture#76-of ?,capture#77-of ?>)
         
[ERROR] Line 963: The method createGadgetStatesDoc(DocumentEventRouter<? super E,E,?>, ObservablePrimitiveSupplement.Listener) in the type WaveletBasedSupplement is not applicable for the arguments (DocumentEventRouter<N,capture#97-of ?,capture#99-of ? extends N>, ObservablePrimitiveSupplement.Listener)
         
[ERROR] Line 928: The method createWaveletArchiveState(DocumentEventRouter<? super E,E,?>) in the type WaveletBasedSupplement is not applicable for the arguments (DocumentEventRouter<N,capture#76-of ?,capture#78-of ? extends N>)

   
[ERROR] Aborting compile due to errors in some input files


This is the exact file that doesn't compile (and yes, it's very, very old! not even the latest code from the Wave project)


Fortunately, we're not actually using that class, and the build actually only fails because of -failOnError. This means I can work around the issue by excluding the file with some gwt.xml trick (I want to keep the -failOnError).
But you get an idea (and repro-case, albeit a non-self-contained and quite complex one) of what can cause issues with 2.9.0.

David Nouls

unread,
Jun 8, 2020, 3:10:59 AM6/8/20
to GWT Users
Has somebody created an issue to fix this regression ? This is blocking me from migrating to GWT 2.9.0
Reply all
Reply to author
Forward
0 new messages