我正在更改HashMap,以便在类中使用MultiKey。
之前:
HashMap<String, MyObject> map = new HashMap<>();现在我的密钥依赖于2个字符串,所以我使用:
HashMap<MultiKey, MyObject> map = new HashMap<>();
map.put(key(s1,s2),obj);
private static MultiKey key(String s1, String s2) {
return new MultiKey(s1,s2);
}IntelliJ突出显示了对MultiKey的构造函数调用,并告诉我以下内容:
Unchecked call to 'MultiKey(K,K)' as a member of raw type 'org.apache.commons.collections4.keyvalue.MultiKey
Signal places where an unchecked warning is issued by the compiler.https://stackoverflow.com/questions/47559507
复制相似问题