nus-yam/ex-repair huggingface dataset:
Program: 72168
Project: 72168
Buggy source:
private static void executeCommandForPid(String pid,String command) throws AttachNotSupportedException, IOException, UnsupportedEncodingException {
  VirtualMachine vm=VirtualMachine.attach(pid);
  HotSpotVirtualMachine hvm=(HotSpotVirtualMachine)vm;
  try (InputStream in=hvm.executeJCmd(command)){
    byte b[]=new byte[256];
    int n;
    do {
      n=in.read(b);
      if (n > 0) {
        String s=new String(b,0,n,"String_Node_Str");
        System.out.print(s);
      }
    }
 while (n > 0);
  }
   vm.detach();
}

Fixed version (ground truth):
private static void executeCommandForPid(String pid,String command) throws AttachNotSupportedException, IOException, UnsupportedEncodingException {
  VirtualMachine vm=VirtualMachine.attach(pid);
  HotSpotVirtualMachine hvm=(HotSpotVirtualMachine)vm;
  String lines[]=command.split("String_Node_Str");
  for (  String line : lines) {
    try (InputStream in=hvm.executeJCmd(line)){
      byte b[]=new byte[256];
      int n;
      do {
        n=in.read(b);
        if (n > 0) {
          String s=new String(b,0,n,"String_Node_Str");
          System.out.print(s);
        }
      }
 while (n > 0);
    }
   }
  vm.detach();
}
Program: 72169
Project: 72169
Buggy source:
protected void close(){
  if (fd != null || fd1 != null) {
    datagramSocketClose();
    fd=null;
    fd1=null;
  }
}

Fixed version (ground truth):
protected void close(){
  if (fd != null || fd1 != null) {
    datagramSocketClose();
    ResourceManager.afterUdpClose();
    fd=null;
    fd1=null;
  }
}
Program: 72170
Project: 72170
Buggy source:
public Log make(){
  return Bark.instance(context);
}

Fixed version (ground truth):
public Log make(Context c){
  return Bark.instance(c);
}
Program: 72171
Project: 72171
Buggy source:
/** 
 * Preregisters factories to create and use a Bark object for use as both a Log and a Bark.
 */
public static void preRegister(final Context context){
  context.put(barkKey,new Context.Factory<Bark>(){
    public Bark make(){
      return new Bark(context);
    }
  }
);
  context.put(Log.logKey,new Context.Factory<Log>(){
    public Log make(){
      return Bark.instance(context);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Preregisters factories to create and use a Bark object for use as both a Log and a Bark.
 */
public static void preRegister(Context context){
  context.put(barkKey,new Context.Factory<Bark>(){
    public Bark make(    Context c){
      return new Bark(c);
    }
  }
);
  context.put(Log.logKey,new Context.Factory<Log>(){
    public Log make(    Context c){
      return Bark.instance(c);
    }
  }
);
}
Program: 72172
Project: 72172
Buggy source:
/** 
 * Register that a compilation is about to start.
 */
void beginContext(final Context context){
  if (compilationInProgress)   throw new IllegalStateException("String_Node_Str");
  compilationInProgress=true;
  final JavaFileManager givenFileManager=context.get(JavaFileManager.class);
  context.put(JavaFileManager.class,(JavaFileManager)null);
  context.put(JavaFileManager.class,new Context.Factory<JavaFileManager>(){
    public JavaFileManager make(){
      if (givenFileManager != null) {
        context.put(JavaFileManager.class,givenFileManager);
        return givenFileManager;
      }
 else {
        return new JavacFileManager(context,true,null);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Register that a compilation is about to start.
 */
void beginContext(Context context){
  if (compilationInProgress)   throw new IllegalStateException("String_Node_Str");
  compilationInProgress=true;
  final JavaFileManager givenFileManager=context.get(JavaFileManager.class);
  context.put(JavaFileManager.class,(JavaFileManager)null);
  context.put(JavaFileManager.class,new Context.Factory<JavaFileManager>(){
    public JavaFileManager make(    Context c){
      if (givenFileManager != null) {
        c.put(JavaFileManager.class,givenFileManager);
        return givenFileManager;
      }
 else {
        return new JavacFileManager(c,true,null);
      }
    }
  }
);
}
Program: 72173
Project: 72173
Buggy source:
public JavaFileManager make(){
  if (givenFileManager != null) {
    context.put(JavaFileManager.class,givenFileManager);
    return givenFileManager;
  }
 else {
    return new JavacFileManager(context,true,null);
  }
}

Fixed version (ground truth):
public JavaFileManager make(Context c){
  if (givenFileManager != null) {
    c.put(JavaFileManager.class,givenFileManager);
    return givenFileManager;
  }
 else {
    return new JavacFileManager(c,true,null);
  }
}
Program: 72174
Project: 72174
Buggy source:
public FSInfo make(){
  FSInfo instance=new CacheFSInfo();
  context.put(FSInfo.class,instance);
  return instance;
}

Fixed version (ground truth):
public FSInfo make(Context c){
  FSInfo instance=new CacheFSInfo();
  c.put(FSInfo.class,instance);
  return instance;
}
Program: 72175
Project: 72175
Buggy source:
/** 
 * Register a Context.Factory to create a singleton CacheFSInfo.
 */
public static void preRegister(final Context context){
  context.put(FSInfo.class,new Context.Factory<FSInfo>(){
    public FSInfo make(){
      FSInfo instance=new CacheFSInfo();
      context.put(FSInfo.class,instance);
      return instance;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Register a Context.Factory to create a CacheFSInfo.
 */
public static void preRegister(Context context){
  context.put(FSInfo.class,new Context.Factory<FSInfo>(){
    public FSInfo make(    Context c){
      FSInfo instance=new CacheFSInfo();
      c.put(FSInfo.class,instance);
      return instance;
    }
  }
);
}
Program: 72176
Project: 72176
Buggy source:
/** 
 * Register a Context.Factory to create a JavacFileManager.
 */
public static void preRegister(final Context context){
  context.put(JavaFileManager.class,new Context.Factory<JavaFileManager>(){
    public JavaFileManager make(){
      return new JavacFileManager(context,true,null);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Register a Context.Factory to create a JavacFileManager.
 */
public static void preRegister(Context context){
  context.put(JavaFileManager.class,new Context.Factory<JavaFileManager>(){
    public JavaFileManager make(    Context c){
      return new JavacFileManager(c,true,null);
    }
  }
);
}
Program: 72177
Project: 72177
Buggy source:
public JavaFileManager make(){
  return new JavacFileManager(context,true,null);
}

Fixed version (ground truth):
public JavaFileManager make(Context c){
  return new JavacFileManager(c,true,null);
}
Program: 72180
Project: 72180
Buggy source:
public Context(){
}

Fixed version (ground truth):
public Context(Context prev){
  kt.putAll(prev.kt);
  ft.putAll(prev.ft);
  ht.putAll(prev.ft);
}
Program: 72181
Project: 72181
Buggy source:
public void clear(){
  ht=null;
  kt=null;
}

Fixed version (ground truth):
public void clear(){
  ht=null;
  kt=null;
  ft=null;
}
Program: 72182
Project: 72182
Buggy source:
T make();

Fixed version (ground truth):
T make(Context c);
Program: 72183
Project: 72183
Buggy source:
public ClassReader make(){
  return new JavadocClassReader(context);
}

Fixed version (ground truth):
public ClassReader make(Context c){
  return new JavadocClassReader(c);
}
Program: 72184
Project: 72184
Buggy source:
public static void preRegister(final Context context){
  context.put(classReaderKey,new Context.Factory<ClassReader>(){
    public ClassReader make(){
      return new JavadocClassReader(context);
    }
  }
);
}

Fixed version (ground truth):
public static void preRegister(Context context){
  context.put(classReaderKey,new Context.Factory<ClassReader>(){
    public ClassReader make(    Context c){
      return new JavadocClassReader(c);
    }
  }
);
}
Program: 72185
Project: 72185
Buggy source:
public Enter make(){
  return new JavadocEnter(context);
}

Fixed version (ground truth):
public Enter make(Context c){
  return new JavadocEnter(c);
}
Program: 72186
Project: 72186
Buggy source:
public static void preRegister(final Context context){
  context.put(enterKey,new Context.Factory<Enter>(){
    public Enter make(){
      return new JavadocEnter(context);
    }
  }
);
}

Fixed version (ground truth):
public static void preRegister(Context context){
  context.put(enterKey,new Context.Factory<Enter>(){
    public Enter make(    Context c){
      return new JavadocEnter(c);
    }
  }
);
}
Program: 72187
Project: 72187
Buggy source:
public MemberEnter make(){
  return new JavadocMemberEnter(context);
}

Fixed version (ground truth):
public MemberEnter make(Context c){
  return new JavadocMemberEnter(c);
}
Program: 72188
Project: 72188
Buggy source:
public static void preRegister(final Context context){
  context.put(memberEnterKey,new Context.Factory<MemberEnter>(){
    public MemberEnter make(){
      return new JavadocMemberEnter(context);
    }
  }
);
}

Fixed version (ground truth):
public static void preRegister(Context context){
  context.put(memberEnterKey,new Context.Factory<MemberEnter>(){
    public MemberEnter make(    Context c){
      return new JavadocMemberEnter(c);
    }
  }
);
}
Program: 72189
Project: 72189
Buggy source:
public Todo make(){
  return new JavadocTodo(context);
}

Fixed version (ground truth):
public Todo make(Context c){
  return new JavadocTodo(c);
}
Program: 72190
Project: 72190
Buggy source:
public static void preRegister(final Context context){
  context.put(todoKey,new Context.Factory<Todo>(){
    public Todo make(){
      return new JavadocTodo(context);
    }
  }
);
}

Fixed version (ground truth):
public static void preRegister(Context context){
  context.put(todoKey,new Context.Factory<Todo>(){
    public Todo make(    Context c){
      return new JavadocTodo(c);
    }
  }
);
}
Program: 72191
Project: 72191
Buggy source:
public Log make(){
  return new Messager(context,programName,errWriter,warnWriter,noticeWriter);
}

Fixed version (ground truth):
public Log make(Context c){
  return new Messager(c,programName,errWriter,warnWriter,noticeWriter);
}
Program: 72192
Project: 72192
Buggy source:
public static void preRegister(final Context context,final String programName,final PrintWriter errWriter,final PrintWriter warnWriter,final PrintWriter noticeWriter){
  context.put(logKey,new Context.Factory<Log>(){
    public Log make(){
      return new Messager(context,programName,errWriter,warnWriter,noticeWriter);
    }
  }
);
}

Fixed version (ground truth):
public static void preRegister(Context context,final String programName,final PrintWriter errWriter,final PrintWriter warnWriter,final PrintWriter noticeWriter){
  context.put(logKey,new Context.Factory<Log>(){
    public Log make(    Context c){
      return new Messager(c,programName,errWriter,warnWriter,noticeWriter);
    }
  }
);
}
Program: 72193
Project: 72193
Buggy source:
public JavacMessages make(){
  return new ArgTypeMessages(c){
    @Override public String getLocalizedString(    Locale l,    String key,    Object... args){
      return getKeyArgsString(key,args);
    }
  }
;
}

Fixed version (ground truth):
public JavacMessages make(Context c){
  return new ArgTypeMessages(c){
    @Override public String getLocalizedString(    Locale l,    String key,    Object... args){
      return getKeyArgsString(key,args);
    }
  }
;
}
Program: 72194
Project: 72194
Buggy source:
static void preRegister(final Context c){
  c.put(JavacMessages.messagesKey,new Context.Factory<JavacMessages>(){
    public JavacMessages make(){
      return new ArgTypeMessages(c){
        @Override public String getLocalizedString(        Locale l,        String key,        Object... args){
          return getKeyArgsString(key,args);
        }
      }
;
    }
  }
);
}

Fixed version (ground truth):
static void preRegister(Context context){
  context.put(JavacMessages.messagesKey,new Context.Factory<JavacMessages>(){
    public JavacMessages make(    Context c){
      return new ArgTypeMessages(c){
        @Override public String getLocalizedString(        Locale l,        String key,        Object... args){
          return getKeyArgsString(key,args);
        }
      }
;
    }
  }
);
}
Program: 72195
Project: 72195
Buggy source:
public JavacMessages make(){
  return new MessageTracker(c){
    @Override public String getLocalizedString(    Locale l,    String key,    Object... args){
      keys.add(key);
      return super.getLocalizedString(l,key,args);
    }
  }
;
}

Fixed version (ground truth):
public JavacMessages make(Context c){
  return new MessageTracker(c){
    @Override public String getLocalizedString(    Locale l,    String key,    Object... args){
      keys.add(key);
      return super.getLocalizedString(l,key,args);
    }
  }
;
}
Program: 72196
Project: 72196
Buggy source:
static void preRegister(final Context c,final Set<String> keys){
  if (keys != null) {
    c.put(JavacMessages.messagesKey,new Context.Factory<JavacMessages>(){
      public JavacMessages make(){
        return new MessageTracker(c){
          @Override public String getLocalizedString(          Locale l,          String key,          Object... args){
            keys.add(key);
            return super.getLocalizedString(l,key,args);
          }
        }
;
      }
    }
);
  }
}

Fixed version (ground truth):
static void preRegister(Context c,final Set<String> keys){
  if (keys != null) {
    c.put(JavacMessages.messagesKey,new Context.Factory<JavacMessages>(){
      public JavacMessages make(      Context c){
        return new MessageTracker(c){
          @Override public String getLocalizedString(          Locale l,          String key,          Object... args){
            keys.add(key);
            return super.getLocalizedString(l,key,args);
          }
        }
;
      }
    }
);
  }
}
Program: 72197
Project: 72197
Buggy source:
public Entry next(){
  Entry e=super.shadowed;
  while (e.scope != null && (e.sym.name != sym.name || e.sym.owner != e.scope.owner))   e=e.shadowed;
  return e;
}

Fixed version (ground truth):
public Entry next(){
  Entry e=super.shadowed;
  while (isBogus())   e=e.shadowed;
  return e;
}
Program: 72198
Project: 72198
Buggy source:
protected Scope(Symbol owner,ScopeCounter scopeCounter){
  this(null,owner,new Entry[INITIAL_SIZE],scopeCounter);
  for (int i=0; i < INITIAL_SIZE; i++)   table[i]=sentinel;
}

Fixed version (ground truth):
protected Scope(Symbol owner,ScopeCounter scopeCounter){
  this(null,owner,new Entry[INITIAL_SIZE],scopeCounter);
}
Program: 72199
Project: 72199
Buggy source:
protected Scope(Symbol owner,ScopeCounter scopeCounter){
  this(null,owner,new Entry[INITIAL_SIZE],scopeCounter);
}

Fixed version (ground truth):
protected Scope(Symbol owner,ScopeCounter scopeCounter){
  this(null,owner,new Entry[INITIAL_SIZE],scopeCounter);
  for (int i=0; i < INITIAL_SIZE; i++)   table[i]=sentinel;
}
Program: 72200
Project: 72200
Buggy source:
@Override public void write(int b) throws IOException {
  size++;
}

Fixed version (ground truth):
@Override public void write(int b){
  size++;
}
Program: 72201
Project: 72201
Buggy source:
public int byteLength(){
class SizeOutputStream extends OutputStream {
    @Override public void write(    int b) throws IOException {
      size++;
    }
    int size;
  }
  SizeOutputStream sizeOut=new SizeOutputStream();
  DataOutputStream out=new DataOutputStream(sizeOut);
  try {
    out.writeUTF(value);
  }
 catch (  IOException ignore) {
  }
  return 1 + sizeOut.size;
}

Fixed version (ground truth):
public int byteLength(){
class SizeOutputStream extends OutputStream {
    @Override public void write(    int b){
      size++;
    }
    int size;
  }
  SizeOutputStream sizeOut=new SizeOutputStream();
  DataOutputStream out=new DataOutputStream(sizeOut);
  try {
    out.writeUTF(value);
  }
 catch (  IOException ignore) {
  }
  return 1 + sizeOut.size;
}
Program: 72202
Project: 72202
Buggy source:
/** 
 * Constructor
 * @param context      Context for this javadoc instance.
 */
private DocEnv(Context context){
  context.put(docEnvKey,this);
  messager=Messager.instance0(context);
  syms=Symtab.instance(context);
  reader=JavadocClassReader.instance0(context);
  enter=JavadocEnter.instance0(context);
  attr=Attr.instance(context);
  names=Names.instance(context);
  externalizableSym=reader.enterClass(names.fromString("String_Node_Str"));
  chk=Check.instance(context);
  types=Types.instance(context);
  fileManager=context.get(JavaFileManager.class);
  this.doclocale=new DocLocale(this,"String_Node_Str",breakiterator);
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param context      Context for this javadoc instance.
 */
private DocEnv(Context context){
  context.put(docEnvKey,this);
  messager=Messager.instance0(context);
  syms=Symtab.instance(context);
  reader=JavadocClassReader.instance0(context);
  enter=JavadocEnter.instance0(context);
  names=Names.instance(context);
  externalizableSym=reader.enterClass(names.fromString("String_Node_Str"));
  chk=Check.instance(context);
  types=Types.instance(context);
  fileManager=context.get(JavaFileManager.class);
  this.doclocale=new DocLocale(this,"String_Node_Str",breakiterator);
}
Program: 72203
Project: 72203
Buggy source:
/** 
 * Default class enter visitor method: do nothing.
 */
public void visitTree(JCTree tree){
  result=null;
}

Fixed version (ground truth):
/** 
 * Default class enter visitor method: do nothing.
 */
@Override public void visitTree(JCTree tree){
  result=null;
}
Program: 72206
Project: 72206
Buggy source:
/** 
 * Class enter visitor method for type parameters. Enter a symbol for type parameter in local scope, after checking that it is unique.
 */
public void visitTypeParameter(JCTypeParameter tree){
  TypeVar a=(tree.type != null) ? (TypeVar)tree.type : new TypeVar(tree.name,env.info.scope.owner,syms.botType);
  tree.type=a;
  if (chk.checkUnique(tree.pos(),a.tsym,env.info.scope)) {
    env.info.scope.enter(a.tsym);
  }
  result=a;
}

Fixed version (ground truth):
/** 
 * Class enter visitor method for type parameters. Enter a symbol for type parameter in local scope, after checking that it is unique.
 */
@Override public void visitTypeParameter(JCTypeParameter tree){
  TypeVar a=(tree.type != null) ? (TypeVar)tree.type : new TypeVar(tree.name,env.info.scope.owner,syms.botType);
  tree.type=a;
  if (chk.checkUnique(tree.pos(),a.tsym,env.info.scope)) {
    env.info.scope.enter(a.tsym);
  }
  result=a;
}
Program: 72207
Project: 72207
Buggy source:
/** 
 * Main method: enter one class from a list of toplevel trees and place the rest on uncompleted for later processing.
 * @param trees      The list of trees to be processed.
 * @param c          The class symbol to be processed.
 */
public void complete(List<JCCompilationUnit> trees,ClassSymbol c){
  annotate.enterStart();
  ListBuffer<ClassSymbol> prevUncompleted=uncompleted;
  if (memberEnter.completionEnabled)   uncompleted=new ListBuffer<ClassSymbol>();
  try {
    classEnter(trees,null);
    if (memberEnter.completionEnabled) {
      while (uncompleted.nonEmpty()) {
        ClassSymbol clazz=uncompleted.next();
        if (c == null || c == clazz || prevUncompleted == null)         clazz.complete();
 else         prevUncompleted.append(clazz);
      }
      for (      JCCompilationUnit tree : trees) {
        if (tree.starImportScope.elems == null) {
          JavaFileObject prev=log.useSource(tree.sourcefile);
          Env<AttrContext> env=typeEnvs.get(tree);
          if (env == null)           env=topLevelEnv(tree);
          memberEnter.memberEnter(tree,env);
          log.useSource(prev);
        }
      }
    }
  }
  finally {
    uncompleted=prevUncompleted;
    annotate.enterDone();
  }
}

Fixed version (ground truth):
/** 
 * Main method: enter one class from a list of toplevel trees and place the rest on uncompleted for later processing.
 * @param trees      The list of trees to be processed.
 * @param c          The class symbol to be processed.
 */
public void complete(List<JCCompilationUnit> trees,ClassSymbol c){
  annotate.enterStart();
  ListBuffer<ClassSymbol> prevUncompleted=uncompleted;
  if (memberEnter.completionEnabled)   uncompleted=new ListBuffer<ClassSymbol>();
  try {
    classEnter(trees,null);
    if (memberEnter.completionEnabled) {
      while (uncompleted.nonEmpty()) {
        ClassSymbol clazz=uncompleted.next();
        if (c == null || c == clazz || prevUncompleted == null)         clazz.complete();
 else         prevUncompleted.append(clazz);
      }
      for (      JCCompilationUnit tree : trees) {
        if (tree.starImportScope.elems == null) {
          JavaFileObject prev=log.useSource(tree.sourcefile);
          Env<AttrContext> topEnv=topLevelEnv(tree);
          memberEnter.memberEnter(tree,topEnv);
          log.useSource(prev);
        }
      }
    }
  }
  finally {
    uncompleted=prevUncompleted;
    annotate.enterDone();
  }
}
Program: 72208
Project: 72208
Buggy source:
public void visitNewArray(JCNewArray tree){
  tree.elemtype=translate(tree.elemtype,null);
  translate(tree.dims,syms.intType);
  tree.elems=translate(tree.elems,(tree.type == null) ? null : erasure(types.elemtype(tree.type)));
  tree.type=erasure(tree.type);
  result=tree;
}

Fixed version (ground truth):
public void visitNewArray(JCNewArray tree){
  tree.elemtype=translate(tree.elemtype,null);
  translate(tree.dims,syms.intType);
  if (tree.type != null) {
    tree.elems=translate(tree.elems,erasure(types.elemtype(tree.type)));
    tree.type=erasure(tree.type);
  }
 else {
    tree.elems=translate(tree.elems,null);
  }
  result=tree;
}
Program: 72209
Project: 72209
Buggy source:
/** 
 * A KindName representing a given symbol
 */
public static KindName kindName(Symbol sym){
switch (sym.getKind()) {
case PACKAGE:
    return KindName.PACKAGE;
case ENUM:
case ANNOTATION_TYPE:
case INTERFACE:
case CLASS:
  return KindName.CLASS;
case TYPE_PARAMETER:
return KindName.TYPEVAR;
case ENUM_CONSTANT:
case FIELD:
case PARAMETER:
case LOCAL_VARIABLE:
case EXCEPTION_PARAMETER:
return KindName.VAR;
case METHOD:
case CONSTRUCTOR:
case STATIC_INIT:
case INSTANCE_INIT:
return KindName.METHOD;
default :
if (sym.kind == VAL) return KindName.VAL;
 else throw new AssertionError("String_Node_Str" + sym.getKind());
}
}

Fixed version (ground truth):
/** 
 * A KindName representing a given symbol
 */
public static KindName kindName(Symbol sym){
switch (sym.getKind()) {
case PACKAGE:
    return KindName.PACKAGE;
case ENUM:
  return KindName.ENUM;
case ANNOTATION_TYPE:
case CLASS:
return KindName.CLASS;
case INTERFACE:
return KindName.INTERFACE;
case TYPE_PARAMETER:
return KindName.TYPEVAR;
case ENUM_CONSTANT:
case FIELD:
case PARAMETER:
case LOCAL_VARIABLE:
case EXCEPTION_PARAMETER:
return KindName.VAR;
case CONSTRUCTOR:
return KindName.CONSTRUCTOR;
case METHOD:
case STATIC_INIT:
case INSTANCE_INIT:
return KindName.METHOD;
default :
if (sym.kind == VAL) return KindName.VAL;
 else throw new AssertionError("String_Node_Str" + sym.getKind());
}
}
Program: 72210
Project: 72210
Buggy source:
/** 
 * The number of errors reported so far.
 */
public int errorCount(){
  if (delegateCompiler != null && delegateCompiler != this)   return delegateCompiler.errorCount();
 else   return log.nerrors;
}

Fixed version (ground truth):
/** 
 * The number of errors reported so far.
 */
public int errorCount(){
  if (delegateCompiler != null && delegateCompiler != this)   return delegateCompiler.errorCount();
 else {
    if (werror && log.nerrors == 0 && log.nwarnings > 0) {
      log.error("String_Node_Str");
    }
  }
  return log.nerrors;
}
Program: 72214
Project: 72214
Buggy source:
/** 
 * Initializes an APRep object.
 * @param encoding a single DER-encoded value.
 * @exception Asn1Exception if an error occurs while decoding an ASN1 encoded data.
 * @exception IOException if an I/O error occurs while reading encoded data.
 * @exception KrbApErrException if the value read from the DER-encoded datastream does not match the pre-defined value.
 */
private void init(DerValue encoding) throws Asn1Exception, KrbApErrException, IOException {
  if (((encoding.getTag() & (byte)(0x1F)) != Krb5.KRB_AP_REP) || (encoding.isApplication() != true) || (encoding.isConstructed() != true))   throw new Asn1Exception(Krb5.ASN1_BAD_ID);
  DerValue der=encoding.getData().getDerValue();
  if (der.getTag() != DerValue.tag_Sequence)   throw new Asn1Exception(Krb5.ASN1_BAD_ID);
  DerValue subDer=der.getData().getDerValue();
  if ((subDer.getTag() & (byte)0x1F) != (byte)0x00)   throw new Asn1Exception(Krb5.ASN1_BAD_ID);
  pvno=subDer.getData().getBigInteger().intValue();
  if (pvno != Krb5.PVNO)   throw new KrbApErrException(Krb5.KRB_AP_ERR_BADVERSION);
  subDer=der.getData().getDerValue();
  if ((subDer.getTag() & (byte)0x1F) != (byte)0x01)   throw new Asn1Exception(Krb5.ASN1_BAD_ID);
  msgType=subDer.getData().getBigInteger().intValue();
  if (msgType != Krb5.KRB_AP_REP)   throw new KrbApErrException(Krb5.KRB_AP_ERR_MSG_TYPE);
  encPart=EncryptedData.parse(der.getData(),(byte)0x02,false);
  if (der.getData().available() > 0)   throw new Asn1Exception(Krb5.ASN1_BAD_ID);
}

Fixed version (ground truth):
/** 
 * Initializes an APRep object.
 * @param encoding a single DER-encoded value.
 * @exception Asn1Exception if an error occurs while decoding an ASN1 encoded data.
 * @exception IOException if an I/O error occurs while reading encoded data.
 * @exception KrbApErrException if the value read from the DER-encoded datastream does not match the pre-defined value.
 */
private void init(DerValue encoding) throws Asn1Exception, KrbApErrException, IOException {
  if (((encoding.getTag() & (byte)(0x1F)) != Krb5.KRB_AP_REP) || (encoding.isApplication() != true) || (encoding.isConstructed() != true)) {
    throw new Asn1Exception(Krb5.ASN1_BAD_ID);
  }
  DerValue der=encoding.getData().getDerValue();
  if (der.getTag() != DerValue.tag_Sequence) {
    throw new Asn1Exception(Krb5.ASN1_BAD_ID);
  }
  DerValue subDer=der.getData().getDerValue();
  if ((subDer.getTag() & (byte)0x1F) != (byte)0x00) {
    throw new Asn1Exception(Krb5.ASN1_BAD_ID);
  }
  pvno=subDer.getData().getBigInteger().intValue();
  if (pvno != Krb5.PVNO) {
    throw new KrbApErrException(Krb5.KRB_AP_ERR_BADVERSION);
  }
  subDer=der.getData().getDerValue();
  if ((subDer.getTag() & (byte)0x1F) != (byte)0x01) {
    throw new Asn1Exception(Krb5.ASN1_BAD_ID);
  }
  msgType=subDer.getData().getBigInteger().intValue();
  if (msgType != Krb5.KRB_AP_REP) {
    throw new KrbApErrException(Krb5.KRB_AP_ERR_MSG_TYPE);
  }
  encPart=EncryptedData.parse(der.getData(),(byte)0x02,false);
  if (der.getData().available() > 0) {
    throw new Asn1Exception(Krb5.ASN1_BAD_ID);
  }
}
Program: 72215
Project: 72215
Buggy source:
private void startWatchThread(){
  if (watch != null) {
    final String name="String_Node_Str" + id();
    watchThread=new Thread(new Runnable(){
      @Override public void run(){
        while (true) {
          try {
            StoreWatchKey key=(StoreWatchKey)watch.poll(6,TimeUnit.SECONDS);
            if (key == null)             continue;
            Object attachment=key.getAttachment();
            List<WatchEvent<?>> events=key.pollEvents();
            if (events != null) {
              for (              WatchEvent<?> event : events) {
                if (attachment != null && attachment instanceof EventHandler) {
                  ((EventHandler)attachment).handle(key,event);
                }
              }
            }
            key.reset();
          }
 catch (          ClosedWatchServiceException e) {
            LOG.warn(e.getMessage(),e);
            break;
          }
catch (          InterruptedException e) {
            LOG.warn(e.getMessage(),e);
            break;
          }
catch (          Exception e) {
            LOG.error(e.getMessage(),e);
          }
        }
        LOG.info("String_Node_Str",name);
      }
    }
,name);
    watchThread.setDaemon(true);
    watchThread.start();
    LOG.info("String_Node_Str",watchThread.getName());
  }
}

Fixed version (ground truth):
private void startWatchThread(){
  if (watch != null) {
    final String name="String_Node_Str" + id();
    watchThread=new Thread(new Runnable(){
      @Override public void run(){
        while (true) {
          try {
            StoreWatchKey key=(StoreWatchKey)watch.poll(6,TimeUnit.SECONDS);
            if (key == null)             continue;
            Object attachment=key.getAttachment();
            List<WatchEvent<?>> events=key.pollEvents();
            if (events != null) {
              for (              WatchEvent<?> event : events) {
                if (attachment != null && attachment instanceof EventHandler) {
                  ((EventHandler)attachment).handle(key,event);
                }
              }
            }
            key.reset();
          }
 catch (          ClosedWatchServiceException e) {
            LOG.warn(e.getMessage(),e);
            break;
          }
catch (          InterruptedException e) {
            break;
          }
catch (          Exception e) {
            LOG.error(e.getMessage(),e);
          }
        }
        watchLatch.countDown();
        LOG.info("String_Node_Str",name);
      }
    }
,name);
    watchThread.setDaemon(true);
    watchThread.start();
    LOG.info("String_Node_Str",watchThread.getName());
  }
}
Program: 72216
Project: 72216
Buggy source:
@Override public void run(){
  while (true) {
    try {
      StoreWatchKey key=(StoreWatchKey)watch.poll(6,TimeUnit.SECONDS);
      if (key == null)       continue;
      Object attachment=key.getAttachment();
      List<WatchEvent<?>> events=key.pollEvents();
      if (events != null) {
        for (        WatchEvent<?> event : events) {
          if (attachment != null && attachment instanceof EventHandler) {
            ((EventHandler)attachment).handle(key,event);
          }
        }
      }
      key.reset();
    }
 catch (    ClosedWatchServiceException e) {
      LOG.warn(e.getMessage(),e);
      break;
    }
catch (    InterruptedException e) {
      LOG.warn(e.getMessage(),e);
      break;
    }
catch (    Exception e) {
      LOG.error(e.getMessage(),e);
    }
  }
  LOG.info("String_Node_Str",name);
}

Fixed version (ground truth):
@Override public void run(){
  while (true) {
    try {
      StoreWatchKey key=(StoreWatchKey)watch.poll(6,TimeUnit.SECONDS);
      if (key == null)       continue;
      Object attachment=key.getAttachment();
      List<WatchEvent<?>> events=key.pollEvents();
      if (events != null) {
        for (        WatchEvent<?> event : events) {
          if (attachment != null && attachment instanceof EventHandler) {
            ((EventHandler)attachment).handle(key,event);
          }
        }
      }
      key.reset();
    }
 catch (    ClosedWatchServiceException e) {
      LOG.warn(e.getMessage(),e);
      break;
    }
catch (    InterruptedException e) {
      break;
    }
catch (    Exception e) {
      LOG.error(e.getMessage(),e);
    }
  }
  watchLatch.countDown();
  LOG.info("String_Node_Str",name);
}
Program: 72217
Project: 72217
Buggy source:
@Override public void close() throws IOException {
  if (dimit != null)   dimit.close();
  if (watch != null) {
    watch.close();
    watchThread.interrupt();
  }
  if (storeSystem != null)   storeSystem.close();
}

Fixed version (ground truth):
@Override public void close() throws IOException {
  if (dimit != null)   dimit.close();
  if (watch != null) {
    watch.close();
    watchThread.interrupt();
    try {
      watchLatch.await(10,TimeUnit.MICROSECONDS);
    }
 catch (    InterruptedException e) {
    }
  }
  if (storeSystem != null)   storeSystem.close();
}
Program: 72218
Project: 72218
Buggy source:
public void updateLimiter(){
  if (limiter == null) {
    limiter=RateLimiter.create(channel.getTps());
  }
 else {
    limiter.setRate(channel.getTps());
  }
}

Fixed version (ground truth):
public void updateLimiter(){
  if (limiter == null) {
    limiter=RateLimiter.create(channel.tps());
  }
 else {
    limiter.setRate(channel.tps());
  }
}
Program: 72219
Project: 72219
Buggy source:
public void setChannel(ChannelWrapper<V> channel){
  this.channel=channel;
  updateLimiter();
}

Fixed version (ground truth):
public void setChannel(ChannelWrapper<V> channel){
  this.channel=channel;
}
Program: 72220
Project: 72220
Buggy source:
public static final ChannelGroupWrapper init(Dimiter dimiter,String cid) throws IOException {
  DimitStoreSystem dss=dimiter.getStoreSystem();
  DimitPath dimitPath=dss.getPath(StoreConst.PATH_CONF,dimiter.getDimit().conf().getId());
  ChannelGroupWrapper group=new ChannelGroupWrapper(dimiter);
  group.conf=dimitPath.newPath(cid).<ChannelGroupConf>toStore();
  if (group.conf == null)   return null;
  long ct=System.currentTimeMillis();
  ChannelGroup store=ChannelGroup.newBuilder().setId(IDUtil.storeID(MagicFlag.CHANNEL_GROUP)).setCid(cid).setCt(ct).setMt(ct).setV(Const.V).build();
  group.store=store;
  return group;
}

Fixed version (ground truth):
public static final ChannelGroupWrapper init(Dimiter dimiter,String cid) throws IOException {
  DimitStoreSystem dss=dimiter.getStoreSystem();
  DimitPath dimitPath=dss.getPath(StoreConst.PATH_CONF,dimiter.getDimit().conf().getId());
  ChannelGroupWrapper group=new ChannelGroupWrapper(dimiter);
  group.conf=dimitPath.newPath(cid).<ChannelGroupConf>toStore(ChannelGroupConf.class);
  if (group.conf == null)   return null;
  long ct=System.currentTimeMillis();
  ChannelGroup store=ChannelGroup.newBuilder().setId(IDUtil.storeID(MagicFlag.CHANNEL_GROUP)).setCid(cid).setCt(ct).setMt(ct).setV(Const.V).build();
  group.store=store;
  return group;
}
Program: 72221
Project: 72221
Buggy source:
/** 
 * @param gid ChannelGroupConf's id
 * @param cid ChannelConf's id
 * @throws IOException
 */
public <T>void newChannel(String cid,ChannelType type,ChannelCallable<T> callable) throws IOException {
  ChannelWrapper<T> channel=ChannelWrapper.<T>init(dimiter,this.conf().getId(),cid,type,callable);
  if (channel == null)   throw new IOException("String_Node_Str" + cid);
  channel().add(channel);
}

Fixed version (ground truth):
/** 
 * @param gid ChannelGroupConf's id
 * @param cid ChannelConf's id
 * @return
 * @throws IOException
 */
public <T>ChannelWrapper<T> newChannel(String cid,ChannelType type,ChannelCallable<T> callable) throws IOException {
  ChannelWrapper<T> channel=ChannelWrapper.<T>init(dimiter,conf().getId(),cid,type,callable);
  if (channel == null)   throw new IOException("String_Node_Str" + cid);
  channel().add(channel);
  return channel;
}
Program: 72222
Project: 72222
Buggy source:
public static <T>ChannelWrapper<T> init(Dimiter dimiter,String gid,String cid,ChannelType type,ChannelCallable<T> callable) throws IOException {
  DimitStoreSystem dss=dimiter.getStoreSystem();
  DimitPath groupPath=dss.getPath(StoreConst.PATH_CONF,dimiter.getDimit().conf().getId(),gid);
  ChannelWrapper<T> channel=new ChannelWrapper<T>(dimiter,callable);
  channel.conf=groupPath.newPath(cid).<ChannelConf>toStore();
  if (channel.conf == null)   return null;
  DimitPath channelPath=dss.getPath(StoreConst.PATH_STORE,channel.conf.getId(),String.valueOf(type.getNumber()),channel.store.getId());
  List<DimitPath> children=channelPath.getParent().children();
  int childrenSize=children.size() + 1;
  long ct=System.currentTimeMillis();
  float tps=channel.conf.getTps();
  Channel store=Channel.newBuilder().setId(IDUtil.storeID(MagicFlag.CHANNEL)).setCid(cid).setCt(ct).setMt(ct).setTps(tps / childrenSize).setType(type).setV(Const.V).build();
  channel.store=store;
  channelPath=dss.<Channel>io().write(channelPath,store,StoreAttribute.EPHEMERAL);
  LOG.info("String_Node_Str",channelPath);
  if (type == ChannelType.SEND) {
    WatchKey key=channelPath.getParent().register(dimiter.watch(),new Kind<?>[]{StoreEventKind.CHILDREN},channel);
    channel.addWatchKey(key);
    key=groupPath.newPath(cid).register(dimiter.watch(),new Kind<?>[]{StoreEventKind.UPDATE},channel);
    channel.addWatchKey(key);
  }
  return channel;
}

Fixed version (ground truth):
public static <T>ChannelWrapper<T> init(Dimiter dimiter,String gid,String cid,ChannelType type,ChannelCallable<T> callable) throws IOException {
  DimitStoreSystem dss=dimiter.getStoreSystem();
  DimitPath groupPath=dss.getPath(StoreConst.PATH_CONF,dimiter.getDimit().conf().getId(),gid);
  ChannelWrapper<T> channel=new ChannelWrapper<T>(dimiter,callable);
  channel.conf=groupPath.newPath(cid).<ChannelConf>toStore(ChannelConf.class);
  if (channel.conf == null)   return null;
  DimitPath channelParentPath=dss.getPath(StoreConst.PATH_STORE,channel.conf.getId(),String.valueOf(type.getNumber()));
  List<DimitPath> children=channelParentPath.children();
  int childrenSize=children.size() + 1;
  long ct=System.currentTimeMillis();
  float tps=channel.conf.getTps();
  Channel store=Channel.newBuilder().setId(IDUtil.storeID(MagicFlag.CHANNEL)).setCid(cid).setCt(ct).setMt(ct).setTps(tps / childrenSize).setType(type).setV(Const.V).build();
  channel.store=store;
  DimitPath channelPath=channelParentPath.newPath(store.getId());
  channelPath=dss.<Channel>io().write(channelPath,store,StoreAttribute.EPHEMERAL);
  LOG.info("String_Node_Str",channelPath);
  if (type == ChannelType.SEND) {
    WatchKey key=channelPath.getParent().register(dimiter.watch(),new Kind<?>[]{StoreEventKind.CHILDREN},channel);
    channel.addWatchKey(key);
    key=groupPath.newPath(cid).register(dimiter.watch(),new Kind<?>[]{StoreEventKind.UPDATE},channel);
    channel.addWatchKey(key);
  }
  callable.updateLimiter();
  return channel;
}
Program: 72223
Project: 72223
Buggy source:
public boolean isValid(){
  return priority() >= 1;
}

Fixed version (ground truth):
public boolean isValid(){
  if (conf.getStatus().equals(ChannelStatus.CLOSED) || conf.getStatus().equals(ChannelStatus.INVALID))   return false;
  return tps() >= 1 && priority() >= 1;
}
Program: 72224
Project: 72224
Buggy source:
private ChannelConf newChannelConf(Dimiter dimiter,String gid,String cid) throws IOException {
  DimitStoreSystem dss=dimiter.getStoreSystem();
  DimitPath groupPath=dss.getPath(StoreConst.PATH_CONF,dimiter.getDimit().conf().getId(),gid);
  return groupPath.newPath(cid).<ChannelConf>toStore();
}

Fixed version (ground truth):
private ChannelConf newChannelConf(Dimiter dimiter,String gid,String cid) throws IOException {
  DimitStoreSystem dss=dimiter.getStoreSystem();
  DimitPath groupPath=dss.getPath(StoreConst.PATH_CONF,dimiter.getDimit().conf().getId(),gid);
  return groupPath.newPath(cid).<ChannelConf>toStore(ChannelConf.class);
}
Program: 72225
Project: 72225
Buggy source:
public int priority(){
  return (int)store.getTps();
}

Fixed version (ground truth):
public int priority(){
  return conf.getPriority();
}
Program: 72226
Project: 72226
Buggy source:
public static DimitWrapper init(Dimiter dimiter,String cid) throws IOException {
  DimitStoreSystem dss=dimiter.getStoreSystem();
  DimitPath pathConf=dss.getPath(StoreConst.PATH_CONF);
  DimitWrapper dimit=new DimitWrapper(dimiter);
  dimit.conf=pathConf.newPath(cid).<DimitConf>toStore();
  if (dimit.conf == null)   return null;
  long ct=System.currentTimeMillis();
  String[] pidHost=DimiterUtil.pidAndHost();
  Dimit store=Dimit.newBuilder().setId(IDUtil.storeID(MagicFlag.DIMIT)).setCid(cid).setCt(ct).setMt(ct).setHost(pidHost[1]).setIpv4("String_Node_Str").setIpv6("String_Node_Str").setName(dimit.conf.getName()).setPid(pidHost[0]).setRole(DimitRole.PARTNER).setV(Const.V).setStatus(DimitStatus.ONLINE).build();
  dimit.store=store;
  DimitPath dimitPath=dss.getPath(StoreConst.PATH_STORE,dimit.conf.getId(),dimit.store.getId());
  dimitPath=dss.<Dimit>io().write(dimitPath,store,StoreAttribute.EPHEMERAL);
  LOG.info("String_Node_Str",dimitPath);
  return dimit;
}

Fixed version (ground truth):
public static DimitWrapper init(Dimiter dimiter,String cid) throws IOException {
  DimitStoreSystem dss=dimiter.getStoreSystem();
  DimitPath pathConf=dss.getPath(StoreConst.PATH_CONF);
  DimitWrapper dimit=new DimitWrapper(dimiter);
  dimit.conf=pathConf.newPath(cid).<DimitConf>toStore(DimitConf.class);
  if (dimit.conf == null)   return null;
  long ct=System.currentTimeMillis();
  String[] pidHost=DimiterUtil.pidAndHost();
  Dimit store=Dimit.newBuilder().setId(IDUtil.storeID(MagicFlag.DIMIT)).setCid(cid).setCt(ct).setMt(ct).setHost(pidHost[1]).setIpv4("String_Node_Str").setIpv6("String_Node_Str").setName(dimit.conf.getName()).setPid(pidHost[0]).setRole(DimitRole.PARTNER).setV(Const.V).setStatus(DimitStatus.ONLINE).build();
  dimit.store=store;
  DimitPath dimitPath=dss.getPath(StoreConst.PATH_STORE,dimit.conf.getId(),dimit.store.getId());
  dimitPath=dss.<Dimit>io().write(dimitPath,store,StoreAttribute.EPHEMERAL);
  LOG.info("String_Node_Str",dimitPath);
  return dimit;
}
Program: 72227
Project: 72227
Buggy source:
/** 
 * @param cid ChannelGroupConf's id
 */
public void newChannelGroup(String cid) throws IOException {
  ChannelGroupWrapper group=ChannelGroupWrapper.init(this.dimiter,cid);
  if (group == null) {
    throw new IOException("String_Node_Str" + cid);
  }
  group().add(group);
}

Fixed version (ground truth):
/** 
 * @param cid ChannelGroupConf's id
 * @return
 */
public ChannelGroupWrapper newChannelGroup(String cid) throws IOException {
  ChannelGroupWrapper group=ChannelGroupWrapper.init(this.dimiter,cid);
  if (group == null) {
    throw new IOException("String_Node_Str" + cid);
  }
  group().add(group);
  return group;
}
Program: 72228
Project: 72228
Buggy source:
@Override public int compare(ChannelWrapper<?> o1,ChannelWrapper<?> o2){
  return o1.priority() - o2.priority();
}

Fixed version (ground truth):
@Override public int compare(ChannelWrapper<?> o1,ChannelWrapper<?> o2){
  int p=o1.priority() - o2.priority();
  if (p == 0) {
    p=(int)(o1.tps() - o2.tps());
  }
  return p == 0 ? o1.id().compareTo(o2.id()) : p;
}
Program: 72231
Project: 72231
Buggy source:
private void moveAccount(){
  for (int i=0; i < playerNum; i++) {
    if (allPlayers[i].moveDirection == -1)     continue;
    if (decisionChoices[i] == GambleChecker.MOVE) {
      allPlayers[i].preLoc=MapChecker.tryMove(map,allPlayers[i].preLoc,allPlayers[i].moveDirection,allPlayers[i].energyConsume);
    }
    locationList[i]=allPlayers[i].preLoc;
  }
}

Fixed version (ground truth):
private void moveAccount(){
  for (int i=0; i < playerNum; i++) {
    if (allPlayers[i].moveDirection == -1)     continue;
    if (decisionChoices[i] == GambleChecker.MOVE) {
      allPlayers[i].preLoc=MapChecker.tryMove(map,allPlayers[i].preLoc,allPlayers[i].moveDirection,allPlayers[i].energyConsume);
    }
  }
  for (int i=0; i < playerNum; i++)   locationList[i]=allPlayers[i].preLoc;
}
Program: 72232
Project: 72232
Buggy source:
private void fireAccount(){
  if (accountNum == 0) {
    for (int i=0; i < playerNum; i++) {
      if (allPlayers[i].stratDecision == GambleChecker.FIRE) {
        if (allPlayers[i].fireTarget == -1)         break;
        PlayerChecker.fire(map,allPlayers[i],allPlayers[allPlayers[i].fireTarget]);
      }
      healthPointList[i]=allPlayers[i].healthPoint;
    }
  }
  accountNum+=1;
}

Fixed version (ground truth):
private void fireAccount(){
  if (accountNum == 0) {
    for (int i=0; i < playerNum; i++) {
      if (allPlayers[i].fireTarget == -1)       continue;
      if (allPlayers[i].stratDecision == GambleChecker.FIRE) {
        PlayerChecker.fire(map,allPlayers[i],allPlayers[allPlayers[i].fireTarget]);
      }
    }
    for (int i=0; i < playerNum; i++)     healthPointList[i]=allPlayers[i].healthPoint;
  }
  accountNum+=1;
}
Program: 72234
Project: 72234
Buggy source:
private void waitAllPlayers(int playerIndex){
synchronized (this) {
    wait_count+=1;
    if (wait_count < playerNum) {
      while (wait_count < playerNum) {
        try {
          this.wait();
        }
 catch (        Exception ex) {
          ex.printStackTrace();
        }
      }
    }
 else {
      playerState[playerIndex]=0;
      seen_card_count=0;
      gamble_count=0;
      desert_count=0;
      for (int i=0; i < playerNum; i++) {
        allPlayers[i].stratDecision=GambleChecker.DEPOSIT;
        allPlayers[i].fireTarget=-1;
        allPlayers[i].moveDirection=-1;
        availableFireTarget[i]=-1;
        availableMoveDirection[i]=-1;
        decisionChoices[i]=GambleChecker.DEPOSIT;
        seenCardChoices[i]=0;
        gambleChoices[i]=GambleChecker.PAPER;
        cardNumList[i]=0;
        playerWinList[i]=0;
        fireList[i]=-1;
      }
      this.notifyAll();
    }
  }
}

Fixed version (ground truth):
private void waitAllPlayers(int playerIndex){
synchronized (this) {
    playerState[playerIndex]=0;
    wait_count+=1;
    if (wait_count < playerNum) {
      while (wait_count < playerNum) {
        try {
          this.wait();
        }
 catch (        Exception ex) {
          ex.printStackTrace();
        }
      }
    }
 else {
      phaseState=PhaseState.PREPARE;
      seen_card_count=0;
      gamble_count=0;
      desert_count=0;
      for (int i=0; i < playerNum; i++) {
        allPlayers[i].stratDecision=GambleChecker.DEPOSIT;
        allPlayers[i].fireTarget=-1;
        allPlayers[i].moveDirection=-1;
        availableFireTarget[i]=-1;
        availableMoveDirection[i]=-1;
        decisionChoices[i]=GambleChecker.DEPOSIT;
        seenCardChoices[i]=0;
        gambleChoices[i]=GambleChecker.PAPER;
        cardNumList[i]=0;
        playerWinList[i]=0;
        fireList[i]=-1;
      }
      this.notifyAll();
    }
  }
}
Program: 72235
Project: 72235
Buggy source:
private void moveAccount(){
  if (accountNum == 0) {
    for (int i=0; i < playerNum; i++) {
      if (decisionChoices[i] == GambleChecker.MOVE) {
        if (allPlayers[i].moveDirection == -1)         break;
        allPlayers[i].preLoc=MapChecker.tryMove(map,allPlayers[i].preLoc,allPlayers[i].moveDirection,allPlayers[i].energyConsume);
      }
      locationList[i]=allPlayers[i].preLoc;
    }
  }
  accountNum+=1;
}

Fixed version (ground truth):
private void moveAccount(){
  if (accountNum == 0) {
    for (int i=0; i < playerNum; i++) {
      if (allPlayers[i].moveDirection == -1)       continue;
      if (decisionChoices[i] == GambleChecker.MOVE) {
        allPlayers[i].preLoc=MapChecker.tryMove(map,allPlayers[i].preLoc,allPlayers[i].moveDirection,allPlayers[i].energyConsume);
      }
      locationList[i]=allPlayers[i].preLoc;
    }
  }
  accountNum+=1;
}
Program: 72237
Project: 72237
Buggy source:
private void fireAccount(){
  for (int i=0; i < playerNum; i++) {
    if (allPlayers[i].stratDecision == GambleChecker.FIRE) {
      if (allPlayers[i].fireTarget == -1)       break;
      PlayerChecker.fire(map,allPlayers[i],allPlayers[allPlayers[i].fireTarget]);
    }
    healthPointList[i]=allPlayers[i].healthPoint;
  }
}

Fixed version (ground truth):
private void fireAccount(){
  if (accountNum == 0) {
    for (int i=0; i < playerNum; i++) {
      if (allPlayers[i].stratDecision == GambleChecker.FIRE) {
        if (allPlayers[i].fireTarget == -1)         break;
        PlayerChecker.fire(map,allPlayers[i],allPlayers[allPlayers[i].fireTarget]);
      }
      healthPointList[i]=allPlayers[i].healthPoint;
    }
  }
  accountNum+=1;
}
Program: 72238
Project: 72238
Buggy source:
private void depositAccount(){
  for (int i=0; i < playerNum; i++) {
    PlayerChecker.energyConsume(allPlayers[i],allPlayers[i].energyConsume);
    if (allPlayers[i].isWin)     PlayerChecker.energyAcq(allPlayers[i],allPlayers[i].gambleNum);
    energyList[i]=allPlayers[i].energy;
  }
}

Fixed version (ground truth):
private void depositAccount(){
  if (accountNum == 0) {
    for (int i=0; i < playerNum; i++) {
      PlayerChecker.energyConsume(allPlayers[i],allPlayers[i].energyConsume);
      if (allPlayers[i].isWin)       PlayerChecker.energyAcq(allPlayers[i],allPlayers[i].gambleNum);
      energyList[i]=allPlayers[i].energy;
    }
  }
  accountNum+=1;
}
Program: 72239
Project: 72239
Buggy source:
private void moveAccount(){
  for (int i=0; i < playerNum; i++) {
    if (decisionChoices[i] == GambleChecker.MOVE) {
      if (allPlayers[i].moveDirection == -1)       break;
      allPlayers[i].preLoc=MapChecker.tryMove(map,allPlayers[i].preLoc,allPlayers[i].moveDirection,allPlayers[i].energyConsume);
    }
    locationList[i]=allPlayers[i].preLoc;
  }
}

Fixed version (ground truth):
private void moveAccount(){
  if (accountNum == 0) {
    for (int i=0; i < playerNum; i++) {
      if (decisionChoices[i] == GambleChecker.MOVE) {
        if (allPlayers[i].moveDirection == -1)         break;
        allPlayers[i].preLoc=MapChecker.tryMove(map,allPlayers[i].preLoc,allPlayers[i].moveDirection,allPlayers[i].energyConsume);
      }
      locationList[i]=allPlayers[i].preLoc;
    }
  }
  accountNum+=1;
}