[java-inspections] MismatchedCollectionQueryUpdateInspection: assume a collection as non-empty if its constructor accepts iterator

GitOrigin-RevId: 2d381e8ae775efa7cbe621aa185766fa74abcc6f
This commit is contained in:
Tagir Valeev
2024-11-08 13:00:01 +00:00
committed by intellij-monorepo-bot
parent d3032a36a0
commit 461d220ace
@@ -506,6 +506,9 @@ public final class MismatchedCollectionQueryUpdateInspection extends BaseInspect
if (CollectionUtils.isCollectionClassOrInterface(type)) {
return false;
}
if (InheritanceUtil.isInheritor(type, CommonClassNames.JAVA_UTIL_ITERATOR)) {
return false;
}
if (type instanceof PsiArrayType && !(type instanceof PsiEllipsisType)) {
return false;
}