Program: 93482
Project: 93482
Buggy source:
private boolean findUsages(){
  ensureIsNotNull(astEnclosingMethodDeclaration);
  astEnclosingMethodDeclaration.accept(new ASTVisitor(){
    @Override public boolean visit(    final SimpleName node){
      final IVariableBinding var=BindingUtils.getVariableBinding(node);
      if (var == null) {
        return true;
      }
      if (var.getName().equals(localVariable.getNameLiteral())) {
        determineVariableKind(var);
        final ASTNode parent=node.getParent();
        if (parent instanceof MethodInvocation) {
          registerMethodCallOnReceiver((MethodInvocation)parent);
        }
 else         if (parent instanceof Assignment) {
          evaluateAssignment((Assignment)parent);
        }
 else         if (parent instanceof VariableDeclarationFragment) {
          evaluateVariableDeclarationFragment((VariableDeclarationFragment)parent);
        }
      }
      return true;
    }
    private void determineVariableKind(    final IVariableBinding var){
      if (var.isParameter()) {
        localVariableKind=ObjectInstanceKey.Kind.PARAMETER;
      }
 else       if (var.isField()) {
        localVariableKind=Kind.FIELD;
      }
 else {
        localVariableKind=Kind.LOCAL;
      }
    }
    private void evaluateVariableDeclarationFragment(    final VariableDeclarationFragment fragment){
      checkIsAssignmentForMethodReturn(fragment);
      final Expression initializer=fragment.getInitializer();
      if (initializer instanceof ClassInstanceCreation) {
        registerConstructorCallOnVariable((ClassInstanceCreation)initializer);
      }
    }
    private void checkIsAssignmentForMethodReturn(    final VariableDeclarationFragment fragment){
      final SimpleName name=fragment.getName();
      if (name.getIdentifier().equals(localVariable.getNameLiteral())) {
        localVariableKind=Kind.RETURN;
      }
    }
    private void evaluateAssignment(    final Assignment a){
      final Expression rhs=a.getRightHandSide();
      if (rhs instanceof ClassInstanceCreation) {
        registerConstructorCallOnVariable((ClassInstanceCreation)rhs);
        localVariableKind=Kind.LOCAL;
      }
    }
    private void registerConstructorCallOnVariable(    final ClassInstanceCreation invoke){
      final IMethodBinding b=invoke.resolveConstructorBinding();
      final IMethodName method=BindingUtils.toMethodName(b);
      if (method != null) {
        receiverMethodInvocations.add(method);
      }
    }
    private void registerMethodCallOnReceiver(    final MethodInvocation invoke){
      final IMethodBinding b=invoke.resolveMethodBinding();
      final IMethodName method=BindingUtils.toMethodName(b);
      if (method != null) {
        receiverMethodInvocations.add(method);
      }
    }
  }
);
  return true;
}

Fixed version (ground truth):
private boolean findUsages(){
  ensureIsNotNull(astEnclosingMethodDeclaration);
  astEnclosingMethodDeclaration.accept(new ASTVisitor(){
    @Override public boolean visit(    final SimpleName node){
      final IVariableBinding var=BindingUtils.getVariableBinding(node);
      if (var == null) {
        return true;
      }
      if (var.getName().equals(localVariable.getNameLiteral())) {
        determineVariableKind(var);
        final ASTNode parent=node.getParent();
        if (parent instanceof MethodInvocation) {
          registerMethodCallOnReceiver((MethodInvocation)parent);
        }
 else         if (parent instanceof Assignment) {
          evaluateAssignment((Assignment)parent);
        }
 else         if (parent instanceof VariableDeclarationFragment) {
          evaluateVariableDeclarationFragment((VariableDeclarationFragment)parent);
        }
      }
      return true;
    }
    private void determineVariableKind(    final IVariableBinding var){
      if (var.isParameter()) {
        localVariableKind=ObjectInstanceKey.Kind.PARAMETER;
      }
 else       if (var.isField()) {
        localVariableKind=Kind.FIELD;
      }
 else {
        localVariableKind=Kind.LOCAL;
      }
    }
    private void evaluateVariableDeclarationFragment(    final VariableDeclarationFragment fragment){
      checkIsAssignmentForMethodReturn(fragment);
      final Expression initializer=fragment.getInitializer();
      if (initializer instanceof ClassInstanceCreation) {
        registerConstructorCallOnVariable((ClassInstanceCreation)initializer);
      }
    }
    private void checkIsAssignmentForMethodReturn(    final VariableDeclarationFragment fragment){
      if (isVariableDeclarationOfCurrentVariable(fragment) && !isConstructorCall(fragment.getInitializer())) {
        localVariableKind=Kind.RETURN;
      }
    }
    private boolean isConstructorCall(    final Expression initializer){
      return initializer instanceof ClassInstanceCreation;
    }
    private boolean isVariableDeclarationOfCurrentVariable(    final VariableDeclarationFragment fragment){
      final SimpleName astName=fragment.getName();
      final String astNameLiteral=astName.getIdentifier();
      final String recNameLiteral=localVariable.getNameLiteral();
      return astNameLiteral.equals(recNameLiteral);
    }
    private void evaluateAssignment(    final Assignment a){
      final Expression rhs=a.getRightHandSide();
      if (rhs instanceof ClassInstanceCreation) {
        registerConstructorCallOnVariable((ClassInstanceCreation)rhs);
        localVariableKind=Kind.LOCAL;
      }
    }
    private void registerConstructorCallOnVariable(    final ClassInstanceCreation invoke){
      final IMethodBinding b=invoke.resolveConstructorBinding();
      final IMethodName method=BindingUtils.toMethodName(b);
      if (method != null) {
        receiverMethodInvocations.add(method);
      }
    }
    private void registerMethodCallOnReceiver(    final MethodInvocation invoke){
      final IMethodBinding b=invoke.resolveMethodBinding();
      final IMethodName method=BindingUtils.toMethodName(b);
      if (method != null) {
        receiverMethodInvocations.add(method);
      }
    }
  }
);
  return true;
}