@Override
    public void visitMethodCallExpression(MethodCallExpression expression) {
      // LOG.debug "Transforming expression '${expression}':"

      if (expression.getLineNumber() >= 0 && expression.getLineNumber() < lineNumbers.length) {
        // LOG.debug "   start from ${expression.lineNumber} to ${lineNumbers[expression.lineNumber
        // - 1]}"
        expression.setLineNumber(lineNumbers[expression.getLineNumber() - 1]);
      }

      if (expression.getLastLineNumber() > 0
          && expression.getLastLineNumber() < lineNumbers.length) {
        // LOG.debug "   end from ${expression.lastLineNumber} to
        // ${lineNumbers[expression.lastLineNumber - 1]}"
        expression.setLastLineNumber(lineNumbers[expression.getLastLineNumber() - 1]);
      }
      super.visitMethodCallExpression(expression);
    }
  @Override
  public void visitMethodCallExpression(final MethodCallExpression call) {
    super.visitMethodCallExpression(call);

    MethodNode target = (MethodNode) call.getNodeMetaData(DIRECT_METHOD_CALL_TARGET);
    if (target != null) {
      call.setMethodTarget(target);
      memorizeInitialExpressions(target);
    }

    if (call.getMethodTarget() == null && call.getLineNumber() > 0) {
      addError("Target method for method call expression hasn't been set", call);
    }
  }
 /**
  * Add a new Violation to the list of violations found by this visitor. Only add the violation if
  * the node lineNumber >= 0.
  *
  * @param node - the Groovy AST Node
  * @param message - the message for the violation; defaults to null
  */
 protected void addViolation(MethodCallExpression node, String message) {
   if (node.getLineNumber() >= 0) {
     int lineNumber = AstUtil.findFirstNonAnnotationLine(node, sourceCode);
     String sourceLine = sourceCode.line(AstUtil.findFirstNonAnnotationLine(node, sourceCode) - 1);
     Violation violation = new Violation();
     violation.setRule(rule);
     violation.setLineNumber(lineNumber);
     violation.setSourceLine(sourceLine);
     if (currentClassNode != null) {
       violation.setMessage(
           String.format("Violation in class %s. %s", currentClassNode.getName(), message));
     } else {
       violation.setMessage(message);
     }
     violations.add(violation);
   }
 }