Program: 27913
Project: 27913
Buggy source:
/** 
 * Splits up the object literal into individual variables, and updates all uses.
 */
private void splitObject(Var v,Reference init,ReferenceCollection referenceInfo){
  Map<String,String> varmap=computeVarList(referenceInfo);
  Map<String,Node> initvals=Maps.newHashMap();
  Node vnode;
  boolean defined=referenceInfo.isWellDefined() && init.getParent().isVar();
  if (defined) {
    vnode=init.getParent();
    fillInitialValues(init,initvals);
  }
 else {
    vnode=v.getScope().getRootNode().getLastChild().getFirstChild();
  }
  for (  Map.Entry<String,String> entry : varmap.entrySet()) {
    Node val=initvals.get(entry.getKey());
    Node varnode=NodeUtil.newVarNode(entry.getValue(),val);
    if (val == null) {
      varnode.copyInformationFromForTree(vnode);
    }
 else {
      blacklistVarReferencesInTree(val,v.scope);
    }
    vnode.getParent().addChildBefore(varnode,vnode);
  }
  if (defined) {
    vnode.getParent().removeChild(vnode);
  }
  for (  Reference ref : referenceInfo.references) {
    if (defined && ref == init) {
      continue;
    }
    if (ref.isLvalue()) {
      replaceAssignmentExpression(v,ref,varmap);
    }
 else     if (ref.getParent().isVar()) {
      ref.getGrandparent().removeChild(ref.getParent());
    }
 else {
      Node getprop=ref.getParent();
      Preconditions.checkState(getprop.isGetProp());
      String var=getprop.getChildAtIndex(1).getString();
      Preconditions.checkState(varmap.containsKey(var));
      Node replacement=IR.name(varmap.get(var));
      replacement.copyInformationFrom(getprop);
      ref.getGrandparent().replaceChild(ref.getParent(),replacement);
    }
  }
  compiler.reportCodeChange();
}

Fixed version (ground truth):
/** 
 * Splits up the object literal into individual variables, and updates all uses.
 */
private void splitObject(Var v,Reference init,ReferenceCollection referenceInfo){
  Map<String,String> varmap=computeVarList(referenceInfo);
  Map<String,Node> initvals=Maps.newHashMap();
  Node vnode;
  boolean defined=referenceInfo.isWellDefined() && init.getParent().isVar();
  if (defined) {
    vnode=init.getParent();
    fillInitialValues(init,initvals);
  }
 else {
    vnode=v.getScope().getRootNode().getLastChild().getFirstChild();
  }
  for (  Map.Entry<String,String> entry : varmap.entrySet()) {
    Node val=initvals.get(entry.getKey());
    Node varnode=NodeUtil.newVarNode(entry.getValue(),val);
    if (val == null) {
      varnode.copyInformationFromForTree(vnode);
    }
 else {
      blacklistVarReferencesInTree(val,v.scope);
    }
    vnode.getParent().addChildBefore(varnode,vnode);
    compiler.reportChangeToEnclosingScope(vnode);
  }
  if (defined) {
    vnode.getParent().removeChild(vnode);
  }
  for (  Reference ref : referenceInfo.references) {
    compiler.reportChangeToEnclosingScope(ref.getNode());
    if (defined && ref == init) {
      continue;
    }
    if (ref.isLvalue()) {
      replaceAssignmentExpression(v,ref,varmap);
    }
 else     if (ref.getParent().isVar()) {
      ref.getGrandparent().removeChild(ref.getParent());
    }
 else {
      Node getprop=ref.getParent();
      Preconditions.checkState(getprop.isGetProp());
      String var=getprop.getChildAtIndex(1).getString();
      Preconditions.checkState(varmap.containsKey(var));
      Node replacement=IR.name(varmap.get(var));
      replacement.copyInformationFrom(getprop);
      ref.getGrandparent().replaceChild(ref.getParent(),replacement);
    }
  }
}