From 0b0a2ea0e56994b9e2404b05cebf67e239445e8b Mon Sep 17 00:00:00 2001 From: "Roman.Ivanov" Date: Thu, 24 May 2018 10:17:51 +0700 Subject: [PATCH] WrapperTypeMayBePrimitive: ignore while mismatch parameter and arg count EA-120929 --- .../codeInspection/WrapperTypeMayBePrimitiveInspection.java | 1 + 1 file changed, 1 insertion(+) diff --git a/java/java-impl/src/com/intellij/codeInspection/WrapperTypeMayBePrimitiveInspection.java b/java/java-impl/src/com/intellij/codeInspection/WrapperTypeMayBePrimitiveInspection.java index 35c8e9ec4d07..ad2d63a61538 100644 --- a/java/java-impl/src/com/intellij/codeInspection/WrapperTypeMayBePrimitiveInspection.java +++ b/java/java-impl/src/com/intellij/codeInspection/WrapperTypeMayBePrimitiveInspection.java @@ -174,6 +174,7 @@ public class WrapperTypeMayBePrimitiveInspection extends AbstractBaseJavaLocalIn if (method == null) return true; PsiParameter[] parameters = method.getParameterList().getParameters(); int parameterIndex = parameters.length < argumentsIndex + 1 ? parameters.length - 1 : argumentsIndex; + if (parameterIndex < 0) return false; PsiParameter parameter = parameters[parameterIndex]; PsiType type = parameter.getType(); if (type instanceof PsiPrimitiveType) {