boolean (@NotNull GroovyResolveResult result) { if (result instanceof GroovyConstructorResult && ((GroovyConstructorResult)result).isMapConstructor()) return true; if (!(result instanceof GroovyConstructorResult) && result.getElement() instanceof PsiMethod && !((PsiMethod)result.getElement()).hasParameters()) return true; PsiElement method = result.getElement(); if (method instanceof PsiMethod) { PsiParameter[] parameters = ((PsiMethod)method).getParameterList().getParameters(); PsiClass containingClass = ((PsiMethod)method).getContainingClass(); if (containingClass == null) return false; GroovyPsiElementFactory factory = GroovyPsiElementFactory.getInstance(method.getProject()); if (parameters.length <= 2 && containingClass.hasAnnotation(GROOVY_TRANSFORM_MAP_CONSTRUCTOR)) { if (parameters.length == 2 && !(parameters[0] instanceof ConstructorAnnotationsProcessor.EnclosingClassParameter)) { return false; } PsiType lastParameterType = parameters[parameters.length - 1].getType(); return TypesUtil.isAssignableByMethodCallConversion(lastParameterType, factory.createTypeByFQClassName(JAVA_UTIL_MAP), method); } } return false; }