聲納得到下述空指針違規低於線聲納空指針侵犯
existed.keySet()
請你能幫助我們解決這個問題。
private boolean isEqualCaptions(Map<String, String> existed, Map<String, String> updated) {
if(existed == null && updated != null) return false;
if(existed != null && updated == null) return false;
for(String key:existed.keySet()){
if(existed.get(key).compareTo(updated.get(key)) != 0) return false;
}
return true;
}
如果什麼'存在== NULL &&更新= = null'? – shmosel
如果'存在'和'更新'都是空值,那麼你的代碼不可能工作。 –