我有两个过载的方法:
protected final <L extends List<D>> ResponseEntity<L> convertAndRespond(final Iterable<E> sources, final Class<L> dataListClass) { ... }
protected final <L extends List<D>> ResponseEntity<L> convertAndRespond(final Page<E> sources, final Class<L> dataListClass) { ... }其中interface Page<T> implements Iterable<T>
我有一个最终创建页面对象并返回以下方法调用的方法:
convertAndRespond(page, A.class);IntelliJ给了我这里的编译错误:含糊的方法调用,尽管我的应用程序构建和运行得很好。有什么问题吗?
这里有趣的是,以前的IntelliJ 14没有显示任何编译问题。
发布于 2016-02-29 20:09:17
IntelliJ告诉您编译器可以选择要运行的任何一种方法。毕竟,类页是一个Iterable。
这可能取决于您为IntelliJ选择的编译器,但不管怎样,这都是一个等待发生的错误。
https://stackoverflow.com/questions/35708460
复制相似问题