nus-yam/ex-repair huggingface dataset:
Program: 77702
Project: 77702
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: 77703
Project: 77703
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: 77704
Project: 77704
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: 77705
Project: 77705
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: 77706
Project: 77706
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: 77707
Project: 77707
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: 77710
Project: 77710
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: 77711
Project: 77711
Buggy source:
public void clear(){
  ht=null;
  kt=null;
}

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

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

Fixed version (ground truth):
public ClassReader make(Context c){
  return new JavadocClassReader(c);
}
Program: 77714
Project: 77714
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: 77715
Project: 77715
Buggy source:
public Enter make(){
  return new JavadocEnter(context);
}

Fixed version (ground truth):
public Enter make(Context c){
  return new JavadocEnter(c);
}
Program: 77716
Project: 77716
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: 77717
Project: 77717
Buggy source:
public MemberEnter make(){
  return new JavadocMemberEnter(context);
}

Fixed version (ground truth):
public MemberEnter make(Context c){
  return new JavadocMemberEnter(c);
}
Program: 77718
Project: 77718
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: 77719
Project: 77719
Buggy source:
public Todo make(){
  return new JavadocTodo(context);
}

Fixed version (ground truth):
public Todo make(Context c){
  return new JavadocTodo(c);
}
Program: 77720
Project: 77720
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: 77721
Project: 77721
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: 77722
Project: 77722
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: 77723
Project: 77723
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: 77724
Project: 77724
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: 77725
Project: 77725
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: 77726
Project: 77726
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: 77727
Project: 77727
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: 77728
Project: 77728
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: 77729
Project: 77729
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: 77730
Project: 77730
Buggy source:
@Override public void write(int b) throws IOException {
  size++;
}

Fixed version (ground truth):
@Override public void write(int b){
  size++;
}
Program: 77731
Project: 77731
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: 77732
Project: 77732
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: 77733
Project: 77733
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: 77736
Project: 77736
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: 77737
Project: 77737
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: 77738
Project: 77738
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: 77739
Project: 77739
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: 77740
Project: 77740
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: 77744
Project: 77744
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: 77746
Project: 77746
Buggy source:
@Override public Camera getCameraIfExists(Camera camera) throws PersistenceException {
  try (PreparedStatement stmt=con.prepareStatement(READ_CAMERA_WITH_MODEL_STATEMENT)){
    stmt.setString(1,camera.getModel());
    try (ResultSet rs=stmt.executeQuery()){
      if (rs.next()) {
        Camera storedCamera=readCameraFromResultSet(rs);
        LOGGER.trace("String_Node_Str",storedCamera);
        return storedCamera;
      }
 else {
        LOGGER.trace("String_Node_Str",camera.getModel());
        return null;
      }
    }
   }
 catch (  SQLException e) {
    throw new PersistenceException(e.getMessage());
  }
}

Fixed version (ground truth):
@Override public Camera getCameraIfExists(Camera camera) throws PersistenceException {
  try (PreparedStatement stmt=con.prepareStatement(READ_CAMERA_WITH_MODEL_STATEMENT)){
    stmt.setString(1,camera.getModel());
    try (ResultSet rs=stmt.executeQuery()){
      if (rs.next()) {
        Camera storedCamera=readCameraFromResultSet(rs);
        LOGGER.trace("String_Node_Str",storedCamera);
        return storedCamera;
      }
 else {
        LOGGER.trace("String_Node_Str",camera.getModel());
        return null;
      }
    }
   }
 catch (  SQLException e) {
    throw new PersistenceException(e);
  }
}
Program: 77747
Project: 77747
Buggy source:
@Override public void setAllInactive() throws PersistenceException {
  try (PreparedStatement stmt=con.prepareStatement(SET_ALL_INACTIVE_STATEMENT)){
    stmt.execute();
    LOGGER.trace("String_Node_Str");
  }
 catch (  SQLException e) {
    throw new PersistenceException(e.getMessage());
  }
}

Fixed version (ground truth):
@Override public void setAllInactive() throws PersistenceException {
  try (PreparedStatement stmt=con.prepareStatement(SET_ALL_INACTIVE_STATEMENT)){
    stmt.setBoolean(1,false);
    stmt.execute();
    LOGGER.trace("String_Node_Str");
  }
 catch (  SQLException e) {
    throw new PersistenceException(e);
  }
}
Program: 77748
Project: 77748
Buggy source:
@FXML public void shotFrameClicked(){
  Screen screen=getScreenOfWindow();
  Rectangle2D bounds=screen.getVisualBounds();
  primaryStage.setX(bounds.getMinX());
  primaryStage.setY(bounds.getMinY());
  primaryStage.setWidth(bounds.getWidth());
  primaryStage.setHeight(bounds.getHeight());
  StackPane root=(StackPane)primaryStage.getScene().getRoot();
  Node child=root.getChildren().get(0);
  ImageView iv;
  if (child instanceof ImageView) {
    iv=(ImageView)child;
  }
 else {
    iv=(ImageView)root.getChildren().get(1);
  }
  iv.setFitHeight(bounds.getHeight());
  iv.setFitWidth(bounds.getWidth());
  primaryStage.setFullScreen(true);
}

Fixed version (ground truth):
@FXML public void shotFrameClicked(){
  Screen screen=getScreenOfWindow();
  Rectangle2D visualBounds=screen.getVisualBounds();
  Rectangle2D fullBounds=screen.getBounds();
  primaryStage.setX(visualBounds.getMinX());
  primaryStage.setY(visualBounds.getMinY());
  primaryStage.setWidth(visualBounds.getWidth());
  primaryStage.setHeight(visualBounds.getHeight());
  StackPane root=(StackPane)primaryStage.getScene().getRoot();
  Node child=root.getChildren().get(0);
  ImageView iv;
  if (child instanceof ImageView) {
    iv=(ImageView)child;
  }
 else {
    iv=(ImageView)root.getChildren().get(1);
  }
  iv.setFitHeight(fullBounds.getHeight());
  iv.setFitWidth(fullBounds.getWidth());
  primaryStage.setFullScreen(true);
}
Program: 77749
Project: 77749
Buggy source:
private BufferedImage saveUnfilterdImageAndApplyFilter(String originalImgPath) throws ServiceException {
  BufferedImage shot;
  boolean logosEnabled=!profileService.getAllPairLogoRelativeRectangle().isEmpty();
  shot=openImageThrowException(originalImgPath);
  shot=mirrorImage(shot);
  if (logosEnabled) {
    logoWatermarkService.addLogosToImage(shot);
    saveImageThrowException(shot,originalImgPath);
    LOGGER.debug("String_Node_Str",originalImgPath);
  }
  String filterName=pairCameraPosition.getFilterName();
  shot=filterService.filter(filterName,originalImgPath);
  LOGGER.debug("String_Node_Str",filterName,position);
  return shot;
}

Fixed version (ground truth):
private BufferedImage saveUnfilterdImageAndApplyFilter(String originalImgPath) throws ServiceException {
  BufferedImage shot;
  boolean logosEnabled=!profileService.getAllPairLogoRelativeRectangle().isEmpty();
  shot=openImageThrowException(originalImgPath);
  shot=mirrorImage(shot);
  if (logosEnabled) {
    logoWatermarkService.addLogosToImage(shot);
    saveImageThrowException(shot,originalImgPath);
    LOGGER.debug("String_Node_Str",originalImgPath);
  }
  String filterName=pairCameraPosition.getFilterName();
  shot=filterService.filter(filterName,originalImgPath);
  LOGGER.debug("String_Node_Str",filterName,position);
  if (logosEnabled) {
    logoWatermarkService.addLogosToImage(shot);
  }
  return shot;
}
Program: 77750
Project: 77750
Buggy source:
private BufferedImage saveUnfilterdImageAndApplyFilter(String originalImgPath) throws ServiceException {
  BufferedImage shot;
  boolean logosEnabled=profileService.getAllPairLogoRelativeRectangle().isEmpty();
  shot=openImageThrowException(originalImgPath);
  shot=mirrorImage(shot);
  if (logosEnabled) {
    logoWatermarkService.addLogosToImage(shot);
    saveImageThrowException(shot,originalImgPath);
    LOGGER.debug("String_Node_Str");
  }
  String filterName=pairCameraPosition.getFilterName();
  shot=filterService.filter(filterName,originalImgPath);
  LOGGER.debug("String_Node_Str",filterName,position);
  return shot;
}

Fixed version (ground truth):
private BufferedImage saveUnfilterdImageAndApplyFilter(String originalImgPath) throws ServiceException {
  BufferedImage shot;
  boolean logosEnabled=!profileService.getAllPairLogoRelativeRectangle().isEmpty();
  shot=openImageThrowException(originalImgPath);
  shot=mirrorImage(shot);
  if (logosEnabled) {
    logoWatermarkService.addLogosToImage(shot);
    saveImageThrowException(shot,originalImgPath);
    LOGGER.debug("String_Node_Str",originalImgPath);
  }
  String filterName=pairCameraPosition.getFilterName();
  shot=filterService.filter(filterName,originalImgPath);
  LOGGER.debug("String_Node_Str",filterName,position);
  return shot;
}
Program: 77751
Project: 77751
Buggy source:
/** 
 * Saves image in images folder and in database. Also tells the Shot monitor to refresh the image.
 * @throws CameraException if something goes wrong during the detecting of the cameras
 */
List<Camera> getCameras() throws CameraException ;

Fixed version (ground truth):
/** 
 * Detects all connected cameras and stores all new ones.
 * @throws CameraException if something goes wrong during the detecting of the cameras
 * @throws ServiceException If an error during querying cameras or storing cameras in the service occurs
 */
List<Camera> getCameras() throws CameraException, ServiceException ;
Program: 77752
Project: 77752
Buggy source:
/** 
 * Removes a camera that is connected but cannot be assigned to a position from the list.
 * @param camera the camera that shall be removed.
 */
void removeCameraFromList(Camera camera);

Fixed version (ground truth):
/** 
 * Removes a simcam that is connected but cannot be assigned to a position from the list.
 * @param camera the simcam that shall be removed.
 */
void removeCameraFromList(Camera camera);
Program: 77753
Project: 77753
Buggy source:
/** 
 * Sets the countdown flag in the CameraThread
 * @param camera camera that shall be configured
 * @param countdown number of seconds a countdown should be displayed
 */
void setCountdown(Camera camera,int countdown);

Fixed version (ground truth):
/** 
 * Sets the countdown flag in the CameraThread
 * @param camera simcam that shall be configured
 * @param countdown number of seconds a countdown should be displayed
 */
void setCountdown(Camera camera,int countdown);
Program: 77754
Project: 77754
Buggy source:
/** 
 * Sets the captureImage flag in the CameraThread
 * @param camera camera that shall capture a image
 */
void captureImage(Camera camera);

Fixed version (ground truth):
/** 
 * Sets the captureImage flag in the CameraThread
 * @param camera simcam that shall capture a image
 */
void captureImage(Camera camera);
Program: 77755
Project: 77755
Buggy source:
/** 
 * Sets the serieShot flag in the CameraThread
 * @param camera camera that shall be configured
 * @param serieShot whether multiple shots should be taken or not
 */
void setSerieShot(Camera camera,boolean serieShot);

Fixed version (ground truth):
/** 
 * Sets the serieShot flag in the CameraThread
 * @param camera simcam that shall be configured
 * @param serieShot whether multiple shots should be taken or not
 */
void setSerieShot(Camera camera,boolean serieShot);
Program: 77757
Project: 77757
Buggy source:
@Override public List<Camera> getCameras() throws CameraException {
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
@Override public List<Camera> getCameras(){
  return simulatedCameraList;
}
Program: 77758
Project: 77758
Buggy source:
@Override public void closeCameras(){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
@Override public void closeCameras(){
}
Program: 77759
Project: 77759
Buggy source:
public SimCameraHandler(){
  simulatedCameraList=new ArrayList<>();
  simulatedCameraList.add(new Camera(-1,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public SimCameraHandler(ApplicationContext applicationContext,CameraService cameraService) throws ServiceException {
  this.applicationContext=applicationContext;
  Camera newCamera=new Camera(-1,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  Camera storedCamera=cameraService.cameraExists(newCamera);
  if (storedCamera == null)   storedCamera=cameraService.createCamera(newCamera);
  cameraService.setCameraActive(storedCamera.getId());
  simulatedCameraList.add(storedCamera);
}
Program: 77760
Project: 77760
Buggy source:
@Override public void setCountdown(Camera camera,int countdown){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
@Override public void setCountdown(Camera camera,int countdown){
  for (  SimCameraThread cameraThread : simulatedCameraThreadList) {
    if (cameraThread.getCamera().getId() == camera.getId()) {
      cameraThread.setCountdown(countdown);
    }
  }
}
Program: 77761
Project: 77761
Buggy source:
@Override public List<CameraThread> createThreads(List<Camera> cameraList) throws CameraException {
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
@Override public List<CameraThread> createThreads(List<Camera> cameraList){
  List<CameraThread> cameraThreadList=new ArrayList<>();
  for (  Camera camera : simulatedCameraList) {
    SimCameraThread cameraThread=applicationContext.getBean(SimCameraThread.class);
    cameraThread.setCamera(camera);
    cameraThreadList.add(cameraThread);
    simulatedCameraThreadList.add(cameraThread);
  }
  return cameraThreadList;
}
Program: 77762
Project: 77762
Buggy source:
@Override public void captureImage(Camera camera){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
@Override public void captureImage(Camera camera){
  for (  SimCameraThread cameraThread : simulatedCameraThreadList) {
    if (cameraThread.getCamera().getId() == camera.getId()) {
      cameraThread.setTakeImage(true);
    }
  }
}
Program: 77763
Project: 77763
Buggy source:
@Override public void setSerieShot(Camera camera,boolean serieShot){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
@Override public void setSerieShot(Camera camera,boolean serieShot){
  for (  SimCameraThread cameraThread : simulatedCameraThreadList) {
    if (cameraThread.getCamera().getId() == camera.getId()) {
      cameraThread.setSerieShot(true);
    }
  }
}
Program: 77764
Project: 77764
Buggy source:
/** 
 * Saves the file from the camera to the local file system.
 * @param filename OS-dependent path on the local file system.
 */
public void save(String filename){
  CameraUtils.check(GPhoto2Native.INSTANCE.gp_file_save(cf,filename),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Saves the file from the simcam to the local file system.
 * @param filename OS-dependent path on the local file system.
 */
public void save(String filename){
  CameraUtils.check(GPhoto2Native.INSTANCE.gp_file_save(cf,filename),"String_Node_Str");
}
Program: 77765
Project: 77765
Buggy source:
/** 
 * Returns a referenced camera file.
 * @param cam the camera handle.
 * @return camera file.
 */
CameraFile newFile(Pointer cam){
  boolean returnedOk=false;
  final CameraFile cf=new CameraFile();
  try {
    CameraUtils.check(GPhoto2Native.INSTANCE.gp_camera_file_get(cam,path,filename,GPhoto2Native.GP_FILE_TYPE_NORMAL,cf.cf,CameraList.CONTEXT),"String_Node_Str");
    returnedOk=true;
    return cf;
  }
  finally {
    if (!returnedOk) {
      CameraUtils.closeQuietly(cf);
    }
  }
}

Fixed version (ground truth):
/** 
 * Returns a referenced simcam file.
 * @param cam the simcam handle.
 * @return simcam file.
 */
CameraFile newFile(Pointer cam){
  boolean returnedOk=false;
  final CameraFile cf=new CameraFile();
  try {
    CameraUtils.check(GPhoto2Native.INSTANCE.gp_camera_file_get(cam,path,filename,GPhoto2Native.GP_FILE_TYPE_NORMAL,cf.cf,CameraList.CONTEXT),"String_Node_Str");
    returnedOk=true;
    return cf;
  }
  finally {
    if (!returnedOk) {
      CameraUtils.closeQuietly(cf);
    }
  }
}
Program: 77766
Project: 77766
Buggy source:
/** 
 * Creates a new file link. The file is not yet linked to any particular camera file - the link is performed later on, by invoking gphoto functions.
 */
CameraFile(){
  final PointerByReference p=new PointerByReference();
  CameraUtils.check(GPhoto2Native.INSTANCE.gp_file_new(p),"String_Node_Str");
  cf=p.getValue();
}

Fixed version (ground truth):
/** 
 * Creates a new file link. The file is not yet linked to any particular simcam file - the link is performed later on, by invoking gphoto functions.
 */
CameraFile(){
  final PointerByReference p=new PointerByReference();
  CameraUtils.check(GPhoto2Native.INSTANCE.gp_file_new(p),"String_Node_Str");
  cf=p.getValue();
}
Program: 77767
Project: 77767
Buggy source:
/** 
 * Creates a reference to the first connected camera.
 */
public CameraGphoto(){
  final PointerByReference ref=new PointerByReference();
  CameraUtils.check(GPhoto2Native.INSTANCE.gp_camera_new(ref),"String_Node_Str");
  camera=ref.getValue();
}

Fixed version (ground truth):
/** 
 * Creates a reference to the first connected simcam.
 */
public CameraGphoto(){
  final PointerByReference ref=new PointerByReference();
  CameraUtils.check(GPhoto2Native.INSTANCE.gp_camera_new(ref),"String_Node_Str");
  camera=ref.getValue();
}
Program: 77768
Project: 77768
Buggy source:
/** 
 * Captures a quick preview image on the camera.
 * @return camera file, never null. Must be closed afterwards.
 */
public CameraFile capturePreview(){
  checkNotClosed();
  boolean returnedOk=false;
  final CameraFile cfile=new CameraFile();
  try {
    CameraUtils.check(GPhoto2Native.INSTANCE.gp_camera_capture_preview(camera,cfile.cf,CameraList.CONTEXT),"String_Node_Str");
    returnedOk=true;
    return cfile;
  }
  finally {
    if (!returnedOk) {
      CameraUtils.closeQuietly(cfile);
    }
  }
}

Fixed version (ground truth):
/** 
 * Captures a quick preview image on the simcam.
 * @return simcam file, never null. Must be closed afterwards.
 */
public CameraFile capturePreview(){
  checkNotClosed();
  boolean returnedOk=false;
  final CameraFile cfile=new CameraFile();
  try {
    CameraUtils.check(GPhoto2Native.INSTANCE.gp_camera_capture_preview(camera,cfile.cf,CameraList.CONTEXT),"String_Node_Str");
    returnedOk=true;
    return cfile;
  }
  finally {
    if (!returnedOk) {
      CameraUtils.closeQuietly(cfile);
    }
  }
}
Program: 77769
Project: 77769
Buggy source:
/** 
 * Captures a full-quality image image on the camera.
 * @return camera file, never null. Must be closed afterwards.
 */
public CameraFile captureImage(){
  checkNotClosed();
  final CameraFilePath path=new CameraFilePath.ByReference();
  CameraUtils.check(GPhoto2Native.INSTANCE.gp_camera_capture(camera,GPhoto2Native.GP_CAPTURE_IMAGE,path,CameraList.CONTEXT),"String_Node_Str");
  final CameraFile.Path p=new CameraFile.Path(path);
  return p.newFile(camera);
}

Fixed version (ground truth):
/** 
 * Captures a full-quality image image on the simcam.
 * @return simcam file, never null. Must be closed afterwards.
 */
public CameraFile captureImage(){
  checkNotClosed();
  final CameraFilePath path=new CameraFilePath.ByReference();
  CameraUtils.check(GPhoto2Native.INSTANCE.gp_camera_capture(camera,GPhoto2Native.GP_CAPTURE_IMAGE,path,CameraList.CONTEXT),"String_Node_Str");
  final CameraFile.Path p=new CameraFile.Path(path);
  return p.newFile(camera);
}
Program: 77770
Project: 77770
Buggy source:
/** 
 * Initializes the camera.
 */
public void initialize(){
  checkNotClosed();
  if (!isInitialized) {
    CameraUtils.check(GPhoto2Native.INSTANCE.gp_camera_init(camera,CameraList.CONTEXT),"String_Node_Str");
    isInitialized=true;
  }
}

Fixed version (ground truth):
/** 
 * Initializes the simcam.
 */
public void initialize(){
  checkNotClosed();
  if (!isInitialized) {
    CameraUtils.check(GPhoto2Native.INSTANCE.gp_camera_init(camera,CameraList.CONTEXT),"String_Node_Str");
    isInitialized=true;
  }
}
Program: 77771
Project: 77771
Buggy source:
/** 
 * De-initializes the camera.
 */
public void deinitialize() throws IOException {
  checkNotClosed();
  if (isInitialized) {
    isInitialized=false;
    CameraUtils.check(GPhoto2Native.INSTANCE.gp_camera_exit(camera,CameraList.CONTEXT),"String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * De-initializes the simcam.
 */
public void deinitialize() throws IOException {
  checkNotClosed();
  if (isInitialized) {
    isInitialized=false;
    CameraUtils.check(GPhoto2Native.INSTANCE.gp_camera_exit(camera,CameraList.CONTEXT),"String_Node_Str");
  }
}
Program: 77772
Project: 77772
Buggy source:
/** 
 * De-initializes the camera and frees all resources. Further invocations to this method do nothing. Any camera method will fail from now on with   {@link java.lang.IllegalStateException}.
 */
public void close() throws IOException {
  if (!closed) {
    deinitialize();
    closed=true;
    CameraUtils.check(GPhoto2Native.INSTANCE.gp_camera_free(camera),"String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * De-initializes the simcam and frees all resources. Further invocations to this method do nothing. Any simcam method will fail from now on with   {@link java.lang.IllegalStateException}.
 */
public void close() throws IOException {
  if (!closed) {
    deinitialize();
    closed=true;
    CameraUtils.check(GPhoto2Native.INSTANCE.gp_camera_free(camera),"String_Node_Str");
  }
}
Program: 77773
Project: 77773
Buggy source:
/** 
 * Returns new configuration for the camera.e
 * @return the configuration, never null. Must be closed afterwards.
 */
public CameraWidgets newConfiguration(){
  checkNotClosed();
  return new CameraWidgets(this);
}

Fixed version (ground truth):
/** 
 * Returns new configuration for the simcam.e
 * @return the configuration, never null. Must be closed afterwards.
 */
public CameraWidgets newConfiguration(){
  checkNotClosed();
  return new CameraWidgets(this);
}
Program: 77774
Project: 77774
Buggy source:
@Override public boolean equals(Object object){
  if (object instanceof Camera && ((Camera)object).getId() == this.getId() && ((Camera)object).getLable() == this.getLable() && ((Camera)object).getPort() == this.getPort() && ((Camera)object).getModel() == this.getModel() && ((Camera)object).getSerialnumber() == this.getSerialnumber()) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean equals(Object object){
  if (object instanceof Camera && ((Camera)object).getId() == this.getId() && ((Camera)object).getPort() == this.getPort() && ((Camera)object).getModel() == this.getModel() && ((Camera)object).getSerialnumber() == this.getSerialnumber()) {
    return true;
  }
 else {
    return false;
  }
}
Program: 77775
Project: 77775
Buggy source:
public void setSerieShot(boolean serieShot){
  this.serieShot=serieShot;
}

Fixed version (ground truth):
public void setSerieShot(boolean serieShot){
  this.serieShot=serieShot;
  this.countdown=0;
}
Program: 77776
Project: 77776
Buggy source:
public void setCountdown(int countdown){
  this.countdown=countdown;
}

Fixed version (ground truth):
public void setCountdown(int countdown){
  this.countdown=countdown;
  this.serieShot=false;
}
Program: 77778
Project: 77778
Buggy source:
public void notifyOfNewImage(at.ac.tuwien.sepm.ws16.qse01.entities.Image image,int index){
  if (index == -1)   listOfImages.add(image);
 else   listOfImages.add(index,image);
  prepareHBox(image,index);
}

Fixed version (ground truth):
public void notifyOfNewImage(at.ac.tuwien.sepm.ws16.qse01.entities.Image image,int index){
  if (index == -1) {
    listOfImages.add(image);
    newImages.offer(image);
  }
 else {
    listOfImages.add(index,image);
    prepareHBox(image,index);
  }
}
Program: 77779
Project: 77779
Buggy source:
/** 
 * Notifies the ShotFrameManager and the MiniatureFrameController of a newly shot image.
 * @param image the Image-Object representing the new image.
 */
public synchronized void refreshFrames(Image image){
  miniaturFrameController.notifyOfNewImage(image,-1);
}

Fixed version (ground truth):
/** 
 * Notifies the MiniatureFrameController of a newly shot image.
 * @param image the Image-Object representing the new image.
 */
public synchronized void refreshFrames(Image image){
  miniaturFrameController.notifyOfNewImage(image,-1);
}
Program: 77780
Project: 77780
Buggy source:
@Override public void handle(ActionEvent event){
  startTimeSec[0]--;
  if (startTimeSec[0] == 0) {
    timeline.stop();
    countdownLabel.setVisible(false);
  }
  countdownLabel.setText(String.valueOf(startTimeSec[0]));
}

Fixed version (ground truth):
@Override public void handle(ActionEvent event){
  startTimeSec[0]--;
  if (startTimeSec[0] == 0) {
    timeline.stop();
    countdownLabel.setVisible(false);
  }
 else {
    countdownLabel.setText(String.valueOf(startTimeSec[0]));
    countdownLabel.setVisible(true);
  }
}
Program: 77781
Project: 77781
Buggy source:
public void showCountdown(int countdown){
  countdownLabel.setText(String.valueOf(countdown));
  countdownLabel.setVisible(true);
  double screenWidth=Screen.getPrimary().getBounds().getWidth();
  double screenHeight=Screen.getPrimary().getBounds().getHeight() - 100;
  countdownLabel.setPrefHeight(screenHeight / 2);
  int paddingBottom=-((Double)(screenHeight / 2)).intValue();
  countdownLabel.setPadding(new Insets(0,0,paddingBottom,0));
  createCounter(countdown).play();
}

Fixed version (ground truth):
public void showCountdown(int countdown){
  double screenWidth=Screen.getPrimary().getBounds().getWidth();
  double screenHeight=Screen.getPrimary().getBounds().getHeight() - 100;
  countdownLabel.setPrefHeight(screenHeight / 2);
  int paddingBottom=-((Double)(screenHeight / 2)).intValue();
  countdownLabel.setPadding(new Insets(0,0,paddingBottom,0));
  createCounter(countdown).play();
}
Program: 77782
Project: 77782
Buggy source:
public Timeline createCounter(int countdown){
  Timeline timeline=new Timeline();
  startTimeSec[0]=countdown;
  KeyFrame keyframe=new KeyFrame(Duration.seconds(1),new EventHandler<ActionEvent>(){
    @Override public void handle(    ActionEvent event){
      startTimeSec[0]--;
      if (startTimeSec[0] == 0) {
        timeline.stop();
        countdownLabel.setVisible(false);
      }
      countdownLabel.setText(String.valueOf(startTimeSec[0]));
    }
  }
);
  timeline.setCycleCount(Timeline.INDEFINITE);
  timeline.getKeyFrames().add(keyframe);
  return timeline;
}

Fixed version (ground truth):
public Timeline createCounter(int countdown){
  Timeline timeline=new Timeline();
  startTimeSec[0]=countdown;
  KeyFrame keyframe=new KeyFrame(Duration.seconds(1),new EventHandler<ActionEvent>(){
    @Override public void handle(    ActionEvent event){
      startTimeSec[0]--;
      if (startTimeSec[0] == 0) {
        timeline.stop();
        countdownLabel.setVisible(false);
      }
 else {
        countdownLabel.setText(String.valueOf(startTimeSec[0]));
        countdownLabel.setVisible(true);
      }
    }
  }
);
  timeline.setCycleCount(Timeline.INDEFINITE);
  timeline.getKeyFrames().add(keyframe);
  return timeline;
}