我在最新版本的IntelliJ IDEA中遇到了一些奇怪的行为。我有一个私人的小型Java库,当我尝试在其他项目中使用它时,IntelliJ会显示错误的方法参数名称。这里更多关于图片: wrong IntelliJ code completionIntelliJ是否显示错误的代码完成?
注意,当我做这样的工作原理,它应该: good intellij code completion
我可以配置IDE所以想在第二张图片显示,或者是它是一个错误/预期的行为?
编辑:
Combinatorics是一个接口。 CombinatoricsImpl是实现该接口的类,并具有getCombinatorics方法,该方法返回CombinatoricsImpl的新实例。
public static Combinatorics getCombinatorics() {
return new CombinatoricsImpl();
}
接口(无Javadoc中):
public interface Combinatorics {
double combinationsNonRepeating(int n, int k);
double variationsNonRepeating(int n, int k);
double permutationsNonRepeating(int n);
double combinationsRepeating(int n, int k);
double variationsRepeating(int n, int k);
double permutationsRepeating(List<Integer> frequencies);
}
在这两个示例中不使用相同的代码。你可以在这里添加原始代码吗? – ShacharSh
那就是我认为的观点,即在一种情况下它起作用,当我以另一种方式写它时,它不起作用。 – Pitris
我明白,但添加代码可以帮助我们帮助您 – ShacharSh