From 67f44bfbeb7cc991bb1d0bab6d03a33dde195461 Mon Sep 17 00:00:00 2001 From: "Maxim.Medvedev" Date: Sat, 4 Aug 2012 23:03:13 +0400 Subject: [PATCH] fix AIOOBE --- .../GroovyParameterInfoHandler.java | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parameterInfo/GroovyParameterInfoHandler.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parameterInfo/GroovyParameterInfoHandler.java index 8cc2aa1fed2e..612eb09574ee 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parameterInfo/GroovyParameterInfoHandler.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parameterInfo/GroovyParameterInfoHandler.java @@ -261,18 +261,19 @@ public class GroovyParameterInfoHandler implements ParameterInfoHandlerWithTabAc } assert argTypes != null; - - if (parameterTypes.length <= currIndex) { - context.setUIComponentEnabled(i, false); - continue; - } - else { - for (int j = 0; j < currIndex; j++) { - PsiType argType = argTypes[j]; - final PsiType paramType = substitutor != null ? substitutor.substitute(parameterTypes[j]) : parameterTypes[j]; - if (!TypesUtil.isAssignable(paramType, argType, place)) { - context.setUIComponentEnabled(i, false); - break Outer; + if (argTypes.length > currIndex) { + if (parameterTypes.length <= currIndex) { + context.setUIComponentEnabled(i, false); + continue; + } + else { + for (int j = 0; j < currIndex; j++) { + PsiType argType = argTypes[j]; + final PsiType paramType = substitutor != null ? substitutor.substitute(parameterTypes[j]) : parameterTypes[j]; + if (!TypesUtil.isAssignable(paramType, argType, place)) { + context.setUIComponentEnabled(i, false); + break Outer; + } } } }