我使用 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