From 0953c36bb56b01aeab15dd9596464554781960bb Mon Sep 17 00:00:00 2001 From: "Anna.Kozlova" Date: Mon, 13 Mar 2017 15:15:50 +0100 Subject: [PATCH] EA-98872 - assert: RedundantArrayForVarargsCallInspection$.checkCall --- .../miscGenerics/RedundantArrayForVarargsCallInspection.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/java/java-impl/src/com/intellij/codeInspection/miscGenerics/RedundantArrayForVarargsCallInspection.java b/java/java-impl/src/com/intellij/codeInspection/miscGenerics/RedundantArrayForVarargsCallInspection.java index d88b4e59e407..07c9b046bada 100644 --- a/java/java-impl/src/com/intellij/codeInspection/miscGenerics/RedundantArrayForVarargsCallInspection.java +++ b/java/java-impl/src/com/intellij/codeInspection/miscGenerics/RedundantArrayForVarargsCallInspection.java @@ -102,8 +102,11 @@ public class RedundantArrayForVarargsCallInspection extends GenericsInspectionTo } PsiExpression lastArg = args[args.length - 1]; PsiParameter lastParameter = parameters[args.length - 1]; + if (!lastParameter.isVarArgs()) { + return; + } PsiType lastParamType = lastParameter.getType(); - LOG.assertTrue(lastParamType instanceof PsiEllipsisType); + LOG.assertTrue(lastParamType instanceof PsiEllipsisType, lastParamType); if (!(lastArg instanceof PsiNewExpression)) { return; }