【问题标题】:Guava 18 does not compile with GWT 2.8Snapshot and Java 8Guava 18 不能与 GWT 2.8Snapshot 和 Java 8 一起编译
【发布时间】:2015-01-09 22:19:48
【问题描述】:

我在我的 gwt.xml 模块中使用并放入

guava-18.0.jar
guava-gwt-18.0.jar

   Tracing compile failure path for type 'com.google.common.collect.Collections2'
      [ERROR] Errors in 'com/google/common/collect/Collections2.java'
         [ERROR] Line 201: The method and(Predicate<capture#14-of ? super E>, Predicate<capture#15-of ?>) is undefined for the type Collections2.FilteredCollection<E>
         [ERROR] Line 206: The method and(Predicate<capture#16-of ? super E>, Predicate<capture#17-of ?>) is undefined for the type Collections2.FilteredCollection<E>
   Tracing compile failure path for type 'com.google.common.collect.Maps'
      [ERROR] Errors in 'com/google/common/collect/super/com/google/common/collect/Maps.java'
         [ERROR] Line 2244: The method and(Predicate<capture#263-of ? super Map.Entry<K,V>>, Predicate<capture#264-of ? super Map.Entry<K,V>>) is undefined for the type Predicates
         [ERROR] Line 2343: The method and(Predicate<capture#265-of ? super Map.Entry<K,V>>, Predicate<capture#266-of ? super Map.Entry<K,V>>) is undefined for the type Predicates
   Tracing compile failure path for type 'com.google.common.collect.Multimaps'
      [ERROR] Errors in 'com/google/common/collect/super/com/google/common/collect/Multimaps.java'
         [ERROR] Line 1691: The method and(Predicate<capture#83-of ? super K>, Predicate<capture#84-of ? super K>) is undefined for the type Predicates
         [ERROR] Line 1954: The method and(Predicate<capture#105-of ? super Map.Entry<K,V>>, Predicate<capture#106-of ? super Map.Entry<K,V>>) is undefined for the type Predicates
         [ERROR] Line 1735: The method and(Predicate<capture#87-of ? super K>, Predicate<capture#88-of ? super K>) is undefined for the type Predicates
         [ERROR] Line 1779: The method and(Predicate<capture#91-of ? super K>, Predicate<capture#92-of ? super K>) is undefined for the type Predicates
         [ERROR] Line 1940: The method and(Predicate<capture#103-of ? super Map.Entry<K,V>>, Predicate<capture#104-of ? super Map.Entry<K,V>>) is undefined for the type Predicates
   [ERROR] Aborting compile due to errors in some input files

编辑:google GWT-Contributors 组里有她的讨论:https://groups.google.com/forum/#!topic/google-web-toolkit-contributors/zYUfanL8zwM

这里是这个问题的一个问题:http://code.google.com/p/google-web-toolkit/issues/detail?id=9036

是否有解决此问题的方法?

编辑:我用 Guava 19SNAPSHOT 进行了测试,得到了同样的错误。

【问题讨论】:

  • Afaik GWT 2.7 不支持 Java 8(但我不确定您的问题是否是由此引起的)。
  • 我使用的是 2.8 快照。

标签: java javascript gwt java-8 guava


【解决方案1】:

这是一个known issue,带有 GWT 和它使用的 JDT 版本。

bug报告中给出的修复是升级jdt版本,运行update-jdt.py,更新dev/build.xml指向新版本。

或者,您可以尝试不同版本的番石榴,或者开始从番石榴中删除不起作用的方法/类。

或者您可以等到发布更新版本的 gwt 来解决这些问题。

【讨论】:

  • 您能否更详细地描述一下这是如何完成的?在哪里可以找到 update-jdt.py 文件?我必须在 dev/build.xml 中更改什么以及我必须将带有 jdt 修复程序的 jar 文件放在哪里?
  • 问题现在是“FixedNotReleased”,因此最近的快照应该已经包含修复。
猜你喜欢
  • 2014-08-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-02-07
  • 1970-01-01
  • 2011-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多