当两个列表的长度不相等时,我需要throw RuntimeException。我们正在使用SonarQube工具进行代码评审。if (objctArray.length !}
现在,SonarQube提出了Define and throw a dedicated exception instead of using a generic one.在thrownew RuntimeException行上的问题。我不知道可以替换哪个异
我正在为ArrayList编写一个方法removeAll。通过接口,removeAll接受一个Collection<?>,然而,无论出于什么原因,我希望Collection只包含Strings。(我不是在讨论每个元素,就像这样: if (!", el.toString()));}
这是我的备份,但如果可能的话,我宁愿一次检查整个Collection。)我</