gpt4 book ai didi

java - 为什么 apache.commons.text.InterpolatorStringLookup 缺少合适的构造函数?

转载 作者:行者123 更新时间:2023-12-02 10:56:57 25 4
gpt4 key购买 nike

我正在尝试使用apache.commons.text (v1.4)。我已经安装了它的唯一依赖项 apache.commons.lang3 (v3.7),它本身没有依赖项。

当我尝试编译这些包时,出现错误

[javac] /src/java/org/apache/commons/text/lookup/InterpolatorStringLookup.java:91: error: no suitable constructor found for InterpolatorStringLookup(HashMap<Object,Object>
,StringLookup,boolean)
[javac] this(new HashMap<>(), defaultStringLookup, true);
[javac] ^
[javac] constructor InterpolatorStringLookup.InterpolatorStringLookup(Map<String,StringLookup>,StringLookup,boolean) is not applicable
[javac] (actual argument HashMap<Object,Object> cannot be converted to Map<String,StringLookup> by method invocation conversion)
[javac] constructor InterpolatorStringLookup.InterpolatorStringLookup(StringLookup) is not applicable
[javac] (actual and formal argument lists differ in length)
[javac] constructor InterpolatorStringLookup.<V>InterpolatorStringLookup(Map<String,V>) is not applicable
[javac] (cannot instantiate from arguments because actual and formal argument lists differ in length)
[javac] constructor InterpolatorStringLookup.InterpolatorStringLookup() is not applicable
[javac] (actual and formal argument lists differ in length)
[javac] where V is a type-variable:
[javac] V extends Object declared in constructor <V>InterpolatorStringLookup(Map<String,V>)

为什么InterpolatorStringLookup缺少合适的构造函数?

最佳答案

InterpolatorStringLookup 类的所有构造函数都具有打包可见性。要实例化该类,您必须使用 StringLookupFactory 中的 interpolatorStringLookup() 方法。

关于java - 为什么 apache.commons.text.InterpolatorStringLookup 缺少合适的构造函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51654960/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com