Program: 27803
Project: 27803
Buggy source:
/** 
 * Counts the number of direct (full) references to an object. Specifically, we check for references of the following type: <pre> x; x.fn(); </pre>
 */
private boolean isInlinableObject(List<Reference> refs){
  boolean ret=false;
  Set<String> validProperties=Sets.newHashSet();
  for (  Reference ref : refs) {
    Node name=ref.getNode();
    Node parent=ref.getParent();
    Node gramps=ref.getGrandparent();
    if (parent.isGetProp()) {
      Preconditions.checkState(parent.getFirstChild() == name);
      if (gramps.isCall() && gramps.getFirstChild() == parent) {
        return false;
      }
      if (gramps.isDelProp()) {
        return false;
      }
      String propName=parent.getLastChild().getString();
      if (!validProperties.contains(propName)) {
        if (NodeUtil.isVarOrSimpleAssignLhs(parent,gramps)) {
          validProperties.add(propName);
        }
 else {
          return false;
        }
      }
      continue;
    }
    if (!isVarOrAssignExprLhs(name)) {
      return false;
    }
    Node val=ref.getAssignedValue();
    if (val == null) {
      continue;
    }
    if (!val.isObjectLit()) {
      return false;
    }
    for (Node child=val.getFirstChild(); child != null; child=child.getNext()) {
      if (child.isGetterDef() || child.isSetterDef()) {
        return false;
      }
      validProperties.add(child.getString());
      Node childVal=child.getFirstChild();
      for (      Reference t : refs) {
        Node refNode=t.getParent();
        while (!NodeUtil.isStatementBlock(refNode)) {
          if (refNode == childVal) {
            return false;
          }
          refNode=refNode.getParent();
        }
      }
    }
    ret=true;
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * Counts the number of direct (full) references to an object. Specifically, we check for references of the following type: <pre> x; x.fn(); </pre>
 */
private boolean isInlinableObject(List<Reference> refs){
  boolean ret=false;
  Set<String> validProperties=Sets.newHashSet();
  for (  Reference ref : refs) {
    Node name=ref.getNode();
    Node parent=ref.getParent();
    Node gramps=ref.getGrandparent();
    if (parent.isGetProp()) {
      Preconditions.checkState(parent.getFirstChild() == name);
      if (gramps.isCall() && gramps.getFirstChild() == parent) {
        return false;
      }
      if (gramps.isDelProp()) {
        return false;
      }
      String propName=parent.getLastChild().getString();
      if (!validProperties.contains(propName)) {
        if (NodeUtil.isVarOrSimpleAssignLhs(parent,gramps)) {
          validProperties.add(propName);
        }
 else {
          return false;
        }
      }
      continue;
    }
    if (!isVarOrAssignExprLhs(name)) {
      return false;
    }
    Node val=ref.getAssignedValue();
    if (val == null) {
      continue;
    }
    if (!val.isObjectLit()) {
      return false;
    }
    for (Node child=val.getFirstChild(); child != null; child=child.getNext()) {
      if (!NodeUtil.isOptimizableObjectLitKey(child)) {
        return false;
      }
      validProperties.add(child.getString());
      Node childVal=child.getFirstChild();
      for (      Reference t : refs) {
        Node refNode=t.getParent();
        while (!NodeUtil.isStatementBlock(refNode)) {
          if (refNode == childVal) {
            return false;
          }
          refNode=refNode.getParent();
        }
      }
    }
    ret=true;
  }
  return ret;
}