在 this unanswered question 中描述的类似问题中和 this other unanswered question ,我在 Eclipse Luna Service Release 1 (4.4.1) (20140925-1800) 中收到一条警告,内容为“(已恢复)在 lambda 形状分析期间检测到内部不一致”。代码如下:
public static <T> T findFirst(Iterable<T> list, Predicate<T> condition) {
/* ... */
}
public static Integer findFirstPrime(Iterable<Integer> integers) {
return findFirst(integers,
integer -> {
/* return either true or false */
}
);
}
警告是在阅读 integer ->
的文本上引发的。有一个bug report声明此问题已针对 Eclipse Mars 4.5 修复,但在此期间我可以做什么?如果我想使用 @SuppressWarnings
,我怎么知道要提供哪种警告类型?
最佳答案
不幸的是,这不是您可以抑制的警告类型。
至少看起来该修复程序已向后移植到 Luna 的 4.4.2 维护版本,该版本将于 2015 年 2 月 27 日发布:
https://projects.eclipse.org/projects/eclipse/releases/4.4.2/plan
关于java - 在 lambda 形状分析期间检测到内部不一致,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27326981/