Nic*_*ner 0 java google-app-engine compiler-errors guava
我收到以下代码的错误:
Iterables.any(Lists.<String>newArrayList(), new Predicate<String>() {
@Override
public boolean apply(final String arg0) {
// TODO Auto-generated method stub
return false;
}
});
Run Code Online (Sandbox Code Playgroud)
错误:
Iterable<T>, Predicate<? super T>类型Iterables中的方法any()不适用于arguments(ArrayList<String>, newPredicate<String>(){})
我究竟做错了什么?我觉得我犯了一个愚蠢的错误.
糟糕 - 我使用了错误的导入.
正确:
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
Run Code Online (Sandbox Code Playgroud)
不正确:
import com.google.appengine.repackaged.com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
Run Code Online (Sandbox Code Playgroud)
使用repackaged番石榴会导致问题.
| 归档时间: |
|
| 查看次数: |
701 次 |
| 最近记录: |