现在的位置: 首页 > 综合 > 正文

Eclipse 3.1 M4 关于Generics的Bug

2014年01月11日 ⁄ 综合 ⁄ 共 316字 ⁄ 字号 评论关闭

我使用 Eclipse 3.1M4 进行如下编码时:

class Test implements Iterator<Integer> {
public boolean hasNext() { return false; }   public Integer next() { return null; }   public void remove() {}
}

问题出现在 next() 方法,上面显示编译器警告:

Type safety: The return type Integer of the method next() of type Test needs unchecked conversion to conform to the return type E of inherited method

这是一个Eclipse的Bug

抱歉!评论已关闭.