我在最新版本的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