Program: 185497
Project: 185497
Buggy source:
@Override public void visitConstructorCallExpression(ConstructorCallExpression node){
  boolean shouldContinue=handleSimpleExpression(node);
  if (shouldContinue) {
    ClassNode type=node.getType();
    visitClassReference(node.isUsingAnonymousInnerClass() ? type.getUnresolvedSuperClass() : type);
    if (node.getArguments() instanceof TupleExpression) {
      TupleExpression tuple=(TupleExpression)node.getArguments();
      if (isNotEmpty(tuple.getExpressions())) {
        if ((tuple.getExpressions().size() == 1 && tuple.getExpressions().get(0) instanceof MapExpression) || tuple.getExpression(tuple.getExpressions().size() - 1) instanceof NamedArgumentListExpression) {
          enclosingConstructorCall=node;
        }
      }
    }
    super.visitConstructorCallExpression(node);
    if (node.isUsingAnonymousInnerClass()) {
      scopes.add(new VariableScope(scopes.getLast(),type,false));
      ASTNode enclosingDeclaration0=enclosingDeclarationNode;
      IJavaElement enclosingElement0=enclosingElement;
      enclosingDeclarationNode=type;
      try {
        for (        ClassNode face : type.getInterfaces()) {
          if (face.getEnd() > 0)           visitClassReference(face);
        }
        for (        Statement stmt : type.getObjectInitializerStatements()) {
          stmt.visit(this);
        }
        for (        FieldNode field : type.getFields()) {
          if (field.getEnd() > 0) {
            visitField(field);
          }
        }
        for (        MethodNode method : type.getMethods()) {
          if (method.getEnd() > 0) {
            visitMethodInternal(method,false);
          }
        }
      }
  finally {
        scopes.removeLast();
        enclosingElement=enclosingElement0;
        enclosingDeclarationNode=enclosingDeclaration0;
      }
    }
  }
}

Fixed version (ground truth):
@Override public void visitConstructorCallExpression(ConstructorCallExpression node){
  boolean shouldContinue=handleSimpleExpression(node);
  if (shouldContinue) {
    ClassNode type=node.getType();
    visitClassReference(node.isUsingAnonymousInnerClass() ? type.getUnresolvedSuperClass() : type);
    if (node.getArguments() instanceof TupleExpression) {
      TupleExpression tuple=(TupleExpression)node.getArguments();
      if (isNotEmpty(tuple.getExpressions())) {
        if ((tuple.getExpressions().size() == 1 && tuple.getExpressions().get(0) instanceof MapExpression) || tuple.getExpression(tuple.getExpressions().size() - 1) instanceof NamedArgumentListExpression) {
          enclosingConstructorCall=node;
        }
      }
    }
    super.visitConstructorCallExpression(node);
    if (node.isUsingAnonymousInnerClass()) {
      scopes.add(new VariableScope(scopes.getLast(),type,false));
      ASTNode enclosingDeclaration0=enclosingDeclarationNode;
      IJavaElement enclosingElement0=enclosingElement;
      enclosingDeclarationNode=type;
      try {
        for (        ClassNode face : type.getInterfaces()) {
          if (face.getEnd() > 0)           visitClassReference(face);
        }
        for (        Statement stmt : type.getObjectInitializerStatements()) {
          stmt.visit(this);
        }
        for (        FieldNode field : type.getFields()) {
          if (field.getEnd() > 0) {
            enclosingElement=findAnonType(type).getField(field.getName());
            visitField(field);
          }
        }
        for (        MethodNode method : type.getMethods()) {
          if (method.getEnd() > 0) {
            enclosingElement=findAnonType(type).getMethod(method.getName(),GroovyUtils.getParameterTypeSignatures(method,true));
            visitMethodInternal(method,false);
          }
        }
      }
  finally {
        scopes.removeLast();
        enclosingElement=enclosingElement0;
        enclosingDeclarationNode=enclosingDeclaration0;
      }
    }
  }
}