PsiDiamondTypeUtil#removeRedundantTypeArguments: short-cut if there are no type arguments

This commit is contained in:
Tagir Valeev
2018-05-30 18:23:38 +07:00
parent 3c2cd21d35
commit 77a5238f3e
@@ -356,6 +356,7 @@ public class PsiDiamondTypeUtil {
PsiElementFactory factory = JavaPsiFacade.getInstance(element.getProject()).getElementFactory();
for(PsiMethodCallExpression call : PsiTreeUtil.collectElementsOfType(element, PsiMethodCallExpression.class)) {
PsiType[] arguments = call.getTypeArguments();
if (arguments.length == 0) continue;
PsiMethod method = call.resolveMethod();
if(method != null) {
PsiTypeParameter[] parameters = method.getTypeParameters();