nus-yam/ex-repair huggingface dataset:
Program: 40220
Project: 40220
Buggy source:
@Override public CAstNode visitVariableDeclaration(VariableDeclaration node,WalkContext arg){
  List<VariableInitializer> inits=node.getVariables();
  CAstNode[] children=new CAstNode[inits.size()];
  int i=0;
  for (  VariableInitializer init : inits) {
    arg.addNameDecl(noteSourcePosition(arg,Ast.makeNode(CAstNode.DECL_STMT,Ast.makeConstant(new CAstSymbolImpl(init.getTarget().getString())),readName(arg,"String_Node_Str")),node));
    children[i++]=Ast.makeNode(CAstNode.ASSIGN,Ast.makeNode(CAstNode.VAR,Ast.makeConstant(init.getTarget().getString())),visit(init,arg));
  }
  return Ast.makeNode(CAstNode.BLOCK_STMT,children);
}

Fixed version (ground truth):
@Override public CAstNode visitVariableDeclaration(VariableDeclaration node,WalkContext arg){
  List<VariableInitializer> inits=node.getVariables();
  CAstNode[] children=new CAstNode[inits.size()];
  int i=0;
  for (  VariableInitializer init : inits) {
    arg.addNameDecl(noteSourcePosition(arg,Ast.makeNode(CAstNode.DECL_STMT,Ast.makeConstant(new CAstSymbolImpl(init.getTarget().getString())),readName(arg,"String_Node_Str")),node));
    if (init.getInitializer() == null) {
      children[i++]=Ast.makeNode(CAstNode.EMPTY);
    }
 else {
      children[i++]=Ast.makeNode(CAstNode.ASSIGN,Ast.makeNode(CAstNode.VAR,Ast.makeConstant(init.getTarget().getString())),visit(init,arg));
    }
  }
  return Ast.makeNode(CAstNode.BLOCK_STMT,children);
}
Program: 40221
Project: 40221
Buggy source:
@Override public CAstNode visitBreakStatement(BreakStatement node,WalkContext arg){
  CAstNode breakStmt;
  if (node.getBreakLabel() != null) {
    breakStmt=Ast.makeNode(CAstNode.GOTO,Ast.makeConstant(node.getBreakLabel().getIdentifier()));
  }
 else {
    breakStmt=Ast.makeNode(CAstNode.GOTO);
  }
  arg.cfg().map(node,breakStmt);
  Node target=node.getBreakTarget();
  arg.cfg().add(node,target,null);
  return breakStmt;
}

Fixed version (ground truth):
@Override public CAstNode visitBreakStatement(BreakStatement node,WalkContext arg){
  CAstNode breakStmt;
  Node target;
  if (node.getBreakLabel() != null) {
    breakStmt=Ast.makeNode(CAstNode.GOTO,Ast.makeConstant(node.getBreakLabel().getIdentifier()));
    target=arg.getBreakFor(node.getBreakLabel().getIdentifier());
  }
 else {
    breakStmt=Ast.makeNode(CAstNode.GOTO);
    target=arg.getBreakFor(null);
  }
  arg.cfg().map(node,breakStmt);
  arg.cfg().add(node,target,null);
  return breakStmt;
}
Program: 40222
Project: 40222
Buggy source:
@Override public CAstNode visitSwitchStatement(SwitchStatement node,WalkContext context){
  int i=0;
  CAstNode[] children=new CAstNode[node.getCases().size() * 2];
  for (  SwitchCase sc : node.getCases()) {
    CAstNode label=Ast.makeNode(CAstNode.LABEL_STMT,Ast.makeConstant(String.valueOf(i / 2)),Ast.makeNode(CAstNode.EMPTY));
    context.cfg().map(label,label);
    children[i++]=label;
    if (sc.isDefault()) {
      context.cfg().add(node,label,CAstControlFlowMap.SWITCH_DEFAULT);
    }
 else {
      CAstNode labelCAst=visit(sc.getExpression(),context);
      context.cfg().add(node,label,labelCAst);
    }
    children[i++]=visit(sc,context);
  }
  CAstNode s=Ast.makeNode(CAstNode.SWITCH,visit(node.getExpression(),context),Ast.makeNode(CAstNode.BLOCK_STMT,children));
  context.cfg().map(node,s);
  return s;
}

Fixed version (ground truth):
@Override public CAstNode visitSwitchStatement(SwitchStatement node,WalkContext context){
  AstNode breakStmt=makeEmptyLabelStmt("String_Node_Str");
  CAstNode breakLabel=visit(breakStmt,context);
  WalkContext switchBodyContext=makeBreakContext(node,context,breakStmt);
  int i=0;
  CAstNode[] children=new CAstNode[node.getCases().size() * 2];
  for (  SwitchCase sc : node.getCases()) {
    CAstNode label=Ast.makeNode(CAstNode.LABEL_STMT,Ast.makeConstant(String.valueOf(i / 2)),Ast.makeNode(CAstNode.EMPTY));
    context.cfg().map(label,label);
    children[i++]=label;
    if (sc.isDefault()) {
      context.cfg().add(node,label,CAstControlFlowMap.SWITCH_DEFAULT);
    }
 else {
      CAstNode labelCAst=visit(sc.getExpression(),context);
      context.cfg().add(node,label,labelCAst);
    }
    children[i++]=visit(sc,switchBodyContext);
  }
  CAstNode s=Ast.makeNode(CAstNode.SWITCH,visit(node.getExpression(),context),Ast.makeNode(CAstNode.BLOCK_STMT,children));
  context.cfg().map(node,s);
  return Ast.makeNode(CAstNode.BLOCK_STMT,s,breakLabel);
}
Program: 40223
Project: 40223
Buggy source:
@Override public CAstNode visitFunctionCall(FunctionCall n,WalkContext context){
  if (!isPrimitiveCall(context,n)) {
    CAstNode base=Ast.makeNode(CAstNode.VAR,Ast.makeConstant("String_Node_Str"));
    AstNode callee=n.getTarget();
    WalkContext child=new BaseCollectingContext(context,callee,base);
    CAstNode fun=visit(callee,child);
    CAstNode[] args=gatherCallArguments(n,context);
    if (child.foundBase(callee))     return Ast.makeNode(CAstNode.LOCAL_SCOPE,Ast.makeNode(CAstNode.BLOCK_EXPR,Ast.makeNode(CAstNode.DECL_STMT,Ast.makeConstant(new CAstSymbolImpl("String_Node_Str")),Ast.makeConstant(null)),makeCall(fun,base,args,context)));
 else     return makeCall(fun,makeVarRef(JSSSAPropagationCallGraphBuilder.GLOBAL_OBJ_VAR_NAME),args,context);
  }
 else {
    return Ast.makeNode(CAstNode.PRIMITIVE,gatherCallArguments(n,context));
  }
}

Fixed version (ground truth):
@Override public CAstNode visitFunctionCall(FunctionCall n,WalkContext context){
  if (!isPrimitiveCall(context,n)) {
    CAstNode base=Ast.makeNode(CAstNode.VAR,Ast.makeConstant(baseVarName));
    AstNode callee=n.getTarget();
    WalkContext child=new BaseCollectingContext(context,callee,base);
    CAstNode fun=visit(callee,child);
    CAstNode[] args=gatherCallArguments(n,context);
    if (child.foundBase(callee))     return Ast.makeNode(CAstNode.LOCAL_SCOPE,Ast.makeNode(CAstNode.BLOCK_EXPR,Ast.makeNode(CAstNode.DECL_STMT,Ast.makeConstant(new CAstSymbolImpl(baseVarName)),Ast.makeConstant(null)),makeCall(fun,base,args,context)));
 else     return makeCall(fun,makeVarRef(JSSSAPropagationCallGraphBuilder.GLOBAL_OBJ_VAR_NAME),args,context);
  }
 else {
    return Ast.makeNode(CAstNode.PRIMITIVE,gatherCallArguments(n,context));
  }
}
Program: 40224
Project: 40224
Buggy source:
@Override public CAstNode visitLabeledStatement(LabeledStatement node,WalkContext arg){
  CAstNode result=visit(node.getStatement(),arg);
  for (  Label label : node.getLabels()) {
    result=Ast.makeNode(CAstNode.LABEL_STMT,visit(label,arg),result);
    arg.cfg().map(label,result);
  }
  return result;
}

Fixed version (ground truth):
@Override public CAstNode visitLabeledStatement(LabeledStatement node,WalkContext arg){
  CAstNode result=visit(node.getStatement(),arg);
  AstNode prev=node;
  for (  Label label : node.getLabels()) {
    result=Ast.makeNode(CAstNode.LABEL_STMT,visit(label,arg),result);
    arg.cfg().map(prev,result);
    prev=label;
  }
  return result;
}
Program: 40225
Project: 40225
Buggy source:
protected boolean useLexicalAccessesForExposedVars(){
  return false;
}

Fixed version (ground truth):
protected boolean useLexicalAccessesForExposedVars(){
  return NEW_LEXICAL;
}
Program: 40226
Project: 40226
Buggy source:
protected boolean useLocalValuesForLexicalVars(){
  return true;
}

Fixed version (ground truth):
protected boolean useLocalValuesForLexicalVars(){
  return !NEW_LEXICAL;
}
Program: 40227
Project: 40227
Buggy source:
/** 
 * generate instructions for a write of a global
 */
protected void doGlobalWrite(WalkContext context,String name,int rval){
  Symbol S=context.currentScope().lookup(name);
  if (treatGlobalsAsLexicallyScoped()) {
    if (useLocalValuesForLexicalVars()) {
      int vn=S.valueNumber();
      Access A=new Access(name,null,vn);
      addExposedName(context.top(),null,name,vn,true,context);
      addAccess(context,context.top(),A);
      context.cfg().addInstruction(new AssignInstruction(vn,rval));
      context.cfg().addInstruction(new AstLexicalWrite(A));
    }
 else {
      Access A=new Access(name,null,rval);
      context.cfg().addInstruction(new AstLexicalWrite(A));
    }
  }
 else {
    FieldReference global=makeGlobalRef(name);
    context.cfg().addInstruction(new AstGlobalWrite(global,rval));
  }
}

Fixed version (ground truth):
/** 
 * generate instructions for a write of a global
 */
protected void doGlobalWrite(WalkContext context,String name,int rval){
  Symbol S=context.currentScope().lookup(name);
  if (treatGlobalsAsLexicallyScoped()) {
    if (useLocalValuesForLexicalVars()) {
      int vn=S.valueNumber();
      Access A=new Access(name,null,vn);
      addExposedName(context.top(),null,name,vn,true,context);
      addAccess(context,context.top(),A);
      context.cfg().addInstruction(new AssignInstruction(vn,rval));
      context.cfg().addInstruction(new AstLexicalWrite(A));
    }
 else {
      Access A=new Access(name,null,rval);
      context.cfg().addInstruction(new AstLexicalWrite(A));
      addAccess(context,context.top(),A);
    }
  }
 else {
    FieldReference global=makeGlobalRef(name);
    context.cfg().addInstruction(new AstGlobalWrite(global,rval));
  }
}
Program: 40228
Project: 40228
Buggy source:
/** 
 * Note that the caller is responsible for ensuring that name is defined in a lexical scope.
 */
protected void doLexicallyScopedWrite(WalkContext context,String name,int rval){
  Symbol S=context.currentScope().lookup(name);
  Scope definingScope=S.getDefiningScope();
  CAstEntity E=definingScope.getEntity();
  addExposedName(E,E,name,definingScope.lookup(name).valueNumber(),true,context);
  if (useLocalValuesForLexicalVars()) {
    markExposedInEnclosingEntities(context,name,definingScope,E,context.getEntityName(E),true);
    context.cfg().addInstruction(new AssignInstruction(S.valueNumber(),rval));
    Access A=new Access(name,context.getEntityName(E),rval);
    context.cfg().addInstruction(new AstLexicalWrite(A));
  }
 else {
    Access A=new Access(name,context.getEntityName(E),rval);
    context.cfg().addInstruction(new AstLexicalWrite(A));
  }
}

Fixed version (ground truth):
/** 
 * Note that the caller is responsible for ensuring that name is defined in a lexical scope.
 */
protected void doLexicallyScopedWrite(WalkContext context,String name,int rval){
  Symbol S=context.currentScope().lookup(name);
  Scope definingScope=S.getDefiningScope();
  CAstEntity E=definingScope.getEntity();
  addExposedName(E,E,name,definingScope.lookup(name).valueNumber(),true,context);
  if (useLocalValuesForLexicalVars()) {
    markExposedInEnclosingEntities(context,name,definingScope,E,context.getEntityName(E),true);
    context.cfg().addInstruction(new AssignInstruction(S.valueNumber(),rval));
    Access A=new Access(name,context.getEntityName(E),rval);
    context.cfg().addInstruction(new AstLexicalWrite(A));
  }
 else {
    Access A=new Access(name,context.getEntityName(E),rval);
    context.cfg().addInstruction(new AstLexicalWrite(A));
    addAccess(context,context.top(),A);
  }
}
Program: 40229
Project: 40229
Buggy source:
/** 
 * generate instructions for a read of a global
 */
protected int doGlobalRead(CAstNode node,WalkContext context,String name){
  Symbol S=context.currentScope().lookup(name);
  if (treatGlobalsAsLexicallyScoped()) {
    if (useLocalValuesForLexicalVars()) {
      int vn=S.valueNumber();
      Access A=new Access(name,null,vn);
      addExposedName(context.top(),null,name,vn,false,context);
      addAccess(context,context.top(),A);
      return vn;
    }
 else {
      int result=context.currentScope().allocateTempValue();
      Access A=new Access(name,null,result);
      context.cfg().addInstruction(new AstLexicalRead(A));
      return result;
    }
  }
 else {
    int result=context.currentScope().allocateTempValue();
    FieldReference global=makeGlobalRef(name);
    context.cfg().addInstruction(new AstGlobalRead(result,global));
    return result;
  }
}

Fixed version (ground truth):
/** 
 * generate instructions for a read of a global
 */
protected int doGlobalRead(CAstNode node,WalkContext context,String name){
  Symbol S=context.currentScope().lookup(name);
  if (treatGlobalsAsLexicallyScoped()) {
    if (useLocalValuesForLexicalVars()) {
      int vn=S.valueNumber();
      Access A=new Access(name,null,vn);
      addExposedName(context.top(),null,name,vn,false,context);
      addAccess(context,context.top(),A);
      return vn;
    }
 else {
      int result=context.currentScope().allocateTempValue();
      Access A=new Access(name,null,result);
      context.cfg().addInstruction(new AstLexicalRead(A));
      addAccess(context,context.top(),A);
      return result;
    }
  }
 else {
    int result=context.currentScope().allocateTempValue();
    FieldReference global=makeGlobalRef(name);
    context.cfg().addInstruction(new AstGlobalRead(result,global));
    return result;
  }
}
Program: 40230
Project: 40230
Buggy source:
/** 
 * we only have this method to avoid having to pass a node parameter at other call sites, as would be required for  {@link #doLexicallyScopedRead(CAstNode,WalkContext,String)}
 */
private int doLexReadHelper(WalkContext context,final String name){
  Symbol S=context.currentScope().lookup(name);
  Scope definingScope=S.getDefiningScope();
  CAstEntity E=definingScope.getEntity();
  addExposedName(E,E,name,definingScope.lookup(name).valueNumber(),false,context);
  final String entityName=context.getEntityName(E);
  if (useLocalValuesForLexicalVars()) {
    markExposedInEnclosingEntities(context,name,definingScope,E,entityName,false);
    return S.valueNumber();
  }
 else {
    int result=context.currentScope().allocateTempValue();
    Access A=new Access(name,entityName,result);
    context.cfg().addInstruction(new AstLexicalRead(A));
    return result;
  }
}

Fixed version (ground truth):
/** 
 * we only have this method to avoid having to pass a node parameter at other call sites, as would be required for  {@link #doLexicallyScopedRead(CAstNode,WalkContext,String)}
 */
private int doLexReadHelper(WalkContext context,final String name){
  Symbol S=context.currentScope().lookup(name);
  Scope definingScope=S.getDefiningScope();
  CAstEntity E=definingScope.getEntity();
  addExposedName(E,E,name,definingScope.lookup(name).valueNumber(),false,context);
  final String entityName=context.getEntityName(E);
  if (useLocalValuesForLexicalVars()) {
    markExposedInEnclosingEntities(context,name,definingScope,E,entityName,false);
    return S.valueNumber();
  }
 else {
    int result=context.currentScope().allocateTempValue();
    Access A=new Access(name,entityName,result);
    context.cfg().addInstruction(new AstLexicalRead(A));
    addAccess(context,context.top(),A);
    return result;
  }
}
Program: 40231
Project: 40231
Buggy source:
/** 
 * record that in entity e, the access is performed using a local variable. in  {@link #patchLexicalAccesses(SSAInstruction[],Set)}, this information is used to update an instruction that performs all the accesses at the beginning of the method and defines the locals.
 */
private void addAccess(WalkContext context,CAstEntity e,Access access){
}

Fixed version (ground truth):
/** 
 * record that in entity e, the access is performed. If   {@link #useLocalValuesForLexicalVars()} is true, the access is performedusing a local variable. in {@link #patchLexicalAccesses(SSAInstruction[],Set)}, this information is used to update an instruction that performs all the accesses at the beginning of the method and defines the locals.
 */
private void addAccess(WalkContext context,CAstEntity e,Access access){
  context.getAccesses(e).add(access);
}
Program: 40232
Project: 40232
Buggy source:
private Set<CGNode> getLexicalDefiners(final CGNode opNode,final Pair<String,String> definer){
  if (definer == null) {
    return Collections.singleton(getBuilder().getCallGraph().getFakeRootNode());
  }
 else {
    final Set<CGNode> result=HashSetFactory.make();
    PointerKey F=getBuilder().getPointerKeyForLocal(opNode,1);
    IR ir=getBuilder().getCFAContextInterpreter().getIR(opNode);
    SymbolTable symtab=ir.getSymbolTable();
    DefUse du=getAnalysisCache().getSSACache().findOrCreateDU(ir,opNode.getContext());
    if (contentsAreInvariant(symtab,du,1)) {
      system.recordImplicitPointsToSet(F);
      final InstanceKey[] functionKeys=getInvariantContents(symtab,du,opNode,1);
      for (int f=0; f < functionKeys.length; f++) {
        system.findOrCreateIndexForInstanceKey(functionKeys[f]);
        ScopeMappingInstanceKey K=(ScopeMappingInstanceKey)functionKeys[f];
        Iterator<CGNode> x=K.getFunargNodes(definer);
        while (x.hasNext()) {
          result.add(x.next());
        }
      }
    }
 else {
      PointsToSetVariable FV=system.findOrCreatePointsToSet(F);
      if (FV.getValue() != null) {
        FV.getValue().foreach(new IntSetAction(){
          public void act(          int ptr){
            InstanceKey iKey=system.getInstanceKey(ptr);
            if (iKey instanceof ScopeMappingInstanceKey) {
              ScopeMappingInstanceKey K=(ScopeMappingInstanceKey)iKey;
              Iterator<CGNode> x=K.getFunargNodes(definer);
              while (x.hasNext()) {
                result.add(x.next());
              }
            }
 else {
              Assertions.UNREACHABLE("String_Node_Str" + iKey);
            }
          }
        }
);
      }
    }
    return result;
  }
}

Fixed version (ground truth):
private Set<CGNode> getLexicalDefiners(final CGNode opNode,final Pair<String,String> definer){
}
Program: 40234
Project: 40234
Buggy source:
private AbstractScope makeScriptScope(final CAstEntity s,Scope parent){
  return new AbstractScope(parent){
    SymbolTable scriptGlobalSymtab=new SymbolTable(s.getArgumentCount());
    public SymbolTable getUnderlyingSymtab(){
      return scriptGlobalSymtab;
    }
    protected AbstractScope getEntityScope(){
      return this;
    }
    public boolean isLexicallyScoped(    Symbol s){
      if (isGlobal(s))       return false;
 else       return ((AbstractScope)s.getDefiningScope()).getEntityScope() != this;
    }
    public CAstEntity getEntity(){
      return s;
    }
    public ScopeType type(){
      return ScopeType.SCRIPT;
    }
    protected Symbol makeSymbol(    final String nm,    final boolean isFinal,    final boolean isInternalName,    final Object defaultInitValue,    int vn,    Scope definer){
      final int v=vn == -1 ? getUnderlyingSymtab().newSymbol() : vn;
      if (useDefaultInitValues() && defaultInitValue != null) {
        if (getUnderlyingSymtab().getValue(v) == null) {
          setDefaultValue(getUnderlyingSymtab(),v,defaultInitValue);
        }
      }
      return new AbstractSymbol(definer,isFinal,defaultInitValue){
        public String toString(){
          return nm + "String_Node_Str" + System.identityHashCode(this);
        }
        public int valueNumber(){
          return v;
        }
        public boolean isInternalName(){
          return isInternalName;
        }
        public boolean isParameter(){
          return false;
        }
      }
;
    }
  }
;
}

Fixed version (ground truth):
private AbstractScope makeScriptScope(final CAstEntity s,Scope parent){
  return new AbstractScope(parent){
    SymbolTable scriptGlobalSymtab=new SymbolTable(s.getArgumentCount());
    public SymbolTable getUnderlyingSymtab(){
      return scriptGlobalSymtab;
    }
    protected AbstractScope getEntityScope(){
      return this;
    }
    public boolean isLexicallyScoped(    Symbol s){
      if (isGlobal(s))       return false;
 else       return ((AbstractScope)s.getDefiningScope()).getEntity() != getEntity();
    }
    public CAstEntity getEntity(){
      return s;
    }
    public ScopeType type(){
      return ScopeType.SCRIPT;
    }
    protected Symbol makeSymbol(    final String nm,    final boolean isFinal,    final boolean isInternalName,    final Object defaultInitValue,    int vn,    Scope definer){
      final int v=vn == -1 ? getUnderlyingSymtab().newSymbol() : vn;
      if (useDefaultInitValues() && defaultInitValue != null) {
        if (getUnderlyingSymtab().getValue(v) == null) {
          setDefaultValue(getUnderlyingSymtab(),v,defaultInitValue);
        }
      }
      return new AbstractSymbol(definer,isFinal,defaultInitValue){
        public String toString(){
          return nm + "String_Node_Str" + System.identityHashCode(this);
        }
        public int valueNumber(){
          return v;
        }
        public boolean isInternalName(){
          return isInternalName;
        }
        public boolean isParameter(){
          return false;
        }
      }
;
    }
  }
;
}
Program: 40235
Project: 40235
Buggy source:
/** 
 * record name as exposed for the current entity and for all enclosing entities up to that of the defining scope, since if the name is updated via a call to a nested function, SSA for these entities may need to be updated with the new definition
 * @param context
 * @param name
 * @param definingScope
 * @param E
 * @param entityName
 * @param isWrite
 */
private void markExposedInEnclosingEntities(WalkContext context,final String name,Scope definingScope,CAstEntity E,final String entityName,boolean isWrite){
  Scope curScope=context.currentScope();
  while (!curScope.equals(definingScope)) {
    final Symbol curSymbol=curScope.lookup(name);
    final int vn=curSymbol.valueNumber();
    final Access A=new Access(name,entityName,vn);
    final CAstEntity entity=curScope.getEntity();
    addExposedName(entity,E,name,vn,isWrite);
    addAccess(entity,A);
    curScope=curScope.getParent();
  }
}

Fixed version (ground truth):
/** 
 * record name as exposed for the current entity and for all enclosing entities up to that of the defining scope, since if the name is updated via a call to a nested function, SSA for these entities may need to be updated with the new definition
 * @param context
 * @param name
 * @param definingScope
 * @param E
 * @param entityName
 * @param isWrite
 */
private void markExposedInEnclosingEntities(WalkContext context,final String name,Scope definingScope,CAstEntity E,final String entityName,boolean isWrite){
  Scope curScope=context.currentScope();
  while (!curScope.equals(definingScope)) {
    final Symbol curSymbol=curScope.lookup(name);
    final int vn=curSymbol.valueNumber();
    final Access A=new Access(name,entityName,vn);
    final CAstEntity entity=curScope.getEntity();
    if (entity != definingScope.getEntity()) {
      addExposedName(entity,E,name,vn,isWrite);
      addAccess(entity,A);
    }
    curScope=curScope.getParent();
  }
}
Program: 40236
Project: 40236
Buggy source:
public Context getCalleeTarget(CGNode caller,CallSiteReference site,IMethod callee,final InstanceKey[] receiver){
  Context baseContext=base.getCalleeTarget(caller,site,callee,receiver);
  String calleeFullName=callee.getDeclaringClass().getName().toString();
  String calleeShortName=calleeFullName.substring(calleeFullName.lastIndexOf('/') + 1);
  if (USE_NAME_TO_SELECT_CONTEXT) {
    if (calleeShortName.contains(HACK_METHOD_STR) && receiver.length > index) {
      return new ForInContext(baseContext,simulateToString(caller.getClassHierarchy(),receiver[index]));
    }
  }
 else   if (receiver.length > index) {
    Frequency f=usesFirstArgAsPropertyName(callee);
    if (f == Frequency.ALWAYS) {
      return new ForInContext(baseContext,simulateToString(caller.getClassHierarchy(),receiver[index]));
    }
 else     if (receiver[index] != null && (f == Frequency.SOMETIMES || forInOnFirstArg(callee))) {
      return new ForInContext(baseContext,receiver[index]);
    }
  }
  if (USE_CPA_IN_BODIES && FORIN_MARKER.equals(caller.getContext().get(FORIN_KEY))) {
    return new SelectiveCPAContext(baseContext,receiver);
  }
 else   if (USE_1LEVEL_IN_BODIES && FORIN_MARKER.equals(caller.getContext().get(FORIN_KEY))) {
    if (!identifyDependentParameters(caller,site).isEmpty()) {
      return oneLevel.getCalleeTarget(caller,site,callee,receiver);
    }
 else {
      return baseContext;
    }
  }
  return baseContext;
}

Fixed version (ground truth):
public Context getCalleeTarget(CGNode caller,CallSiteReference site,IMethod callee,final InstanceKey[] receiver){
  Context baseContext=base.getCalleeTarget(caller,site,callee,receiver);
  String calleeFullName=callee.getDeclaringClass().getName().toString();
  String calleeShortName=calleeFullName.substring(calleeFullName.lastIndexOf('/') + 1);
  if (USE_NAME_TO_SELECT_CONTEXT) {
    if (calleeShortName.contains(HACK_METHOD_STR) && receiver.length > index) {
      return new ForInContext(baseContext,simulateToString(caller.getClassHierarchy(),receiver[index]));
    }
  }
 else   if (receiver.length > index) {
    Frequency f=usesFirstArgAsPropertyName(callee);
    if (f == Frequency.ALWAYS) {
      return new ForInContext(baseContext,simulateToString(caller.getClassHierarchy(),receiver[index]));
    }
 else     if (f == Frequency.SOMETIMES || forInOnFirstArg(callee)) {
      if (receiver[index] == null) {
        IClass undef=caller.getClassHierarchy().lookupClass(JavaScriptTypes.Undefined);
        return new ForInContext(baseContext,new ConcreteTypeKey(undef));
      }
 else {
        return new ForInContext(baseContext,receiver[index]);
      }
    }
  }
  if (USE_CPA_IN_BODIES && FORIN_MARKER.equals(caller.getContext().get(FORIN_KEY))) {
    return new SelectiveCPAContext(baseContext,receiver);
  }
 else   if (USE_1LEVEL_IN_BODIES && FORIN_MARKER.equals(caller.getContext().get(FORIN_KEY))) {
    if (!identifyDependentParameters(caller,site).isEmpty()) {
      return oneLevel.getCalleeTarget(caller,site,callee,receiver);
    }
 else {
      return baseContext;
    }
  }
  return baseContext;
}
Program: 40237
Project: 40237
Buggy source:
public Context getCalleeTarget(CGNode caller,CallSiteReference site,IMethod callee,final InstanceKey[] receiver){
  Context baseContext=base.getCalleeTarget(caller,site,callee,receiver);
  if (useForInContext(callee,receiver)) {
    InstanceKey loopVar=receiver[2];
    IClass stringClass=caller.getClassHierarchy().lookupClass(JavaScriptTypes.String);
    if (loopVar instanceof ConstantKey) {
      Object value=((ConstantKey)loopVar).getValue();
      if (value instanceof String) {
        return new ForInContext(baseContext,loopVar);
      }
 else       if (value instanceof Number) {
        Integer ival=((Number)value).intValue();
        return new ForInContext(baseContext,new ConstantKey<String>(ival.toString(),stringClass));
      }
 else       if (value instanceof Boolean) {
        Boolean bval=(Boolean)value;
        return new ForInContext(baseContext,new ConstantKey<String>(bval.toString(),stringClass));
      }
 else       if (value == null) {
        return new ForInContext(baseContext,new ConstantKey<String>("String_Node_Str",stringClass));
      }
    }
    ConcreteTypeKey stringKey=new ConcreteTypeKey(stringClass);
    return new ForInContext(baseContext,stringKey);
  }
 else   if (USE_CPA_IN_BODIES && FORIN_MARKER.equals(caller.getContext().get(FORIN_KEY))) {
    return new SelectiveCPAContext(baseContext,receiver);
  }
 else   if (USE_1LEVEL_IN_BODIES && FORIN_MARKER.equals(caller.getContext().get(FORIN_KEY))) {
    if (!identifyDependentParameters(caller,site).isEmpty()) {
      return oneLevel.getCalleeTarget(caller,site,callee,receiver);
    }
 else {
      return baseContext;
    }
  }
 else {
    return baseContext;
  }
}

Fixed version (ground truth):
public Context getCalleeTarget(CGNode caller,CallSiteReference site,IMethod callee,final InstanceKey[] receiver){
  Context baseContext=base.getCalleeTarget(caller,site,callee,receiver);
  String calleeFullName=callee.getDeclaringClass().getName().toString();
  String calleeShortName=calleeFullName.substring(calleeFullName.lastIndexOf('/') + 1);
  if (USE_NAME_TO_SELECT_CONTEXT) {
    if (calleeShortName.contains(HACK_METHOD_STR)) {
      return new ForInContext(baseContext,simulateToString(caller.getClassHierarchy(),receiver[2]));
    }
  }
 else   if (receiver.length > 2 && receiver[2] != null) {
    Frequency f=usesFirstArgAsPropertyName(callee);
    if (f == Frequency.ALWAYS) {
      return new ForInContext(baseContext,simulateToString(caller.getClassHierarchy(),receiver[2]));
    }
 else     if (f == Frequency.SOMETIMES || forInOnFirstArg(callee)) {
      return new ForInContext(baseContext,receiver[2]);
    }
  }
  if (USE_CPA_IN_BODIES && FORIN_MARKER.equals(caller.getContext().get(FORIN_KEY))) {
    return new SelectiveCPAContext(baseContext,receiver);
  }
 else   if (USE_1LEVEL_IN_BODIES && FORIN_MARKER.equals(caller.getContext().get(FORIN_KEY))) {
    if (!identifyDependentParameters(caller,site).isEmpty()) {
      return oneLevel.getCalleeTarget(caller,site,callee,receiver);
    }
 else {
      return baseContext;
    }
  }
  return baseContext;
}
Program: 40238
Project: 40238
Buggy source:
private boolean usesFirstArgAsPropertyName(IMethod method){
  if (method.getNumberOfParameters() < 2)   return false;
  Boolean b=usesFirstArgAsPropertyName_cache.get(method);
  if (b != null)   return b;
  DefUse du=getDefUse(method);
  for (  SSAInstruction use : Iterator2Iterable.make(du.getUses(3))) {
    if (use instanceof ReflectiveMemberAccess) {
      ReflectiveMemberAccess rma=(ReflectiveMemberAccess)use;
      if (rma.getMemberRef() == 3) {
        usesFirstArgAsPropertyName_cache.put(method,true);
        return true;
      }
    }
  }
  usesFirstArgAsPropertyName_cache.put(method,false);
  return false;
}

Fixed version (ground truth):
private Frequency usesFirstArgAsPropertyName(IMethod method){
  if (method.getNumberOfParameters() < 2)   return Frequency.NEVER;
  Frequency f=usesFirstArgAsPropertyName_cache.get(method);
  if (f != null)   return f;
  boolean usedAsPropertyName=false, usedAsSomethingElse=false;
  DefUse du=getDefUse(method);
  for (  SSAInstruction use : Iterator2Iterable.make(du.getUses(3))) {
    if (use instanceof ReflectiveMemberAccess) {
      ReflectiveMemberAccess rma=(ReflectiveMemberAccess)use;
      if (rma.getMemberRef() == 3) {
        usedAsPropertyName=true;
        continue;
      }
    }
    usedAsSomethingElse=true;
  }
  if (!usedAsPropertyName)   f=Frequency.NEVER;
 else   if (usedAsSomethingElse)   f=Frequency.SOMETIMES;
 else   f=Frequency.ALWAYS;
  usesFirstArgAsPropertyName_cache.put(method,f);
  return f;
}
Program: 40239
Project: 40239
Buggy source:
/** 
 * get the CGNode representing the lexical parent of   {@link #creator} withname definer
 * @param definer
 * @return
 */
Iterator<CGNode> getFunargNodes(Pair<String,String> name){
  Iterator<CGNode> result=EmptyIterator.instance();
  LexicalScopingResolver r=(LexicalScopingResolver)creator.getContext().get(LexicalScopingResolverContexts.RESOLVER);
  if (r != null) {
    CGNode def=r.getOriginalDefiner(name);
    if (def != null) {
      result=new NonNullSingletonIterator<CGNode>(def);
    }
  }
  PointerKey funcKey=builder.getPointerKeyForLocal(creator,1);
  OrdinalSet<InstanceKey> funcPtrs=builder.getPointerAnalysis().getPointsToSet(funcKey);
  for (  InstanceKey x : funcPtrs) {
    if (x instanceof ScopeMappingInstanceKey) {
      result=new CompoundIterator<CGNode>(result,((ScopeMappingInstanceKey)x).getFunargNodes(name));
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * get the CGNode representing the lexical parent of   {@link #creator} withname definer
 * @param definer
 * @return
 */
Iterator<CGNode> getFunargNodes(Pair<String,String> name){
  Iterator<CGNode> result=EmptyIterator.instance();
  LexicalScopingResolver r=(LexicalScopingResolver)creator.getContext().get(LexicalScopingResolverContexts.RESOLVER);
  if (r != null) {
    CGNode def=r.getOriginalDefiner(name);
    if (def != null) {
      result=new NonNullSingletonIterator<CGNode>(def);
    }
  }
  ContextItem nested=creator.getContext().get(ScopeMappingKeysContextSelector.scopeKey);
  if (nested != null) {
    result=new CompoundIterator<CGNode>(result,((ScopeMappingInstanceKey)nested).getFunargNodes(name));
  }
  PointerKey funcKey=builder.getPointerKeyForLocal(creator,1);
  OrdinalSet<InstanceKey> funcPtrs=builder.getPointerAnalysis().getPointsToSet(funcKey);
  for (  InstanceKey x : funcPtrs) {
    if (x instanceof ScopeMappingInstanceKey) {
      result=new CompoundIterator<CGNode>(result,((ScopeMappingInstanceKey)x).getFunargNodes(name));
    }
  }
  return result;
}
Program: 40240
Project: 40240
Buggy source:
/** 
 * compute the   {@link CGNode} correspond to each specified{@link LexicalParent} of {@link #base}, populating   {@link #scopeMap}
 */
private ScopeMappingInstanceKey(CGNode creator,InstanceKey base){
  this.creator=creator;
  this.base=base;
}

Fixed version (ground truth):
private ScopeMappingInstanceKey(CGNode creator,InstanceKey base){
  this.creator=creator;
  this.base=base;
}
Program: 40241
Project: 40241
Buggy source:
/** 
 * Note that the caller is responsible for ensuring that name is defined in a lexical scope.
 * @param node the AST node representing the read
 * @param context
 * @param name
 * @return
 */
protected int doLexicallyScopedRead(CAstNode node,WalkContext context,final String name){
  if (name.equals("String_Node_Str")) {
    System.err.println("String_Node_Str");
  }
  Symbol S=context.currentScope().lookup(name);
  Scope definingScope=S.getDefiningScope();
  CAstEntity E=definingScope.getEntity();
  addExposedName(E,E,name,definingScope.lookup(name).valueNumber(),false);
  String entityName=getEntityName(E);
  if (useLocalValuesForLexicalVars()) {
    Scope curScope=context.currentScope();
    while (!curScope.equals(definingScope)) {
      Symbol curSymbol=curScope.lookup(name);
      final int vn=curSymbol.valueNumber();
      Access A=new Access(name,entityName,vn);
      CAstEntity entity=curScope.getEntity();
      addExposedName(entity,E,name,vn,false);
      addAccess(entity,A);
      curScope=curScope.getParent();
    }
    return S.valueNumber();
  }
 else {
    int result=context.currentScope().allocateTempValue();
    Access A=new Access(name,entityName,result);
    context.cfg().addInstruction(new AstLexicalRead(A));
    return result;
  }
}

Fixed version (ground truth):
/** 
 * Note that the caller is responsible for ensuring that name is defined in a lexical scope.
 * @param node the AST node representing the read
 * @param context
 * @param name
 * @return
 */
protected int doLexicallyScopedRead(CAstNode node,WalkContext context,final String name){
  Symbol S=context.currentScope().lookup(name);
  Scope definingScope=S.getDefiningScope();
  CAstEntity E=definingScope.getEntity();
  addExposedName(E,E,name,definingScope.lookup(name).valueNumber(),false);
  final String entityName=getEntityName(E);
  if (useLocalValuesForLexicalVars()) {
    markExposedInEnclosingEntities(context,name,definingScope,E,entityName,false);
    return S.valueNumber();
  }
 else {
    int result=context.currentScope().allocateTempValue();
    Access A=new Access(name,entityName,result);
    context.cfg().addInstruction(new AstLexicalRead(A));
    return result;
  }
}
Program: 40242
Project: 40242
Buggy source:
/** 
 * Note that the caller is responsible for ensuring that name is defined in a lexical scope.
 */
protected void doLexicallyScopedWrite(WalkContext context,String name,int rval){
  Symbol S=context.currentScope().lookup(name);
  CAstEntity E=S.getDefiningScope().getEntity();
  addExposedName(E,E,name,S.getDefiningScope().lookup(name).valueNumber(),true);
  if (useLocalValuesForLexicalVars()) {
    int vn=S.valueNumber();
    Access A=new Access(name,getEntityName(E),vn);
    addExposedName(context.top(),E,name,vn,true);
    addAccess(context.top(),A);
    context.cfg().addInstruction(new AssignInstruction(vn,rval));
    context.cfg().addInstruction(new AstLexicalWrite(A));
  }
 else {
    Access A=new Access(name,getEntityName(E),rval);
    context.cfg().addInstruction(new AstLexicalWrite(A));
  }
}

Fixed version (ground truth):
/** 
 * Note that the caller is responsible for ensuring that name is defined in a lexical scope.
 */
protected void doLexicallyScopedWrite(WalkContext context,String name,int rval){
  Symbol S=context.currentScope().lookup(name);
  Scope definingScope=S.getDefiningScope();
  CAstEntity E=definingScope.getEntity();
  addExposedName(E,E,name,definingScope.lookup(name).valueNumber(),true);
  if (useLocalValuesForLexicalVars()) {
    markExposedInEnclosingEntities(context,name,definingScope,E,getEntityName(E),true);
    int vn=S.valueNumber();
    Access A=new Access(name,getEntityName(E),vn);
    context.cfg().addInstruction(new AssignInstruction(vn,rval));
    context.cfg().addInstruction(new AstLexicalWrite(A));
  }
 else {
    Access A=new Access(name,getEntityName(E),rval);
    context.cfg().addInstruction(new AstLexicalWrite(A));
  }
}
Program: 40244
Project: 40244
Buggy source:
/** 
 * Note that the caller is responsible for ensuring that name is defined in a lexical scope.
 * @param node the AST node representing the read
 * @param context
 * @param name
 * @return
 */
protected int doLexicallyScopedRead(CAstNode node,WalkContext context,String name){
  Symbol S=context.currentScope().lookup(name);
  CAstEntity E=S.getDefiningScope().getEntity();
  addExposedName(E,E,name,S.getDefiningScope().lookup(name).valueNumber(),false);
  int vn=S.valueNumber();
  if (useLocalValuesForLexicalVars()) {
    Access A=new Access(name,getEntityName(E),vn);
    addExposedName(context.top(),E,name,vn,false);
    addAccess(context.top(),A);
    return vn;
  }
 else {
    int result=context.currentScope().allocateTempValue();
    Access A=new Access(name,getEntityName(E),result);
    context.cfg().addInstruction(new AstLexicalRead(A));
    return result;
  }
}

Fixed version (ground truth):
/** 
 * Note that the caller is responsible for ensuring that name is defined in a lexical scope.
 * @param node the AST node representing the read
 * @param context
 * @param name
 * @return
 */
protected int doLexicallyScopedRead(CAstNode node,WalkContext context,final String name){
  if (name.equals("String_Node_Str")) {
    System.err.println("String_Node_Str");
  }
  Symbol S=context.currentScope().lookup(name);
  Scope definingScope=S.getDefiningScope();
  CAstEntity E=definingScope.getEntity();
  addExposedName(E,E,name,definingScope.lookup(name).valueNumber(),false);
  String entityName=getEntityName(E);
  if (useLocalValuesForLexicalVars()) {
    Scope curScope=context.currentScope();
    while (!curScope.equals(definingScope)) {
      Symbol curSymbol=curScope.lookup(name);
      final int vn=curSymbol.valueNumber();
      Access A=new Access(name,entityName,vn);
      CAstEntity entity=curScope.getEntity();
      addExposedName(entity,E,name,vn,false);
      addAccess(entity,A);
      curScope=curScope.getParent();
    }
    return S.valueNumber();
  }
 else {
    int result=context.currentScope().allocateTempValue();
    Access A=new Access(name,entityName,result);
    context.cfg().addInstruction(new AstLexicalRead(A));
    return result;
  }
}
Program: 40245
Project: 40245
Buggy source:
public void setLexicallyMutatedIR(IR ir){
  lexicalScopingChanges=true;
  cachedIR=ir;
  cachedDU=new DefUse(ir);
}

Fixed version (ground truth):
public void setLexicallyMutatedIR(IR ir){
  lexicalScopingChanges=true;
  cachedIR=ir;
  cachedDU=null;
}
Program: 40246
Project: 40246
Buggy source:
public DefUse getLexicallyMutatedDU(){
  if (lexicalScopingChanges) {
    return cachedDU;
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public DefUse getLexicallyMutatedDU(){
  if (lexicalScopingChanges) {
    if (cachedDU == null) {
      cachedDU=new DefUse(cachedIR);
    }
    return cachedDU;
  }
 else {
    return null;
  }
}
Program: 40247
Project: 40247
Buggy source:
/** 
 * @return the indices i s.t. x[i] == y, or null if none found.
 */
private int[] extractIndices(int[] x,int y){
  int count=0;
  for (int i=0; i < x.length; i++) {
    if (x[i] == y) {
      count++;
    }
  }
  if (count == 0) {
    return null;
  }
 else {
    int[] result=new int[count];
    int j=0;
    for (int i=0; i < x.length; i++) {
      if (x[i] == y) {
        result[j++]=i;
      }
    }
    return result;
  }
}

Fixed version (ground truth):
/** 
 * @return the indices i s.t. x[i] == y, or null if none found.
 */
private int[] extractIndices(int[] x,int y){
}
Program: 40248
Project: 40248
Buggy source:
/** 
 * @param pc a program counter (index into ShrikeBT instruction array)
 * @param vn a value number
 * @return if we know that immediately after the given program counter, v_vn corresponds to some set of locals, then return anarray of the local numbers. else return null.
 */
private int[] findLocalsForValueNumber(int pc,int vn){
  IBasicBlock bb=shrikeCFG.getBlockForInstruction(pc);
  int firstInstruction=bb.getFirstInstructionIndex();
  int[] locals=block2LocalState[bb.getNumber()];
  for (int i=firstInstruction; i <= pc; i++) {
    if (localStoreMap[i] != null) {
      IntPair p=localStoreMap[i];
      setLocal(locals,p.getY(),p.getX());
    }
  }
  return extractIndices(locals,vn);
}

Fixed version (ground truth):
/** 
 * @param pc a program counter (index into ShrikeBT instruction array)
 * @param vn a value number
 * @return if we know that immediately after the given program counter, v_vn corresponds to some set of locals, then return anarray of the local numbers. else return null.
 */
private int[] findLocalsForValueNumber(int pc,int vn){
  if (vn < 0) {
    return null;
  }
  IBasicBlock bb=shrikeCFG.getBlockForInstruction(pc);
  int firstInstruction=bb.getFirstInstructionIndex();
  int[] locals=block2LocalState[bb.getNumber()];
  for (int i=firstInstruction; i <= pc; i++) {
    if (localStoreMap[i] != null) {
      IntPair p=localStoreMap[i];
      locals=setLocal(locals,p.getY(),p.getX());
    }
  }
  return locals == null ? null : extractIndices(locals,vn);
}
Program: 40250
Project: 40250
Buggy source:
public boolean inRead(){
  return false;
}

Fixed version (ground truth):
public boolean inRead(){
  return true;
}
Program: 40251
Project: 40251
Buggy source:
public void setAssign(CAstNode receiverTemp,CAstNode elementTemp){
  Assertions.UNREACHABLE();
}

Fixed version (ground truth):
/** 
 * store the CAstNodes used to represent the loop variable for the prototype-chain traversal (receiverTemp) and the desired property (elementTemp)
 */
public void setAssign(CAstNode receiverTemp,CAstNode elementTemp){
  this.receiverTemp=receiverTemp;
  this.elementTemp=elementTemp;
}
Program: 40252
Project: 40252
Buggy source:
private static String composeString(Collection<String> s){
  StringBuffer result=new StringBuffer();
  Iterator<String> it=s.iterator();
  for (int i=0; i < s.size() - 1; i++) {
    result.append(it.next());
    result.append(';');
  }
  if (it.hasNext()) {
    result.append(it.next());
  }
  return result.toString();
}

Fixed version (ground truth):
private static String composeString(Collection<String> s){
  StringBuffer result=new StringBuffer();
  Iterator<String> it=s.iterator();
  for (int i=0; i < s.size() - 1; i++) {
    result.append(it.next());
    result.append(File.pathSeparator);
  }
  if (it.hasNext()) {
    result.append(it.next());
  }
  return result.toString();
}
Program: 40253
Project: 40253
Buggy source:
public nCFABuilder(int n,IClassHierarchy cha,AnalysisOptions options,AnalysisCache cache,ContextSelector appContextSelector,SSAContextInterpreter appContextInterpreter){
  super(cha,options,cache,new DefaultPointerKeyFactory());
  if (options == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  setInstanceKeys(new ClassBasedInstanceKeys(options,cha));
  ContextSelector def=new DefaultContextSelector(options,cha);
  ContextSelector contextSelector=new DelegatingContextSelector(appContextSelector,def);
  contextSelector=new nCFAContextSelector(n,contextSelector);
  setContextSelector(contextSelector);
  SSAContextInterpreter defI=new DefaultSSAInterpreter(options,cache);
  defI=new DelegatingSSAContextInterpreter(ReflectionContextInterpreter.createReflectionContextInterpreter(cha,options,getAnalysisCache()),defI);
  SSAContextInterpreter contextInterpreter=new DelegatingSSAContextInterpreter(appContextInterpreter,defI);
  setContextInterpreter(contextInterpreter);
}

Fixed version (ground truth):
public nCFABuilder(int n,IClassHierarchy cha,AnalysisOptions options,AnalysisCache cache,ContextSelector appContextSelector,SSAContextInterpreter appContextInterpreter){
  super(cha,options,cache,new DefaultPointerKeyFactory());
  if (options == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  setInstanceKeys(new ClassBasedInstanceKeys(options,cha));
  ContextSelector def=new DefaultContextSelector(options,cha);
  ContextSelector contextSelector=appContextSelector == null ? def : new DelegatingContextSelector(appContextSelector,def);
  contextSelector=new nCFAContextSelector(n,contextSelector);
  setContextSelector(contextSelector);
  SSAContextInterpreter defI=new DefaultSSAInterpreter(options,cache);
  defI=new DelegatingSSAContextInterpreter(ReflectionContextInterpreter.createReflectionContextInterpreter(cha,options,getAnalysisCache()),defI);
  SSAContextInterpreter contextInterpreter=appContextInterpreter == null ? defI : new DelegatingSSAContextInterpreter(appContextInterpreter,defI);
  setContextInterpreter(contextInterpreter);
}
Program: 40254
Project: 40254
Buggy source:
public void copyState(IVariable v){
  MachineState other=(MachineState)v;
  if (other.stack == null) {
    stack=null;
  }
 else {
    stack=new int[other.stack.length];
    System.arraycopy(other.stack,0,stack,0,other.stack.length);
  }
  if (other.locals == null) {
    locals=null;
  }
 else {
    locals=new int[other.locals.length];
    System.arraycopy(other.locals,0,locals,0,other.locals.length);
  }
  stackHeight=other.stackHeight;
}

Fixed version (ground truth):
public void copyState(MachineState other){
  if (other.stack == null) {
    stack=null;
  }
 else {
    stack=new int[other.stack.length];
    System.arraycopy(other.stack,0,stack,0,other.stack.length);
  }
  if (other.locals == null) {
    locals=null;
  }
 else {
    locals=new int[other.locals.length];
    System.arraycopy(other.locals,0,locals,0,other.locals.length);
  }
  stackHeight=other.stackHeight;
}
Program: 40255
Project: 40255
Buggy source:
/** 
 * @return the state at the entry to a given block
 */
public MachineState getIn(ShrikeCFG.BasicBlock bb){
  return (MachineState)solver.getIn(bb);
}

Fixed version (ground truth):
/** 
 * @return the state at the entry to a given block
 */
public MachineState getIn(ShrikeCFG.BasicBlock bb){
  return solver.getIn(bb);
}
Program: 40256
Project: 40256
Buggy source:
public MachineState getEntryState(){
  return (MachineState)solver.getIn(cfg.entry());
}

Fixed version (ground truth):
public MachineState getEntryState(){
  return solver.getIn(cfg.entry());
}
Program: 40260
Project: 40260
Buggy source:
private static void getMethodInClassOrSuperclass(IMethodBinding met,ITypeBinding klass,boolean superclassonly,HashMap<ITypeBinding,IMethodBinding> overridden){
  if (!superclassonly) {
    for (    IMethodBinding ourmet : klass.getDeclaredMethods())     if (met.isSubsignature(ourmet) && (met.getModifiers() & Modifier.PRIVATE) == 0) {
      overridden.put(ourmet.getMethodDeclaration().getReturnType(),ourmet.getMethodDeclaration());
      break;
    }
  }
  for (  ITypeBinding iface : klass.getInterfaces())   getMethodInClassOrSuperclass(met,iface,false,overridden);
  ITypeBinding superclass=klass.getSuperclass();
  if (superclass != null)   getMethodInClassOrSuperclass(met,superclass,false,overridden);
}

Fixed version (ground truth):
private static void getMethodInClassOrSuperclass(IMethodBinding met,ITypeBinding klass,boolean superclassonly,HashMap<ITypeBinding,IMethodBinding> overridden){
  if (!superclassonly) {
    for (    IMethodBinding ourmet : klass.getDeclaredMethods())     if (met.overrides(ourmet)) {
      overridden.put(ourmet.getMethodDeclaration().getReturnType(),ourmet.getMethodDeclaration());
      break;
    }
  }
  for (  ITypeBinding iface : klass.getInterfaces())   getMethodInClassOrSuperclass(met,iface,false,overridden);
  ITypeBinding superclass=klass.getSuperclass();
  if (superclass != null)   getMethodInClassOrSuperclass(met,superclass,false,overridden);
}