void (@NotNull GrIndexProperty expression) { final GrExpression selectedExpression = expression.getInvokedExpression(); final PsiType thisType = selectedExpression.getType(); final GrArgumentList argList = expression.getArgumentList(); if (argList.getAllArguments().length == 0) { // int[] or String[] if (selectedExpression instanceof GrBuiltinTypeClassExpression) { selectedExpression.accept(this); return; } else if (selectedExpression instanceof GrReferenceExpression) { PsiElement resolved = ((GrReferenceExpression)selectedExpression).resolve(); if (resolved instanceof PsiClass) { builder.append(((PsiClass)resolved).getQualifiedName()); builder.append("[].class"); return; } } } final PsiType[] argTypes = PsiUtil.getArgumentTypes(argList); final GrExpression[] exprArgs = argList.getExpressionArguments(); final GrNamedArgument[] namedArgs = argList.getNamedArguments(); if (!PsiImplUtil.isSimpleArrayAccess(thisType, argTypes, expression, PsiUtil.isLValue(expression))) { final GroovyResolveResult candidate = advancedResolve(expression); PsiElement element = candidate.getElement(); if (element != null || !PsiUtil.isLValue(expression)) { //see the case of l-value in assignment expression if (element instanceof GrGdkMethod && ((GrGdkMethod)element).getReceiverType().equalsToText("java.util.Map<K,V>")) { PsiClass map = JavaPsiFacade.getInstance(context.project).findClass(CommonClassNames.JAVA_UTIL_MAP, expression.getResolveScope()); if (map != null) { PsiMethod[] gets = map.findMethodsByName("get", false); invokeMethodOn(gets[0], selectedExpression, exprArgs, namedArgs, GrClosableBlock.EMPTY_ARRAY, PsiSubstitutor.EMPTY, expression); return; } } else if (element instanceof GrGdkMethod && ((GrGdkMethod)element).getReceiverType().equalsToText("java.util.List<T>")) { PsiClass list = JavaPsiFacade.getInstance(context.project).findClass(CommonClassNames.JAVA_UTIL_LIST, expression.getResolveScope()); if (list != null) { PsiMethod[] gets = list.findMethodsByName("get", false); invokeMethodOn(gets[0], selectedExpression, exprArgs, namedArgs, GrClosableBlock.EMPTY_ARRAY, PsiSubstitutor.EMPTY, expression); return; } } GenerationUtil .invokeMethodByResolveResult(selectedExpression, candidate, "getAt", exprArgs, namedArgs, GrClosableBlock.EMPTY_ARRAY, this, expression); return; } } selectedExpression.accept(this); builder.append('['); final GrExpression arg = exprArgs[0]; arg.accept(this); builder.append(']'); }