nus-yam/ex-repair huggingface dataset:
Program: 9735
Project: 9735
Buggy source:
public void endVisit(MessageSend call,BlockScope scope){
  if (call.codegenBinding == null)   return;
  MethodBinding superBinding=call.codegenBinding;
  char[] accessName;
  boolean isSuper;
  if (call.isSuperAccess() && !call.binding.isStatic()) {
    call.receiver=new ThisReference();
    accessName=NameMangler.superDispatchMethod(EclipseWorld.fromBinding(targetClass),new String(superBinding.selector)).toCharArray();
  }
 else   if (call.receiver.isThis() && call.binding.isProtected() && !call.binding.isStatic()) {
    if (superBinding.declaringClass.equals(targetClass)) {
      accessName=NameMangler.protectedDispatchMethod(EclipseWorld.fromBinding(targetClass),new String(superBinding.selector)).toCharArray();
    }
 else {
      accessName=NameMangler.superDispatchMethod(EclipseWorld.fromBinding(targetClass),new String(superBinding.selector)).toCharArray();
    }
  }
 else {
    return;
  }
  MethodBinding superAccessBinding=new MethodBinding(AstNode.AccPublic,accessName,superBinding.returnType,superBinding.parameters,superBinding.thrownExceptions,targetClass);
  call.codegenBinding=superAccessBinding;
  ResolvedMember targetMember=EclipseWorld.makeResolvedMember(superBinding);
  superMethodsCalled.add(targetMember);
}

Fixed version (ground truth):
public void endVisit(MessageSend call,BlockScope scope){
  if (call.codegenBinding == null)   return;
  MethodBinding superBinding=call.codegenBinding;
  if (superBinding instanceof ProblemMethodBinding) {
    return;
  }
  char[] accessName;
  boolean isSuper;
  if (call.isSuperAccess() && !call.binding.isStatic()) {
    call.receiver=new ThisReference();
    accessName=NameMangler.superDispatchMethod(EclipseWorld.fromBinding(targetClass),new String(superBinding.selector)).toCharArray();
  }
 else   if (call.receiver.isThis() && call.binding.isProtected() && !call.binding.isStatic()) {
    if (superBinding.declaringClass.equals(targetClass)) {
      accessName=NameMangler.protectedDispatchMethod(EclipseWorld.fromBinding(targetClass),new String(superBinding.selector)).toCharArray();
    }
 else {
      accessName=NameMangler.superDispatchMethod(EclipseWorld.fromBinding(targetClass),new String(superBinding.selector)).toCharArray();
    }
  }
 else {
    return;
  }
  MethodBinding superAccessBinding=new MethodBinding(AstNode.AccPublic,accessName,superBinding.returnType,superBinding.parameters,superBinding.thrownExceptions,targetClass);
  call.codegenBinding=superAccessBinding;
  ResolvedMember targetMember=EclipseWorld.makeResolvedMember(superBinding);
  superMethodsCalled.add(targetMember);
}
Program: 9736
Project: 9736
Buggy source:
public PrivilegedFieldBinding(AspectDeclaration inAspect,FieldBinding baseField){
  super(baseField,baseField.declaringClass);
  this.reader=new SimpleSyntheticAccessMethodBinding(inAspect.world.makeMethodBinding(AjcMemberMaker.privilegedAccessMethodForFieldGet(inAspect.typeX,inAspect.world.makeResolvedMember(baseField))));
  this.writer=new SimpleSyntheticAccessMethodBinding(inAspect.world.makeMethodBinding(AjcMemberMaker.privilegedAccessMethodForFieldSet(inAspect.typeX,inAspect.world.makeResolvedMember(baseField))));
}

Fixed version (ground truth):
public PrivilegedFieldBinding(AspectDeclaration inAspect,FieldBinding baseField){
  super(baseField,baseField.declaringClass);
  this.reader=new SimpleSyntheticAccessMethodBinding(inAspect.world.makeMethodBinding(AjcMemberMaker.privilegedAccessMethodForFieldGet(inAspect.typeX,inAspect.world.makeResolvedMember(baseField))));
  this.writer=new SimpleSyntheticAccessMethodBinding(inAspect.world.makeMethodBinding(AjcMemberMaker.privilegedAccessMethodForFieldSet(inAspect.typeX,inAspect.world.makeResolvedMember(baseField))));
  this.constant=AstNode.NotAConstant;
  this.baseField=baseField;
}
Program: 9737
Project: 9737
Buggy source:
public MethodBinding getPrivilegedAccessMethod(MethodBinding baseMethod){
  ResolvedMember key=inAspect.world.makeResolvedMember(baseMethod);
  if (accessors.containsKey(key))   return (MethodBinding)accessors.get(key);
  MethodBinding ret=inAspect.world.makeMethodBinding(AjcMemberMaker.privilegedAccessMethodForMethod(inAspect.typeX,key));
  accessors.put(key,ret);
  return ret;
}

Fixed version (ground truth):
public MethodBinding getPrivilegedAccessMethod(MethodBinding baseMethod){
  ResolvedMember key=inAspect.world.makeResolvedMember(baseMethod);
  if (accessors.containsKey(key))   return (MethodBinding)accessors.get(key);
  MethodBinding ret;
  if (baseMethod.isConstructor()) {
    ret=baseMethod;
  }
 else {
    ret=inAspect.world.makeMethodBinding(AjcMemberMaker.privilegedAccessMethodForMethod(inAspect.typeX,key));
  }
  accessors.put(key,ret);
  return ret;
}
Program: 9738
Project: 9738
Buggy source:
public void addDeclare(Declare declare){
  if (declare instanceof DeclareErrorOrWarning) {
    ShadowMunger m=new Checker((DeclareErrorOrWarning)declare);
    addShadowMunger(m);
  }
 else   if (declare instanceof DeclareDominates) {
    declareDominates.add(declare);
  }
 else   if (declare instanceof DeclareParents) {
    declareParents.add(declare);
  }
 else   if (declare instanceof DeclareSoft) {
    DeclareSoft d=(DeclareSoft)declare;
    Pointcut concretePointcut=d.getPointcut().concretize(inAspect,0);
    declareSofts.add(new DeclareSoft(d.getException(),concretePointcut));
    ShadowMunger m=Advice.makeSoftener(world,concretePointcut,d.getException());
    addConcreteShadowMunger(m);
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
public void addDeclare(Declare declare){
  if (declare instanceof DeclareErrorOrWarning) {
    ShadowMunger m=new Checker((DeclareErrorOrWarning)declare);
    addShadowMunger(m);
  }
 else   if (declare instanceof DeclareDominates) {
    declareDominates.add(declare);
  }
 else   if (declare instanceof DeclareParents) {
    DeclareParents dp=(DeclareParents)declare;
    for (Iterator i=dp.getParents().collectAccessTypeMungers(world).iterator(); i.hasNext(); ) {
      addTypeMunger(world.concreteTypeMunger((PrivilegedAccessMunger)i.next(),inAspect));
    }
    declareParents.add(dp);
  }
 else   if (declare instanceof DeclareSoft) {
    DeclareSoft d=(DeclareSoft)declare;
    Pointcut concretePointcut=d.getPointcut().concretize(inAspect,0);
    declareSofts.add(new DeclareSoft(d.getException(),concretePointcut));
    ShadowMunger m=Advice.makeSoftener(world,concretePointcut,d.getException());
    addConcreteShadowMunger(m);
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
}
Program: 9739
Project: 9739
Buggy source:
private boolean mungePrivilegedAccess(BcelClassWeaver weaver,PrivilegedAccessMunger munger){
  LazyClassGen gen=weaver.getLazyClassGen();
  ResolvedMember member=munger.getMember();
  ResolvedTypeX onType=weaver.getWorld().resolve(member.getDeclaringType());
  if (onType.equals(gen.getType())) {
    if (member.getKind() == Member.FIELD) {
      addFieldGetter(gen,member,AjcMemberMaker.privilegedAccessMethodForFieldGet(aspectType,member));
      addFieldSetter(gen,member,AjcMemberMaker.privilegedAccessMethodForFieldSet(aspectType,member));
      return true;
    }
 else     if (member.getKind() == Member.METHOD) {
      addMethodDispatch(gen,member,AjcMemberMaker.privilegedAccessMethodForMethod(aspectType,member));
      return true;
    }
 else     if (member.getKind() == Member.STATIC_INITIALIZATION) {
      gen.forcePublic();
      return true;
    }
 else {
      throw new RuntimeException("String_Node_Str");
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean mungePrivilegedAccess(BcelClassWeaver weaver,PrivilegedAccessMunger munger){
  LazyClassGen gen=weaver.getLazyClassGen();
  ResolvedMember member=munger.getMember();
  ResolvedTypeX onType=weaver.getWorld().resolve(member.getDeclaringType());
  if (onType.equals(gen.getType())) {
    if (member.getKind() == Member.FIELD) {
      addFieldGetter(gen,member,AjcMemberMaker.privilegedAccessMethodForFieldGet(aspectType,member));
      addFieldSetter(gen,member,AjcMemberMaker.privilegedAccessMethodForFieldSet(aspectType,member));
      return true;
    }
 else     if (member.getKind() == Member.METHOD) {
      addMethodDispatch(gen,member,AjcMemberMaker.privilegedAccessMethodForMethod(aspectType,member));
      return true;
    }
 else     if (member.getKind() == Member.CONSTRUCTOR) {
      for (Iterator i=gen.getMethodGens().iterator(); i.hasNext(); ) {
        LazyMethodGen m=(LazyMethodGen)i.next();
        if (m.getMemberView() != null && m.getMemberView().getKind() == Member.CONSTRUCTOR) {
          m.forcePublic();
        }
      }
      return true;
    }
 else     if (member.getKind() == Member.STATIC_INITIALIZATION) {
      gen.forcePublic();
      return true;
    }
 else {
      throw new RuntimeException("String_Node_Str");
    }
  }
  return false;
}
Program: 9740
Project: 9740
Buggy source:
public Pointcut concretize1(ResolvedTypeX inAspect,IntMap bindings){
  IfPointcut ret=new IfPointcut(testMethod,extraParameterFlags);
  if (this.state == CONCRETE)   return ret;
  this.state=CONCRETE;
  if (bindings.directlyInAdvice()) {
    Advice advice=bindings.getEnclosingAdvice();
    ret.baseArgsCount=advice.getBaseParameterCount();
    ret.residueSource=advice.getPointcut().concretize(inAspect,ret.baseArgsCount,advice);
  }
 else {
    ResolvedPointcutDefinition def=bindings.peekEnclosingDefinitition();
    if (def == CflowPointcut.CFLOW_MARKER) {
      inAspect.getWorld().getMessageHandler().handleMessage(MessageUtil.error("String_Node_Str",null));
      return Pointcut.makeMatchesNothing(Pointcut.CONCRETE);
    }
    ret.baseArgsCount=def.getParameterTypes().length;
    IntMap newBindings=IntMap.idMap(ret.baseArgsCount);
    newBindings.copyContext(bindings);
    ret.residueSource=def.getPointcut().concretize(inAspect,newBindings);
  }
  return ret;
}

Fixed version (ground truth):
public Pointcut concretize1(ResolvedTypeX inAspect,IntMap bindings){
  if (partiallyConcretized != null) {
    return partiallyConcretized;
  }
  IfPointcut ret=new IfPointcut(testMethod,extraParameterFlags);
  partiallyConcretized=ret;
  if (bindings.directlyInAdvice()) {
    Advice advice=bindings.getEnclosingAdvice();
    ret.baseArgsCount=advice.getBaseParameterCount();
    ret.residueSource=advice.getPointcut().concretize(inAspect,ret.baseArgsCount,advice);
  }
 else {
    ResolvedPointcutDefinition def=bindings.peekEnclosingDefinitition();
    if (def == CflowPointcut.CFLOW_MARKER) {
      inAspect.getWorld().getMessageHandler().handleMessage(MessageUtil.error("String_Node_Str",null));
      return Pointcut.makeMatchesNothing(Pointcut.CONCRETE);
    }
    ret.baseArgsCount=def.getParameterTypes().length;
    IntMap newBindings=IntMap.idMap(ret.baseArgsCount);
    newBindings.copyContext(bindings);
    ret.residueSource=def.getPointcut().concretize(inAspect,newBindings);
  }
  return ret;
}
Program: 9741
Project: 9741
Buggy source:
public Test findResidue(Shadow shadow,ExposedState state){
  if (residueSource == null)   return Literal.TRUE;
  ExposedState myState=new ExposedState(baseArgsCount);
  residueSource.findResidue(shadow,myState);
  List args=new ArrayList();
  for (int i=0; i < baseArgsCount; i++) {
    args.add(myState.get(i));
  }
  if ((extraParameterFlags & Advice.ThisJoinPoint) != 0) {
    args.add(shadow.getThisJoinPointVar());
  }
  if ((extraParameterFlags & Advice.ThisJoinPointStaticPart) != 0) {
    args.add(shadow.getThisJoinPointStaticPartVar());
  }
  if ((extraParameterFlags & Advice.ThisEnclosingJoinPointStaticPart) != 0) {
    args.add(shadow.getThisEnclosingJoinPointStaticPartVar());
  }
  return Test.makeCall(testMethod,(Expr[])args.toArray(new Expr[args.size()]));
}

Fixed version (ground truth):
public Test findResidue(Shadow shadow,ExposedState state){
  if (findingResidue)   return Literal.TRUE;
  findingResidue=true;
  try {
    ExposedState myState=new ExposedState(baseArgsCount);
    residueSource.findResidue(shadow,myState);
    List args=new ArrayList();
    for (int i=0; i < baseArgsCount; i++) {
      args.add(myState.get(i));
    }
    if ((extraParameterFlags & Advice.ThisJoinPoint) != 0) {
      args.add(shadow.getThisJoinPointVar());
    }
    if ((extraParameterFlags & Advice.ThisJoinPointStaticPart) != 0) {
      args.add(shadow.getThisJoinPointStaticPartVar());
    }
    if ((extraParameterFlags & Advice.ThisEnclosingJoinPointStaticPart) != 0) {
      args.add(shadow.getThisEnclosingJoinPointStaticPartVar());
    }
    return Test.makeCall(testMethod,(Expr[])args.toArray(new Expr[args.size()]));
  }
  finally {
    findingResidue=false;
  }
}
Program: 9743
Project: 9743
Buggy source:
private void deleteNewAndDup(){
  final ConstantPoolGen cpg=getEnclosingClass().getConstantPoolGen();
  int depth=1;
  InstructionHandle ih=range.getStart();
  while (true) {
    Instruction inst=ih.getInstruction();
    if (inst instanceof INVOKESPECIAL && ((INVOKESPECIAL)inst).getName(cpg).equals("String_Node_Str")) {
      depth++;
    }
 else     if (inst instanceof NEW) {
      depth--;
      if (depth == 0)       break;
    }
    ih=ih.getPrev();
  }
  InstructionHandle newHandle=ih;
  InstructionHandle endHandle=newHandle.getNext();
  InstructionHandle nextHandle;
  if (endHandle.getInstruction() instanceof DUP) {
    nextHandle=endHandle.getNext();
    retargetFrom(newHandle,nextHandle);
    retargetFrom(endHandle,nextHandle);
  }
 else   if (endHandle.getInstruction() instanceof DUP_X1) {
    InstructionHandle dupHandle=endHandle;
    endHandle=endHandle.getNext();
    nextHandle=endHandle.getNext();
    if (endHandle.getInstruction() instanceof SWAP) {
    }
 else {
      throw new RuntimeException("String_Node_Str" + endHandle);
    }
    retargetFrom(newHandle,nextHandle);
    retargetFrom(dupHandle,nextHandle);
    retargetFrom(endHandle,nextHandle);
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
  try {
    range.getBody().delete(newHandle,endHandle);
  }
 catch (  TargetLostException e) {
    throw new BCException("String_Node_Str");
  }
}

Fixed version (ground truth):
private void deleteNewAndDup(){
  final ConstantPoolGen cpg=getEnclosingClass().getConstantPoolGen();
  int depth=1;
  InstructionHandle ih=range.getStart();
  while (true) {
    Instruction inst=ih.getInstruction();
    if (inst instanceof INVOKESPECIAL && ((INVOKESPECIAL)inst).getName(cpg).equals("String_Node_Str")) {
      depth++;
    }
 else     if (inst instanceof NEW) {
      depth--;
      if (depth == 0)       break;
    }
    ih=ih.getPrev();
  }
  InstructionHandle newHandle=ih;
  InstructionHandle endHandle=newHandle.getNext();
  InstructionHandle nextHandle;
  if (endHandle.getInstruction() instanceof DUP) {
    nextHandle=endHandle.getNext();
    retargetFrom(newHandle,nextHandle);
    retargetFrom(endHandle,nextHandle);
  }
 else   if (endHandle.getInstruction() instanceof DUP_X1) {
    InstructionHandle dupHandle=endHandle;
    endHandle=endHandle.getNext();
    nextHandle=endHandle.getNext();
    if (endHandle.getInstruction() instanceof SWAP) {
    }
 else {
      throw new RuntimeException("String_Node_Str" + endHandle);
    }
    retargetFrom(newHandle,nextHandle);
    retargetFrom(dupHandle,nextHandle);
    retargetFrom(endHandle,nextHandle);
  }
 else {
    endHandle=newHandle;
    nextHandle=endHandle.getNext();
    retargetFrom(newHandle,nextHandle);
    getRange().insert(getFactory().POP,Range.OutsideAfter);
  }
  try {
    range.getBody().delete(newHandle,endHandle);
  }
 catch (  TargetLostException e) {
    throw new BCException("String_Node_Str");
  }
}
Program: 9744
Project: 9744
Buggy source:
public void resolve(){
  if (binding == null || ignoreFurtherInvestigation) {
    ignoreFurtherInvestigation=true;
    return;
  }
  if (typeX != null)   typeX.checkPointcutDeclarations();
  super.resolve();
}

Fixed version (ground truth):
public void resolve(){
  if (binding == null) {
    ignoreFurtherInvestigation=true;
    return;
  }
  if (typeX != null)   typeX.checkPointcutDeclarations();
  super.resolve();
}
Program: 9745
Project: 9745
Buggy source:
public static void testOne() throws IOException {
  List args=new ArrayList();
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  CommandTestCase.runCompiler(args,CommandTestCase.NO_ERRORS);
  CommandTestCase.printGenerated("String_Node_Str","String_Node_Str");
  CommandTestCase.printGenerated("String_Node_Str","String_Node_Str");
  TestUtil.runMain("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public static void testOne() throws IOException {
  List args=new ArrayList();
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  CommandTestCase.runCompiler(args,CommandTestCase.NO_ERRORS);
}
Program: 9746
Project: 9746
Buggy source:
protected int getModifiers(Member member){
  return resolve(member).getModifiers();
}

Fixed version (ground truth):
protected int getModifiers(Member member){
  ResolvedMember r=resolve(member);
  if (r == null)   throw new BCException("String_Node_Str" + member);
  return r.getModifiers();
}
Program: 9747
Project: 9747
Buggy source:
public boolean munge(BcelClassWeaver weaver){
  LazyClassGen gen=weaver.getLazyClassGen();
  if (!gen.getType().equals(cflowStackField.getDeclaringType()))   return false;
  Field f=new FieldGen(cflowStackField.getModifiers(),BcelWorld.makeBcelType(cflowStackField.getReturnType()),cflowStackField.getName(),gen.getConstantPoolGen()).getField();
  gen.addField(f);
  LazyMethodGen clinit=gen.getStaticInitializer();
  InstructionList setup=new InstructionList();
  InstructionFactory fact=gen.getFactory();
  setup.append(fact.createNew(new ObjectType(NameMangler.CFLOW_STACK_TYPE)));
  setup.append(fact.createDup(1));
  setup.append(fact.createInvoke(NameMangler.CFLOW_STACK_TYPE,"String_Node_Str",Type.VOID,new Type[0],Constants.INVOKESPECIAL));
  setup.append(Utility.createSet(fact,cflowStackField));
  clinit.getBody().insert(setup);
  return true;
}

Fixed version (ground truth):
public boolean munge(BcelClassWeaver weaver){
  LazyClassGen gen=weaver.getLazyClassGen();
  if (!gen.getType().equals(cflowStackField.getDeclaringType()))   return false;
  Field f=new FieldGen(cflowStackField.getModifiers(),BcelWorld.makeBcelType(cflowStackField.getReturnType()),cflowStackField.getName(),gen.getConstantPoolGen()).getField();
  gen.addField(f);
  LazyMethodGen clinit=gen.getAjcClinit();
  InstructionList setup=new InstructionList();
  InstructionFactory fact=gen.getFactory();
  setup.append(fact.createNew(new ObjectType(NameMangler.CFLOW_STACK_TYPE)));
  setup.append(fact.createDup(1));
  setup.append(fact.createInvoke(NameMangler.CFLOW_STACK_TYPE,"String_Node_Str",Type.VOID,new Type[0],Constants.INVOKESPECIAL));
  setup.append(Utility.createSet(fact,cflowStackField));
  clinit.getBody().insert(setup);
  return true;
}
Program: 9748
Project: 9748
Buggy source:
private void initializeThisVar(){
  if (thisVar != null)   return;
  thisVar=new BcelVar(getThisType().resolve(world),0);
}

Fixed version (ground truth):
private void initializeThisVar(){
  if (thisVar != null)   return;
  thisVar=new BcelVar(getThisType().resolve(world),0);
  thisVar.setPositionInAroundState(0);
}
Program: 9749
Project: 9749
Buggy source:
InstructionList makeCallToCallback(LazyMethodGen callbackMethod){
  InstructionFactory fact=getFactory();
  InstructionList callback=new InstructionList();
  if (targetVar != null) {
    callback.append(BcelRenderer.renderExpr(fact,world,targetVar));
  }
  callback.append(BcelRenderer.renderExprs(fact,world,argVars));
  callback.append(Utility.createInvoke(fact,callbackMethod));
  return callback;
}

Fixed version (ground truth):
InstructionList makeCallToCallback(LazyMethodGen callbackMethod){
  InstructionFactory fact=getFactory();
  InstructionList callback=new InstructionList();
  if (thisVar != null) {
    callback.append(fact.ALOAD_0);
  }
  if (targetVar != null && targetVar != thisVar) {
    callback.append(BcelRenderer.renderExpr(fact,world,targetVar));
  }
  callback.append(BcelRenderer.renderExprs(fact,world,argVars));
  if (thisJoinPointVar != null) {
    callback.append(BcelRenderer.renderExpr(fact,world,thisJoinPointVar));
  }
  callback.append(Utility.createInvoke(fact,callbackMethod));
  return callback;
}
Program: 9750
Project: 9750
Buggy source:
/** 
 * The new method is nonStatic iff we're from nonExpression advice with an enclosing non-static method. Otherwise, it's static
 */
private LazyMethodGen createMethodGen(String newMethodName){
  Type[] parameterTypes=world.makeBcelTypes(getSignature().getParameterTypes());
  int modifiers=Modifier.FINAL;
  modifiers|=Modifier.STATIC;
  if (hasTarget()) {
    TypeX targetType=getTargetType();
    parameterTypes=addType(world.makeBcelType(targetType),parameterTypes);
  }
  if (thisJoinPointVar != null) {
    parameterTypes=addTypeToEnd(LazyClassGen.tjpType,parameterTypes);
  }
  TypeX returnType;
  if (getKind() == ConstructorCall) {
    returnType=getSignature().getDeclaringType();
  }
 else   if (getKind() == PreInitialization) {
    returnType=TypeX.OBJECTARRAY;
  }
 else {
    returnType=getSignature().getReturnType();
  }
  return new LazyMethodGen(modifiers,world.makeBcelType(returnType),newMethodName,parameterTypes,new String[0],getEnclosingClass());
}

Fixed version (ground truth):
/** 
 * The new method always static. It may take some extra arguments:  this, target. If it's argsOnStack, then it must take both this/target If it's argsOnFrame, it shares this and target. ??? rewrite this to do less array munging, please
 */
private LazyMethodGen createMethodGen(String newMethodName){
  Type[] parameterTypes=world.makeBcelTypes(getSignature().getParameterTypes());
  int modifiers=Modifier.FINAL;
  modifiers|=Modifier.STATIC;
  if (targetVar != null && targetVar != thisVar) {
    TypeX targetType=getTargetType();
    ResolvedMember resolvedMember=getSignature().resolve(world);
    if (resolvedMember != null && Modifier.isProtected(resolvedMember.getModifiers()) && !samePackage(targetType.getPackageName(),getThisType().getPackageName())) {
      if (!targetType.isAssignableFrom(getThisType(),world)) {
        throw new BCException("String_Node_Str");
      }
      targetType=getThisType();
    }
    parameterTypes=addType(world.makeBcelType(targetType),parameterTypes);
  }
  if (thisVar != null) {
    TypeX thisType=getThisType();
    parameterTypes=addType(world.makeBcelType(thisType),parameterTypes);
  }
  if (thisJoinPointVar != null) {
    parameterTypes=addTypeToEnd(LazyClassGen.tjpType,parameterTypes);
  }
  TypeX returnType;
  if (getKind() == ConstructorCall) {
    returnType=getSignature().getDeclaringType();
  }
 else   if (getKind() == PreInitialization) {
    returnType=TypeX.OBJECTARRAY;
  }
 else {
    returnType=getSignature().getReturnType();
  }
  return new LazyMethodGen(modifiers,world.makeBcelType(returnType),newMethodName,parameterTypes,new String[0],getEnclosingClass());
}
Program: 9751
Project: 9751
Buggy source:
/** 
 * side-effect-free 
 */
private InstructionList makeClosureInstantiation(Member constructor,BcelVar holder){
  InstructionFactory fact=getFactory();
  BcelVar arrayVar=genTempVar(TypeX.OBJECTARRAY);
  final InstructionList il=new InstructionList();
  int alen=getArgCount() + (targetVar == null ? 0 : 1) + (thisJoinPointVar == null ? 0 : 1);
  il.append(Utility.createConstant(fact,alen));
  il.append((Instruction)fact.createNewArray(Type.OBJECT,(short)1));
  arrayVar.appendStore(il,fact);
  int stateIndex=0;
  if (targetVar != null) {
    arrayVar.appendConvertableArrayStore(il,fact,stateIndex,targetVar);
    targetVar.setPositionInAroundState(stateIndex);
    stateIndex++;
  }
  for (int i=0, len=getArgCount(); i < len; i++) {
    arrayVar.appendConvertableArrayStore(il,fact,stateIndex,argVars[i]);
    argVars[i].setPositionInAroundState(stateIndex);
    stateIndex++;
  }
  if (thisJoinPointVar != null) {
    arrayVar.appendConvertableArrayStore(il,fact,stateIndex,thisJoinPointVar);
    thisJoinPointVar.setPositionInAroundState(stateIndex);
    stateIndex++;
  }
  il.append(fact.createNew(new ObjectType(constructor.getDeclaringType().getName())));
  il.append(new DUP());
  arrayVar.appendLoad(il,fact);
  il.append(Utility.createInvoke(fact,world,constructor));
  if (getKind() == PreInitialization) {
    il.append(fact.DUP);
    holder.appendStore(il,fact);
  }
  return il;
}

Fixed version (ground truth):
/** 
 * side-effect-free 
 */
private InstructionList makeClosureInstantiation(Member constructor,BcelVar holder){
  InstructionFactory fact=getFactory();
  BcelVar arrayVar=genTempVar(TypeX.OBJECTARRAY);
  final InstructionList il=new InstructionList();
  int alen=getArgCount() + (thisVar == null ? 0 : 1) + ((targetVar != null && targetVar != thisVar) ? 1 : 0)+ (thisJoinPointVar == null ? 0 : 1);
  il.append(Utility.createConstant(fact,alen));
  il.append((Instruction)fact.createNewArray(Type.OBJECT,(short)1));
  arrayVar.appendStore(il,fact);
  int stateIndex=0;
  if (thisVar != null) {
    arrayVar.appendConvertableArrayStore(il,fact,stateIndex,thisVar);
    thisVar.setPositionInAroundState(stateIndex);
    stateIndex++;
  }
  if (targetVar != null && targetVar != thisVar) {
    arrayVar.appendConvertableArrayStore(il,fact,stateIndex,targetVar);
    targetVar.setPositionInAroundState(stateIndex);
    stateIndex++;
  }
  for (int i=0, len=getArgCount(); i < len; i++) {
    arrayVar.appendConvertableArrayStore(il,fact,stateIndex,argVars[i]);
    argVars[i].setPositionInAroundState(stateIndex);
    stateIndex++;
  }
  if (thisJoinPointVar != null) {
    arrayVar.appendConvertableArrayStore(il,fact,stateIndex,thisJoinPointVar);
    thisJoinPointVar.setPositionInAroundState(stateIndex);
    stateIndex++;
  }
  il.append(fact.createNew(new ObjectType(constructor.getDeclaringType().getName())));
  il.append(new DUP());
  arrayVar.appendLoad(il,fact);
  il.append(Utility.createInvoke(fact,world,constructor));
  if (getKind() == PreInitialization) {
    il.append(fact.DUP);
    holder.appendStore(il,fact);
  }
  return il;
}
Program: 9752
Project: 9752
Buggy source:
public static BcelShadow makeStaticInitialization(BcelWorld world,LazyMethodGen enclosingMethod){
  InstructionList body=enclosingMethod.getBody();
  BcelShadow s=new BcelShadow(world,StaticInitialization,world.makeMethodSignature(enclosingMethod),enclosingMethod,null);
  ShadowRange r=new ShadowRange(body);
  r.associateWithShadow(s);
  r.associateWithTargets(Range.genStart(body),Range.genEnd(body));
  return s;
}

Fixed version (ground truth):
public static BcelShadow makeStaticInitialization(BcelWorld world,LazyMethodGen enclosingMethod){
  InstructionList body=enclosingMethod.getBody();
  InstructionHandle ih=body.getStart();
  if (ih.getInstruction() instanceof InvokeInstruction) {
    InvokeInstruction ii=(InvokeInstruction)ih.getInstruction();
    if (ii.getName(enclosingMethod.getEnclosingClass().getConstantPoolGen()).equals(NameMangler.AJC_CLINIT_NAME)) {
      ih=ih.getNext();
    }
  }
  BcelShadow s=new BcelShadow(world,StaticInitialization,world.makeMethodSignature(enclosingMethod),enclosingMethod,null);
  ShadowRange r=new ShadowRange(body);
  r.associateWithShadow(s);
  r.associateWithTargets(Range.genStart(body,ih),Range.genEnd(body));
  return s;
}
Program: 9753
Project: 9753
Buggy source:
public void weaveAfterThrowing(BcelAdvice munger,TypeX catchType){
  InstructionFactory fact=getFactory();
  InstructionList handler=new InstructionList();
  BcelVar exceptionVar=genTempVar(catchType);
  exceptionVar.appendStore(handler,fact);
  InstructionList endHandler=new InstructionList(exceptionVar.createLoad(fact));
  handler.append(munger.getAdviceInstructions(this,exceptionVar,endHandler.getStart()));
  handler.append(endHandler);
  handler.append(fact.ATHROW);
  InstructionHandle handlerStart=handler.getStart();
  if (isFallsThrough()) {
    InstructionHandle jumpTarget=handler.append(fact.NOP);
    handler.insert(fact.createBranchInstruction(Constants.GOTO,jumpTarget));
  }
  InstructionHandle protectedEnd=handler.getStart();
  range.insert(handler,Range.InsideAfter);
  enclosingMethod.addExceptionHandler(range.getStart().getNext(),protectedEnd.getPrev(),handlerStart,(ObjectType)BcelWorld.makeBcelType(catchType),isExpressionKind());
}

Fixed version (ground truth):
public void weaveAfterThrowing(BcelAdvice munger,TypeX catchType){
  if (getRange().getStart().getNext() == getRange().getEnd())   return;
  InstructionFactory fact=getFactory();
  InstructionList handler=new InstructionList();
  BcelVar exceptionVar=genTempVar(catchType);
  exceptionVar.appendStore(handler,fact);
  InstructionList endHandler=new InstructionList(exceptionVar.createLoad(fact));
  handler.append(munger.getAdviceInstructions(this,exceptionVar,endHandler.getStart()));
  handler.append(endHandler);
  handler.append(fact.ATHROW);
  InstructionHandle handlerStart=handler.getStart();
  if (isFallsThrough()) {
    InstructionHandle jumpTarget=handler.append(fact.NOP);
    handler.insert(fact.createBranchInstruction(Constants.GOTO,jumpTarget));
  }
  InstructionHandle protectedEnd=handler.getStart();
  range.insert(handler,Range.InsideAfter);
  enclosingMethod.addExceptionHandler(range.getStart().getNext(),protectedEnd.getPrev(),handlerStart,(ObjectType)BcelWorld.makeBcelType(catchType),isExpressionKind());
}
Program: 9754
Project: 9754
Buggy source:
public void initializeArgVars(){
  if (argVars != null)   return;
  InstructionFactory fact=getFactory();
  int len=getArgCount();
  argVars=new BcelVar[len];
  if (getKind().argsOnStack()) {
    for (int i=len - 1; i >= 0; i--) {
      TypeX type=getArgType(i);
      BcelVar tmp=genTempVar(type,"String_Node_Str" + i);
      range.insert(tmp.createStore(getFactory()),Range.OutsideBefore);
      int position=i;
      if (hasTarget())       position+=1;
      tmp.setPositionInAroundState(position);
      argVars[i]=tmp;
    }
  }
 else {
    int index=0;
    if (hasThis())     index++;
    for (int i=0; i < len; i++) {
      TypeX type=getArgType(i);
      BcelVar tmp=genTempVar(type,"String_Node_Str" + i);
      range.insert(tmp.createCopyFrom(fact,index),Range.OutsideBefore);
      argVars[i]=tmp;
      int position=i;
      if (hasTarget())       position+=1;
      tmp.setPositionInAroundState(position);
      index+=type.getSize();
    }
  }
}

Fixed version (ground truth):
public void initializeArgVars(){
  if (argVars != null)   return;
  InstructionFactory fact=getFactory();
  int len=getArgCount();
  argVars=new BcelVar[len];
  int positionOffset=(hasTarget() ? 0 : 1) + (hasThis() ? 0 : 1);
  if (getKind().argsOnStack()) {
    for (int i=len - 1; i >= 0; i--) {
      TypeX type=getArgType(i);
      BcelVar tmp=genTempVar(type,"String_Node_Str" + i);
      range.insert(tmp.createStore(getFactory()),Range.OutsideBefore);
      int position=i;
      if (hasTarget())       position+=positionOffset;
      tmp.setPositionInAroundState(position);
      argVars[i]=tmp;
    }
  }
 else {
    int index=0;
    if (hasThis())     index++;
    for (int i=0; i < len; i++) {
      TypeX type=getArgType(i);
      BcelVar tmp=genTempVar(type,"String_Node_Str" + i);
      range.insert(tmp.createCopyFrom(fact,index),Range.OutsideBefore);
      argVars[i]=tmp;
      int position=i;
      if (hasTarget())       position+=positionOffset;
      tmp.setPositionInAroundState(position);
      index+=type.getSize();
    }
  }
}
Program: 9755
Project: 9755
Buggy source:
public void initializeForAroundClosure(){
  initializeArgVars();
  if (hasTarget())   initializeTargetVar();
}

Fixed version (ground truth):
public void initializeForAroundClosure(){
  initializeArgVars();
  if (hasTarget())   initializeTargetVar();
  if (hasThis())   initializeThisVar();
}
Program: 9756
Project: 9756
Buggy source:
/** 
 * make a map from old frame location to new frame location.  Any unkeyed frame location picks out a copied local 
 */
private IntMap makeRemap(){
  IntMap ret=new IntMap(5);
  int reti=0;
  if (targetVar != null) {
    ret.put(targetVar.getSlot(),reti++);
  }
  for (int i=0, len=argVars.length; i < len; i++) {
    ret.put(argVars[i].getSlot(),reti);
    reti+=argVars[i].getType().getSize();
  }
  if (thisJoinPointVar != null) {
    ret.put(thisJoinPointVar.getSlot(),reti++);
  }
  if (!getKind().argsOnStack()) {
    int index=0;
    if (hasThis()) {
      ret.put(0,0);
      index++;
    }
    for (int i=0; i < getArgCount(); i++) {
      TypeX type=getArgType(i);
      ret.put(index,index);
      index+=type.getSize();
    }
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * make a map from old frame location to new frame location.  Any unkeyed frame location picks out a copied local 
 */
private IntMap makeRemap(){
  IntMap ret=new IntMap(5);
  int reti=0;
  if (thisVar != null) {
    ret.put(0,reti++);
  }
  if (targetVar != null && targetVar != thisVar) {
    ret.put(targetVar.getSlot(),reti++);
  }
  for (int i=0, len=argVars.length; i < len; i++) {
    ret.put(argVars[i].getSlot(),reti);
    reti+=argVars[i].getType().getSize();
  }
  if (thisJoinPointVar != null) {
    ret.put(thisJoinPointVar.getSlot(),reti++);
  }
  if (!getKind().argsOnStack()) {
    int oldi=0;
    int newi=0;
    if (hasThis()) {
      ret.put(0,0);
      oldi++;
      newi+=1;
    }
    for (int i=0; i < getArgCount(); i++) {
      TypeX type=getArgType(i);
      ret.put(oldi,newi);
      oldi+=type.getSize();
      newi+=type.getSize();
    }
  }
  return ret;
}
Program: 9757
Project: 9757
Buggy source:
public void initializeTargetVar(){
  InstructionFactory fact=getFactory();
  if (targetVar != null)   return;
  if (!isExpressionKind()) {
    initializeThisVar();
    targetVar=thisVar;
  }
 else {
    initializeArgVars();
    TypeX type=getTargetType();
    targetVar=genTempVar(type,"String_Node_Str");
    range.insert(targetVar.createStore(fact),Range.OutsideBefore);
  }
  targetVar.setPositionInAroundState(0);
}

Fixed version (ground truth):
public void initializeTargetVar(){
  InstructionFactory fact=getFactory();
  if (targetVar != null)   return;
  if (!isExpressionKind()) {
    initializeThisVar();
    targetVar=thisVar;
  }
 else {
    initializeArgVars();
    TypeX type=getTargetType();
    targetVar=genTempVar(type,"String_Node_Str");
    range.insert(targetVar.createStore(fact),Range.OutsideBefore);
    targetVar.setPositionInAroundState(hasThis() ? 1 : 0);
  }
}
Program: 9759
Project: 9759
Buggy source:
public void generateCode(ClassScope classScope,ClassFile classFile){
  if (proceedMethodBinding != null) {
  }
  super.generateCode(classScope,classFile);
  if (proceedMethodBinding != null) {
    generateProceedMethod(classScope,classFile);
  }
}

Fixed version (ground truth):
public void generateCode(ClassScope classScope,ClassFile classFile){
  super.generateCode(classScope,classFile);
  if (proceedMethodBinding != null) {
    generateProceedMethod(classScope,classFile);
  }
}
Program: 9760
Project: 9760
Buggy source:
public void postParse(TypeDeclaration typeDec){
  this.selector=NameMangler.adviceName(EclipseWorld.fromBinding(typeDec.binding),kind,sourceStart).toCharArray();
  finishParsing();
  pointcutDesignator.postParse(typeDec,this);
}

Fixed version (ground truth):
public void postParse(TypeDeclaration typeDec){
  this.selector=NameMangler.adviceName(EclipseWorld.fromBinding(typeDec.binding),kind,sourceStart).toCharArray();
  if (arguments != null) {
    baseArgumentCount=arguments.length;
  }
  if (kind == AdviceKind.Around) {
    extraArgument=makeFinalArgument("String_Node_Str",AjTypeConstants.getAroundClosureType());
  }
  int addedArguments=3;
  if (extraArgument != null) {
    addedArguments+=1;
  }
  arguments=extendArgumentsLength(arguments,addedArguments);
  int index=baseArgumentCount;
  if (extraArgument != null) {
    arguments[index++]=extraArgument;
  }
  arguments[index++]=makeFinalArgument("String_Node_Str",AjTypeConstants.getJoinPointStaticPartType());
  arguments[index++]=makeFinalArgument("String_Node_Str",AjTypeConstants.getJoinPointType());
  arguments[index++]=makeFinalArgument("String_Node_Str",AjTypeConstants.getJoinPointStaticPartType());
  if (pointcutDesignator.isError()) {
    this.ignoreFurtherInvestigation=true;
  }
  pointcutDesignator.postParse(typeDec,this);
}
Program: 9761
Project: 9761
Buggy source:
public ResolvedPointcutDefinition makeResolvedPointcutDefinition(){
  return new ResolvedPointcutDefinition(EclipseWorld.fromBinding(this.binding.declaringClass),this.modifiers,new String(selector),EclipseWorld.fromBindings(this.binding.parameters),getPointcut());
}

Fixed version (ground truth):
public ResolvedPointcutDefinition makeResolvedPointcutDefinition(){
  ResolvedPointcutDefinition ret=new ResolvedPointcutDefinition(EclipseWorld.fromBinding(this.binding.declaringClass),declaredModifiers,declaredName,EclipseWorld.fromBindings(this.binding.parameters),getPointcut());
  ret.setPosition(sourceStart,sourceEnd);
  ret.setSourceContext(new EclipseSourceContext(compilationResult));
  return ret;
}
Program: 9762
Project: 9762
Buggy source:
public void postParse(TypeDeclaration typeDec){
  if (arguments == null)   arguments=new Argument[0];
  if (pointcutDesignator == null)   return;
  pointcutDesignator.postParse(typeDec,this);
}

Fixed version (ground truth):
public void postParse(TypeDeclaration typeDec){
  if (arguments == null)   arguments=new Argument[0];
  this.declaredModifiers=modifiers;
  this.declaredName=new String(selector);
  selector=CharOperation.concat(mangledPrefix,'$',selector,'$',Integer.toHexString(sourceStart).toCharArray());
  if (pointcutDesignator == null)   return;
  pointcutDesignator.postParse(typeDec,this);
}
Program: 9763
Project: 9763
Buggy source:
public void parseStatements(Parser parser,CompilationUnitDeclaration unit){
  if (pointcutDesignator == null) {
  }
 else {
  }
}

Fixed version (ground truth):
public void parseStatements(Parser parser,CompilationUnitDeclaration unit){
}
Program: 9764
Project: 9764
Buggy source:
public static void main(String[] args) throws Exception {
  Random random=new Random();
  LoremIpsum loremIpsum=new LoremIpsum();
  String file="String_Node_Str" + new SimpleDateFormat("String_Node_Str").format(new Date()) + "String_Node_Str";
  System.out.println("String_Node_Str" + file);
  final OutputStream out=new FileOutputStream(file);
  LogglyBatchAppender<String> appender=new LogglyBatchAppender<String>(){
    @Override protected void processLogEntries(    InputStream in) throws IOException {
      IoUtils.copy(in,out);
    }
  }
;
  appender.setInputKey("String_Node_Str");
  appender.setLayout(new EchoLayout<String>());
  appender.setDebug(true);
  appender.start();
  assertTrue("String_Node_Str",appender.isStarted());
  appender.doAppend("String_Node_Str" + new Timestamp(System.currentTimeMillis()));
  for (int i=0; i < 100000; i++) {
    appender.doAppend(i + "String_Node_Str" + new Timestamp(System.currentTimeMillis())+ "String_Node_Str"+ loremIpsum.getWords(random.nextInt(50),random.nextInt(50)));
    TimeUnit.MILLISECONDS.sleep(random.nextInt(30));
    if (i % 100 == 0) {
      System.out.println(i + "String_Node_Str" + appender);
    }
  }
  appender.stop();
  out.close();
  System.out.println(appender);
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  Random random=new Random();
  LoremIpsum loremIpsum=new LoremIpsum();
  String file="String_Node_Str" + new SimpleDateFormat("String_Node_Str").format(new Date()) + "String_Node_Str";
  System.out.println("String_Node_Str" + file);
  final OutputStream out=new FileOutputStream(file);
  LogglyBatchAppender<String> appender=new LogglyBatchAppender<String>(){
    @Override protected void processLogEntries(    InputStream in){
      try {
        IoUtils.copy(in,out);
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
  }
;
  appender.setInputKey("String_Node_Str");
  appender.setLayout(new EchoLayout<String>());
  appender.setDebug(true);
  appender.start();
  assertTrue("String_Node_Str",appender.isStarted());
  appender.doAppend("String_Node_Str" + new Timestamp(System.currentTimeMillis()));
  for (int i=0; i < 100000; i++) {
    appender.doAppend(i + "String_Node_Str" + new Timestamp(System.currentTimeMillis())+ "String_Node_Str"+ loremIpsum.getWords(random.nextInt(50),random.nextInt(50)));
    TimeUnit.MILLISECONDS.sleep(random.nextInt(30));
    if (i % 100 == 0) {
      System.out.println(i + "String_Node_Str" + appender);
    }
  }
  appender.stop();
  out.close();
  System.out.println(appender);
}
Program: 9765
Project: 9765
Buggy source:
@Override protected void processLogEntries(InputStream in) throws IOException {
  IoUtils.copy(in,out);
}

Fixed version (ground truth):
@Override protected void processLogEntries(InputStream in){
  try {
    IoUtils.copy(in,out);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 9766
Project: 9766
Buggy source:
@Override protected void processLogEntries(InputStream in) throws IOException {
  super.processLogEntries(in);
synchronized (appender) {
    notifyAll();
  }
}

Fixed version (ground truth):
@Override protected void processLogEntries(InputStream in){
  super.processLogEntries(in);
synchronized (appender) {
    notifyAll();
  }
}
Program: 9767
Project: 9767
Buggy source:
/** 
 * Creates a configured HTTP connection to a URL (does not open the connection)
 * @param url target URL
 * @return the newly created HTTP connection
 * @throws IOException
 */
protected HttpURLConnection getHttpConnection(URL url) throws IOException {
  HttpURLConnection conn;
  if (proxy == null) {
    conn=(HttpURLConnection)url.openConnection();
  }
 else {
    conn=(HttpURLConnection)url.openConnection(proxy);
  }
  conn.setDoOutput(true);
  conn.setDoInput(true);
  conn.setRequestProperty("String_Node_Str",layout.getContentType() + "String_Node_Str" + charset.name());
  conn.setRequestMethod("String_Node_Str");
  conn.setReadTimeout(getHttpReadTimeoutInMillis());
  return conn;
}

Fixed version (ground truth):
/** 
 * Creates a configured HTTP connection to a URL (does not open the connection)
 * @param url target URL
 * @return the newly created HTTP connection
 * @throws IOException connection error
 */
protected HttpURLConnection getHttpConnection(URL url) throws IOException {
  HttpURLConnection conn;
  if (proxy == null) {
    conn=(HttpURLConnection)url.openConnection();
  }
 else {
    conn=(HttpURLConnection)url.openConnection(proxy);
  }
  conn.setDoOutput(true);
  conn.setDoInput(true);
  conn.setRequestProperty("String_Node_Str",layout.getContentType() + "String_Node_Str" + charset.name());
  conn.setRequestMethod("String_Node_Str");
  conn.setReadTimeout(getHttpReadTimeoutInMillis());
  return conn;
}
Program: 9768
Project: 9768
Buggy source:
/** 
 * Send log entries to Loggly
 */
protected void processLogEntries(InputStream in) throws IOException {
  long nanosBefore=System.nanoTime();
  try {
    HttpURLConnection conn=getHttpConnection(new URL(endpointUrl));
    conn.setReadTimeout(connReadTimeoutSeconds * 1000);
    BufferedOutputStream out=new BufferedOutputStream(conn.getOutputStream());
    long len=IoUtils.copy(in,out);
    sentBytes.addAndGet(len);
    out.flush();
    out.close();
    int responseCode=conn.getResponseCode();
    String response=super.readResponseBody(conn.getInputStream());
switch (responseCode) {
case HttpURLConnection.HTTP_OK:
case HttpURLConnection.HTTP_ACCEPTED:
      sendSuccessCount.incrementAndGet();
    break;
default :
  sendExceptionCount.incrementAndGet();
addError("String_Node_Str" + responseCode + "String_Node_Str"+ response);
}
try {
conn.getInputStream().close();
conn.disconnect();
}
 catch (Exception e) {
}
}
 catch (Exception e) {
sendExceptionCount.incrementAndGet();
addError("String_Node_Str",e);
}
 finally {
sendDurationInNanos.addAndGet(System.nanoTime() - nanosBefore);
}
}

Fixed version (ground truth):
/** 
 * Send log entries to Loggly
 * @param in log input stream
 */
protected void processLogEntries(InputStream in){
  long nanosBefore=System.nanoTime();
  try {
    HttpURLConnection conn=getHttpConnection(new URL(endpointUrl));
    conn.setReadTimeout(connReadTimeoutSeconds * 1000);
    BufferedOutputStream out=new BufferedOutputStream(conn.getOutputStream());
    long len=IoUtils.copy(in,out);
    sentBytes.addAndGet(len);
    out.flush();
    out.close();
    int responseCode=conn.getResponseCode();
    String response=super.readResponseBody(conn.getInputStream());
switch (responseCode) {
case HttpURLConnection.HTTP_OK:
case HttpURLConnection.HTTP_ACCEPTED:
      sendSuccessCount.incrementAndGet();
    break;
default :
  sendExceptionCount.incrementAndGet();
addError("String_Node_Str" + responseCode + "String_Node_Str"+ response);
}
try {
conn.getInputStream().close();
conn.disconnect();
}
 catch (Exception e) {
}
}
 catch (Exception e) {
sendExceptionCount.incrementAndGet();
addError("String_Node_Str",e);
}
 finally {
sendDurationInNanos.addAndGet(System.nanoTime() - nanosBefore);
}
}
Program: 9769
Project: 9769
Buggy source:
/** 
 * Moves the current active bucket to the list of filled buckets and defines a new one. <p/> The new active bucket is reused from the   {@link #recycledBucketPool} pool if one is available or recreated.
 */
public void rollCurrentBucket(){
  currentBucketLock.lock();
  try {
    boolean offered=filledBuckets.offer(currentBucket);
    if (offered) {
      onBucketRoll(currentBucket);
    }
 else {
      onBucketDiscard(currentBucket);
      discardedBucketCount.incrementAndGet();
    }
    currentBucket=newBucket();
  }
  finally {
    currentBucketLock.unlock();
  }
}

Fixed version (ground truth):
/** 
 * Moves the current active bucket to the list of filled buckets and defines a new one. The new active bucket is reused from the   {@link #recycledBucketPool} pool if one is available or recreated.
 */
public void rollCurrentBucket(){
  currentBucketLock.lock();
  try {
    boolean offered=filledBuckets.offer(currentBucket);
    if (offered) {
      onBucketRoll(currentBucket);
    }
 else {
      onBucketDiscard(currentBucket);
      discardedBucketCount.incrementAndGet();
    }
    currentBucket=newBucket();
  }
  finally {
    currentBucketLock.unlock();
  }
}
Program: 9770
Project: 9770
Buggy source:
/** 
 * Number of discarded buckets. Monitoring oriented metric.
 */
public int getDiscardedBucketCount(){
  return discardedBucketCount.get();
}

Fixed version (ground truth):
/** 
 * @return Number of discarded buckets. Monitoring oriented metric.
 */
public int getDiscardedBucketCount(){
  return discardedBucketCount.get();
}
Program: 9771
Project: 9771
Buggy source:
/** 
 * @param maxBucketSizeInBytes
 * @param maxBucketCount
 */
public DiscardingRollingOutputStream(int maxBucketSizeInBytes,int maxBucketCount){
  if (maxBucketCount < 2) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.maxBucketSizeInBytes=maxBucketSizeInBytes;
  this.filledBuckets=new LinkedBlockingDeque<ByteArrayOutputStream>(maxBucketCount);
  this.recycledBucketPool=new ConcurrentLinkedQueue<ByteArrayOutputStream>();
  this.currentBucket=newBucket();
}

Fixed version (ground truth):
/** 
 * @param maxBucketSizeInBytes maximum byte size of each bucket
 * @param maxBucketCount maximum number of buckets
 */
public DiscardingRollingOutputStream(int maxBucketSizeInBytes,int maxBucketCount){
  if (maxBucketCount < 2) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.maxBucketSizeInBytes=maxBucketSizeInBytes;
  this.filledBuckets=new LinkedBlockingDeque<ByteArrayOutputStream>(maxBucketCount);
  this.recycledBucketPool=new ConcurrentLinkedQueue<ByteArrayOutputStream>();
  this.currentBucket=newBucket();
}