我正在尝试实现Tomcat-9的源代码。
我有一行代码如下:
Collection<Certificate> chain = new ArrayList<>(certificateFile.getCertificates());
if (certificate.getCertificateChainFile() != null) {
PEMFile certificateChainFile = new PEMFile(certificate.getCertificateChainFile());
chain.addAll(certificateChainFile.getCertificates());
}
这段代码在eclipse中编译得很好,但是当我尝试通过build.xml构建它时,使用的是蚂蚁构建器。我说错了:
类型不匹配:无法从ArrayList转换到集合
为什么要观察这种行为?有什么想法吗?
发布于 2021-03-26 13:01:13
进口和一切都是正确的。我将Collection<Certificate>
修改为Collection<X509Certificate>
,一切看起来都很好。
https://stackoverflow.com/questions/66817023
复制相似问题