BaseInspectionVisitor () { return new BaseInspectionVisitor() { @Override public void visitExpression(@NotNull GrExpression expression) { Transformation<?> transformation = getTransformation(expression); if (transformation == null) return; PsiElement highlightingElement = getHighlightingElement(expression); if (highlightingElement == null) return; if (transformation.couldApplyRow(expression)) { registerError( highlightingElement, GroovyBundle.message("replace.with.method.message", transformation.getMethod()), new LocalQuickFix[]{new TransformationBasedFix(transformation)}, GENERIC_ERROR_OR_WARNING ); } } }; }