nus-yam/ex-repair huggingface dataset:
Program: 46842
Project: 46842
Buggy source:
/** 
 * creates class instance
 * @param cl
 * @return
 * @throws InstantiationException
 * @throws IllegalAccessException
 * @throws InvocationTargetException
 */
@SuppressWarnings("String_Node_Str") private static <T>T inst(final Class<T> cl){
  Constructor<?> con;
  try {
    con=cl.getDeclaredConstructor();
  }
 catch (  final NoSuchMethodException e) {
    throw new IllegalStateException("String_Node_Str" + cl.getName() + "String_Node_Str");
  }
  if (!Modifier.isPublic(con.getModifiers()))   con.setAccessible(true);
  Exception e=null;
  try {
    return (T)con.newInstance();
  }
 catch (  final IllegalArgumentException e1) {
    e=e1;
  }
catch (  final IllegalAccessException e2) {
    e=e2;
  }
catch (  final SecurityException e7) {
    e=e7;
  }
catch (  final InvocationTargetException e8) {
    e=e8;
  }
catch (  final InstantiationException e9) {
    e=e9;
  }
  throw new IllegalStateException("String_Node_Str",e);
}

Fixed version (ground truth):
/** 
 * creates class instance
 * @param cl
 * @return
 * @throws InstantiationException
 * @throws IllegalAccessException
 * @throws InvocationTargetException
 */
@SuppressWarnings("String_Node_Str") private static <T>T inst(final Class<T> cl){
  Constructor<?> con;
  try {
    con=cl.getDeclaredConstructor();
  }
 catch (  final NoSuchMethodException e) {
    throw new IllegalStateException("String_Node_Str" + cl.getName() + "String_Node_Str"+ cl.isArray()+ "String_Node_Str");
  }
  if (!Modifier.isPublic(con.getModifiers()))   con.setAccessible(true);
  Exception e=null;
  try {
    return (T)con.newInstance();
  }
 catch (  final IllegalArgumentException e1) {
    e=e1;
  }
catch (  final IllegalAccessException e2) {
    e=e2;
  }
catch (  final SecurityException e7) {
    e=e7;
  }
catch (  final InvocationTargetException e8) {
    e=e8;
  }
catch (  final InstantiationException e9) {
    e=e9;
  }
  throw new IllegalStateException("String_Node_Str",e);
}
Program: 46843
Project: 46843
Buggy source:
@Override public synchronized boolean add(final E elem){
  if (set.put(elem,elem) == null)   return super.add(elem);
  return true;
}

Fixed version (ground truth):
@Override public synchronized boolean add(final E elem){
  if (set.put(elem,elem) == null) {
    final boolean added=super.add(elem);
    if (!added)     set.remove(elem);
    return added;
  }
  return true;
}
Program: 46844
Project: 46844
Buggy source:
public int size(){
  return set.size();
}

Fixed version (ground truth):
@Override public int size(){
  return set.size();
}
Program: 46845
Project: 46845
Buggy source:
/** 
 * constructs the class index
 * @param classes
 */
public SerializationContext(final Class<?>[]... classes){
  final byte defCount=defaulTypes();
  if (defCount + classes.length > 254)   throw new IllegalArgumentException("String_Node_Str");
  byte idx=defCount;
  for (  final Class<?>[] clSet : classes)   for (  final Class<?> cl : clSet) {
    if (cl.isInstance(Serializable.class))     throw new IllegalArgumentException("String_Node_Str" + cl + "String_Node_Str");
    addClass(cl,idx++);
  }
}

Fixed version (ground truth):
/** 
 * constructs the class index
 * @param classes
 */
public SerializationContext(final Class<?>[]... classes){
  final byte defCount=defaulTypes();
  if (defCount + classes.length > 254)   throw new IllegalArgumentException("String_Node_Str");
  short idx=defCount;
  for (  final Class<?>[] clSet : classes)   for (  final Class<?> cl : clSet) {
    if (cl.isInstance(Serializable.class))     throw new IllegalArgumentException("String_Node_Str" + cl + "String_Node_Str");
    addClass(cl,idx++);
  }
}
Program: 46846
Project: 46846
Buggy source:
/** 
 * encapsulated with check
 * @param clazz
 * @return
 */
private byte getClassEid(final Class<?> clazz){
  final Byte res=classesToIdx.get(clazz);
  if (res == null)   throw new IllegalArgumentException("String_Node_Str" + clazz.getTypeName() + "String_Node_Str");
  return res;
}

Fixed version (ground truth):
/** 
 * encapsulated with check
 * @param clazz
 * @return
 */
private byte getClassEid(final Class<?> clazz){
  final Short res=classesToIdx.get(clazz);
  if (res == null)   throw new IllegalArgumentException("String_Node_Str" + clazz.getTypeName() + "String_Node_Str");
  return res.byteValue();
}
Program: 46848
Project: 46848
Buggy source:
/** 
 * @return intern id to class mapping
 */
public Map<Byte,Class<?>> getClassMap(){
  return idxToClasses;
}

Fixed version (ground truth):
/** 
 * @return intern id to class mapping
 */
public Map<Short,Class<?>> getClassMap(){
  return idxToClasses;
}
Program: 46849
Project: 46849
Buggy source:
/** 
 * method for directly setting a mapping
 * @param eid
 * @param clazz
 */
public void setClass(final byte eid,final Class<?> clazz){
  addClass(clazz,eid);
}

Fixed version (ground truth):
/** 
 * method for directly setting a mapping
 * @param eid
 * @param clazz
 */
public void setClass(final short eid,final Class<?> clazz){
  addClass(clazz,eid);
}
Program: 46850
Project: 46850
Buggy source:
/** 
 * directly add an mapping
 * @param clazz
 * @param eid
 * @return
 */
private byte addClass(final Class<?> clazz,final byte eid){
  classesToIdx.put(clazz,eid);
  idxToClasses.put(eid,clazz);
  return eid;
}

Fixed version (ground truth):
/** 
 * directly add an mapping
 * @param clazz
 * @param eid
 * @return
 */
private void addClass(final Class<?> clazz,final short eid){
  classesToIdx.put(clazz,eid);
  idxToClasses.put(eid,clazz);
}
Program: 46851
Project: 46851
Buggy source:
@Override public void flush() throws IOException {
  super.flush();
  final String[] logMessages=this.toString().split("String_Node_Str");
  for (  final String message : logMessages)   LoggerFactory.getLogger(currentCallerName).info(message.trim());
}

Fixed version (ground truth):
@Override public void flush() throws IOException {
  super.flush();
  final String[] logMessages=this.toString().split("String_Node_Str");
  for (  final String message : logMessages) {
    final String msg=message.trim();
    if (msg.length() > 0)     LoggerFactory.getLogger(currentCallerName).info(msg);
  }
  reset();
}
Program: 46852
Project: 46852
Buggy source:
public boolean isEmpty(){
  return size() > 0;
}

Fixed version (ground truth):
public boolean isEmpty(){
  return size() == 0;
}
Program: 46853
Project: 46853
Buggy source:
public ByteArrayInputStream(){
  super(new byte[0]);
}

Fixed version (ground truth):
public ByteArrayInputStream(final byte[] buf,final int offset,final int length){
  super(buf);
  pos=offset;
  count=Math.min(offset + length,buf.length);
  mark=offset;
}
Program: 46854
Project: 46854
Buggy source:
/** 
 * convenience method for finding and removing the index
 * @param elem
 * @return
 */
public E remove(final E elem){
  final int index=indexOf(elem);
  if (index != -1)   return removeIndex(index);
  return null;
}

Fixed version (ground truth):
@Override public void remove(){
  removeIndex(itIdx);
}
Program: 46855
Project: 46855
Buggy source:
/** 
 * use array as convenience frontent for an array
 * @param elementData
 */
@SafeVarargs public Array(final E... elementData){
  this.elements=elementData;
  maxIdx=elementData.length - 1;
}

Fixed version (ground truth):
/** 
 * use array as convenience frontent for an array
 * @param elementData
 */
public Array(final E... elementData){
  this.elements=elementData;
  maxIdx=elementData.length - 1;
}
Program: 46856
Project: 46856
Buggy source:
@Override public int compare(final ITask t1,final ITask t2){
  return Long.compare(t1.nextRun(),t2.nextRun());
}

Fixed version (ground truth):
@Override public int compare(final ITask t1,final ITask t2){
  return Primitive.compare(t1.nextRun(),t2.nextRun());
}
Program: 46857
Project: 46857
Buggy source:
/** 
 * encapsulated with check
 * @param clazz
 * @return
 */
private byte getClassEid(final Class<?> clazz){
  final Short res=classesToIdx.get(clazz);
  if (res == null)   throw new IllegalArgumentException("String_Node_Str" + clazz.getTypeName() + "String_Node_Str");
  return res.byteValue();
}

Fixed version (ground truth):
/** 
 * encapsulated with check
 * @param clazz
 * @return
 */
private byte getClassEid(final Class<?> clazz){
  final Short res=classesToIdx.get(clazz);
  if (res == null)   throw new IllegalArgumentException("String_Node_Str" + clazz.getName() + "String_Node_Str");
  return res.byteValue();
}
Program: 46858
Project: 46858
Buggy source:
@Override public int compare(final Field arg0,final Field arg1){
  return Integer.compare(arg0.getName().hashCode(),arg1.getName().hashCode());
}

Fixed version (ground truth):
@Override public int compare(final Field arg0,final Field arg1){
  return Primitive.compare(arg0.getName().hashCode(),arg1.getName().hashCode());
}
Program: 46860
Project: 46860
Buggy source:
/** 
 * encapsulated with check
 * @param clazz
 * @return
 */
private byte getClassEid(final Class<?> clazz){
  final Byte res=classesToIdx.get(clazz);
  if (res == null) {
    LOG.error("String_Node_Str" + clazz.getTypeName() + "String_Node_Str");
    return -1;
  }
  return res;
}

Fixed version (ground truth):
/** 
 * encapsulated with check
 * @param clazz
 * @return
 */
private byte getClassEid(final Class<?> clazz){
  final Byte res=classesToIdx.get(clazz);
  if (res == null)   throw new IllegalArgumentException("String_Node_Str" + clazz.getTypeName() + "String_Node_Str");
  return res;
}
Program: 46862
Project: 46862
Buggy source:
public UnserializableException(final Object target){
  addTarget(target);
}

Fixed version (ground truth):
public UnserializableException(final Object target,final String message){
  addTarget(target);
}
Program: 46863
Project: 46863
Buggy source:
@Override public boolean add(final E elem){
  final boolean res=super.add(elem);
  if (res)   try {
    lock.lock();
    added.signal();
  }
  finally {
    lock.unlock();
  }
  return res;
}

Fixed version (ground truth):
@Override public boolean add(final E elem){
  boolean res=false;
  try {
    lock.lock();
    res=super.add(elem);
    if (res)     added.signal();
  }
  finally {
    lock.unlock();
  }
  return res;
}
Program: 46864
Project: 46864
Buggy source:
public E take(final long waitMillis){
  try {
    lock.lockInterruptibly();
    if (waitMillis < 0)     added.await();
 else     added.await(waitMillis,TimeUnit.MILLISECONDS);
    return take();
  }
 catch (  final InterruptedException e) {
    LOG.error(e.getMessage(),e);
  }
 finally {
    lock.unlock();
  }
  return null;
}

Fixed version (ground truth):
public E take(final long waitMillis){
  try {
    lock.lockInterruptibly();
    E elem=take();
    if (elem == null) {
      if (waitMillis < 0)       added.await();
 else       added.await(waitMillis,TimeUnit.MILLISECONDS);
      elem=take();
    }
    return elem;
  }
 catch (  final InterruptedException e) {
    LOG.error(e.getMessage(),e);
  }
 finally {
    lock.unlock();
  }
  return null;
}
Program: 46865
Project: 46865
Buggy source:
@Override public void run(){
  final long wish=lastUpdate.get();
  final long now=System.currentTimeMillis();
  lastStart=now;
  runnable.run();
  if (lastUpdate.compareAndSet(wish,0))   return;
 else {
    if (interval > 0)     nextRun=now + interval;
    runnable.schedule(this);
  }
}

Fixed version (ground truth):
@Override public void run(){
  final long wish=lastUpdate.get();
  final long now=System.currentTimeMillis();
  lastStart=now;
  if (LOG.isTraceEnabled())   LOG.trace("String_Node_Str" + interval + "String_Node_Str"+ this+ "String_Node_Str");
  runnable.run();
  if (lastUpdate.compareAndSet(wish,0)) {
    if (LOG.isTraceEnabled())     LOG.trace("String_Node_Str" + interval + "String_Node_Str"+ this+ "String_Node_Str");
    return;
  }
 else {
    if (interval > 0)     nextRun=now + interval;
    if (LOG.isTraceEnabled())     LOG.trace("String_Node_Str" + interval + "String_Node_Str"+ this+ "String_Node_Str");
    runnable.schedule(this);
  }
}
Program: 46866
Project: 46866
Buggy source:
@Override public void schedule(final ITask capsule){
  if (capsule.nextRun() <= 0)   capsule.run();
 else   InterThreads.this.tque.add(capsule);
}

Fixed version (ground truth):
@Override public void schedule(final ITask capsule){
  if (capsule.nextRun() <= 0) {
    if (LOG.isTraceEnabled())     LOG.trace("String_Node_Str" + this + "String_Node_Str");
    capsule.run();
  }
 else {
    if (LOG.isTraceEnabled())     LOG.trace("String_Node_Str" + this + "String_Node_Str");
    InterThreads.this.tque.add(capsule);
  }
}
Program: 46867
Project: 46867
Buggy source:
@Override public void run(){
  InterThreads.this.put(thread,run);
}

Fixed version (ground truth):
@Override public void run(){
  if (LOG.isTraceEnabled())   LOG.trace("String_Node_Str" + this + "String_Node_Str");
  InterThreads.this.put(thread,run);
}
Program: 46868
Project: 46868
Buggy source:
@Override public boolean equals(final Object object){
  if (object == this)   return true;
  if (!(object instanceof Array))   return false;
  final Array<?> array=(Array<?>)object;
  final int n=maxIdx;
  if (n != array.maxIdx)   return false;
  final Object[] items1=this.elements;
  final Object[] items2=array.elements;
  for (int i=0; i < n; i++) {
    final Object o1=items1[i];
    final Object o2=items2[i];
    if (!(o1 == null ? o2 == null : o1.equals(o2)))     return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(final Object object){
  if (object == this)   return true;
  if (!(object instanceof Array))   return false;
  final Array<?> array=(Array<?>)object;
  final int n=maxIdx;
  if (n != array.maxIdx)   return false;
  final Object[] items1=this.elements;
  final Object[] items2=array.elements;
  for (int i=0; i <= n; i++) {
    final Object o1=items1[i];
    final Object o2=items2[i];
    if (!(o1 == null ? o2 == null : o1.equals(o2)))     return false;
  }
  return true;
}
Program: 46869
Project: 46869
Buggy source:
public E take(final long waitMillis){
  try {
    lock.lockInterruptibly();
    added.await(waitMillis,TimeUnit.MILLISECONDS);
    return take();
  }
 catch (  final InterruptedException e) {
    LOG.error(e.getMessage(),e);
  }
 finally {
    lock.unlock();
  }
  return null;
}

Fixed version (ground truth):
public E take(final long waitMillis){
  try {
    lock.lockInterruptibly();
    if (waitMillis < 0)     added.await();
 else     added.await(waitMillis,TimeUnit.MILLISECONDS);
    return take();
  }
 catch (  final InterruptedException e) {
    LOG.error(e.getMessage(),e);
  }
 finally {
    lock.unlock();
  }
  return null;
}
Program: 46870
Project: 46870
Buggy source:
private void calcNextRun(){
  if (nextRun == 0)   nextRun=System.currentTimeMillis();
  nextRun+=intervallMs;
}

Fixed version (ground truth):
private void calcNextRun(){
  final long now=System.currentTimeMillis();
  if (nextRun == 0)   nextRun=now;
  nextRun+=((now - nextRun) / intervallMs + 1) * intervallMs;
}
Program: 46871
Project: 46871
Buggy source:
/** 
 * adds an task for scheduling
 * @param t
 */
public void add(final ITask t){
  System.out.println("String_Node_Str" + t + "String_Node_Str");
  queue.add(t);
  if (queue.peek() == t)   monitor.release();
}

Fixed version (ground truth):
/** 
 * adds an task for scheduling
 * @param t
 */
public void add(final ITask t){
  if (LOG.isTraceEnabled())   LOG.trace("String_Node_Str" + t + "String_Node_Str");
  queue.add(t);
  if (queue.peek() == t)   monitor.release();
}
Program: 46872
Project: 46872
Buggy source:
/** 
 * check and try to run the next task
 * @param nt
 * @return null on success or the new queue head
 */
private void timedOut(final ITask nt){
  final ITask t=tq.queue.poll();
  run(t);
  if (t.isRecurring()) {
    System.out.println("String_Node_Str" + t + "String_Node_Str");
    tq.add(t);
  }
}

Fixed version (ground truth):
/** 
 * check and try to run the next task
 * @param nt
 * @return null on success or the new queue head
 */
private void timedOut(final ITask nt){
  final ITask t=tq.queue.poll();
  run(t);
  if (t.isRecurring())   tq.add(t);
}
Program: 46873
Project: 46873
Buggy source:
/** 
 * catches the run
 * @param t
 */
private void run(final ITask t){
  try {
    System.out.println("String_Node_Str" + t + "String_Node_Str");
    t.run();
  }
 catch (  final Exception e) {
    LOG.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * catches the run
 * @param t
 */
private void run(final ITask t){
  try {
    if (LOG.isTraceEnabled())     LOG.trace("String_Node_Str" + t + "String_Node_Str");
    t.run();
  }
 catch (  final Exception e) {
    LOG.error("String_Node_Str",e);
  }
}
Program: 46874
Project: 46874
Buggy source:
@Override public void run(){
  final long now=System.currentTimeMillis();
  lastStart=now;
  runnable.run();
  final long wish=lastUpdate.get();
  if (wish < now && lastUpdate.compareAndSet(wish,0))   return;
 else {
    if (interval > 0)     nextRun=now + interval;
    runnable.schedule(this);
  }
}

Fixed version (ground truth):
@Override public void run(){
  final long wish=lastUpdate.get();
  final long now=System.currentTimeMillis();
  lastStart=now;
  runnable.run();
  if (lastUpdate.compareAndSet(wish,0))   return;
 else {
    if (interval > 0)     nextRun=now + interval;
    runnable.schedule(this);
  }
}
Program: 46875
Project: 46875
Buggy source:
@Override public void schedule(final ITask capsule){
  if (capsule.nextRun() <= 0) {
    System.out.println("String_Node_Str");
    capsule.run();
  }
 else   InterThreads.this.tque.add(capsule);
}

Fixed version (ground truth):
@Override public void schedule(final ITask capsule){
  if (capsule.nextRun() <= 0)   capsule.run();
 else   InterThreads.this.tque.add(capsule);
}
Program: 46876
Project: 46876
Buggy source:
/** 
 * default
 * @param thread
 * @param run
 */
public InterThreadTimeoutable(final E thread,final Runnable run){
  super(thread,run);
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * default
 * @param thread
 * @param run
 */
public InterThreadTimeoutable(final E thread,final Runnable run){
  super(thread,run);
}
Program: 46877
Project: 46877
Buggy source:
/** 
 * nulls all field in the array
 */
public void clear(){
  for (int i=0; i < elements.length; i++) {
    elements[i]=null;
  }
  rewind();
}

Fixed version (ground truth):
/** 
 * nulls all field in the array
 */
public void clear(){
  for (int i=0; i < elements.length; i++) {
    elements[i]=null;
  }
  rewind();
  reset();
}
Program: 46878
Project: 46878
Buggy source:
/** 
 * nulls all fields up to the current maximum element
 */
public void clean(){
  for (int i=0; i <= maxIdx; i++) {
    elements[i]=null;
  }
  rewind();
}

Fixed version (ground truth):
/** 
 * nulls all fields up to the current maximum element
 */
public void clean(){
  for (int i=0; i <= maxIdx; i++) {
    elements[i]=null;
  }
  rewind();
  reset();
}
Program: 46881
Project: 46881
Buggy source:
@Override public void onPlayerInteractEntity(PlayerInteractEntityEvent event){
  event.setCancelled(false);
  Player player=event.getPlayer();
  Entity target=event.getRightClicked();
  if (player.getItemInHand().getType() == Material.BONE && event.getRightClicked() instanceof Wolf) {
    Wolf wolf=(Wolf)target;
    if (!wolf.isTamed() && playerHasTooManyWolves(player)) {
      event.setCancelled(true);
      player.sendMessage(ChatColor.RED + "String_Node_Str" + plugin.maxWolves+ "String_Node_Str");
    }
 else     if (wolf.isTamed() && !wolf.getOwner().equals(player) && wolf.getOwner() instanceof Player) {
      Player owner=(Player)wolf.getOwner();
      player.sendMessage(ChatColor.RED + "String_Node_Str" + owner.getDisplayName());
    }
  }
}

Fixed version (ground truth):
@Override public void onPlayerInteractEntity(PlayerInteractEntityEvent event){
  event.setCancelled(false);
  Player player=event.getPlayer();
  Entity target=event.getRightClicked();
  if (player.getItemInHand().getType() == Material.BONE && event.getRightClicked() instanceof Wolf) {
    Wolf wolf=(Wolf)target;
    if (!wolf.isTamed() && playerHasTooManyWolves(player)) {
      event.setCancelled(true);
      player.sendMessage(ChatColor.RED + "String_Node_Str" + plugin.maxWolves+ "String_Node_Str");
    }
 else     if (wolf.isTamed() && wolf.getOwner() instanceof Player) {
      Player owner=(Player)wolf.getOwner();
      if (!owner.equals(player)) {
        player.sendMessage(ChatColor.RED + "String_Node_Str" + owner.getDisplayName());
      }
    }
  }
}
Program: 46882
Project: 46882
Buggy source:
protected boolean playerHasTooManyWolves(Player player){
  if (plugin.maxWolves == -1)   return false;
  int numWolves=0;
  for (  Entity entity : player.getWorld().getEntities()) {
    if (entity instanceof Wolf) {
      Wolf wolf=(Wolf)entity;
      if (wolf.isTamed() && wolf.getOwner().equals(player)) {
        numWolves++;
      }
    }
  }
  return (numWolves >= plugin.maxWolves);
}

Fixed version (ground truth):
protected boolean playerHasTooManyWolves(Player player){
  if (plugin.maxWolves == -1)   return false;
  int numWolves=0;
  for (  Entity entity : player.getWorld().getEntities()) {
    if (entity instanceof Wolf) {
      Wolf wolf=(Wolf)entity;
      if (wolf.isTamed() && wolf.getOwner() instanceof Player) {
        Player owner=(Player)wolf.getOwner();
        if (owner.equals(player)) {
          numWolves++;
        }
      }
    }
  }
  return (numWolves >= plugin.maxWolves);
}
Program: 46883
Project: 46883
Buggy source:
public static void checkHill(){
  if (drawLeftHill) {
    if (snowing) {
      row5[1]=1;
      row5[2]=1;
      row5[3]=1;
      row5[4]=1;
      row5[5]=1;
      row4[1]=9;
      row4[2]=9;
      row4[3]=9;
      row4[4]=9;
      row4[5]=9;
    }
 else {
      row5[1]=1;
      row5[2]=1;
      row5[3]=1;
      row5[4]=1;
      row5[5]=1;
      row4[1]=7;
      row4[2]=1;
      row4[3]=1;
      row4[4]=1;
      row4[5]=1;
      row3[2]=7;
      row3[3]=1;
      row3[4]=1;
      row3[5]=7;
      row2[3]=7;
      row2[4]=7;
    }
  }
  if (drawRightHill) {
    if (snowing) {
    }
 else {
    }
  }
}

Fixed version (ground truth):
public static void checkHill(){
  if (drawLeftHill) {
    if (snowing) {
      row5[1]=1;
      row5[2]=1;
      row5[3]=1;
      row5[4]=1;
      row5[5]=1;
      row5[1]=1;
      row5[2]=1;
      row5[3]=1;
      row5[4]=1;
      row5[5]=1;
      row4[1]=9;
      row4[2]=1;
      row4[3]=1;
      row4[4]=1;
      row4[5]=1;
      row3[2]=9;
      row3[3]=1;
      row3[4]=1;
      row3[5]=9;
      row2[3]=9;
      row2[4]=9;
    }
 else {
      row5[1]=1;
      row5[2]=1;
      row5[3]=1;
      row5[4]=1;
      row5[5]=1;
      row4[1]=7;
      row4[2]=1;
      row4[3]=1;
      row4[4]=1;
      row4[5]=1;
      row3[2]=7;
      row3[3]=1;
      row3[4]=1;
      row3[5]=7;
      row2[3]=7;
      row2[4]=7;
    }
  }
  if (drawRightHill) {
    if (snowing) {
    }
 else {
    }
  }
}
Program: 46884
Project: 46884
Buggy source:
public static void getSeed(){
  wantSeed=Expo.enterBooleanGUI("String_Node_Str");
  if (wantSeed) {
    seed=Expo.enterIntGUI("String_Node_Str");
    Generate.makeSeeds();
  }
 else {
    terraingen.numClicks=3;
  }
}

Fixed version (ground truth):
public static void getSeed(){
  wantSeed=Expo.enterStringGUI("String_Node_Str");
  if (wantSeed.equals("String_Node_Str")) {
    seed=Expo.enterIntGUI("String_Node_Str");
    Generate.makeSeeds();
  }
 else {
    if (wantSeed.equals("String_Node_Str")) {
      seed=Expo.enterIntGUI("String_Node_Str");
      Generate.makeSeeds();
    }
    if (wantSeed.equals("String_Node_Str")) {
    }
  }
}
Program: 46885
Project: 46885
Buggy source:
static Endpoint read(ByteBuffer bytes){
  Endpoint.Builder result=Endpoint.newBuilder();
  while (true) {
    ThriftField thriftField=ThriftField.read(bytes);
    if (thriftField.type == TYPE_STOP)     break;
    if (thriftField.isEqualTo(IPV4)) {
      int ipv4=bytes.getInt();
      result.parseIp(new byte[]{(byte)(ipv4 >> 24 & 0xff),(byte)(ipv4 >> 16 & 0xff),(byte)(ipv4 >> 8 & 0xff),(byte)(ipv4 & 0xff)});
    }
 else     if (thriftField.isEqualTo(PORT)) {
      result.port(bytes.getShort());
    }
 else     if (thriftField.isEqualTo(SERVICE_NAME)) {
      result.serviceName(ThriftCodec.readUtf8(bytes));
    }
 else     if (thriftField.isEqualTo(IPV6)) {
      result.parseIp(ThriftCodec.readByteArray(bytes));
    }
 else {
      skip(bytes,thriftField.type);
    }
  }
  return result.build();
}

Fixed version (ground truth):
static Endpoint read(ByteBuffer bytes){
  Endpoint.Builder result=Endpoint.newBuilder();
  while (true) {
    ThriftField thriftField=ThriftField.read(bytes);
    if (thriftField.type == TYPE_STOP)     break;
    if (thriftField.isEqualTo(IPV4)) {
      int ipv4=bytes.getInt();
      if (ipv4 != 0) {
        result.parseIp(new byte[]{(byte)(ipv4 >> 24 & 0xff),(byte)(ipv4 >> 16 & 0xff),(byte)(ipv4 >> 8 & 0xff),(byte)(ipv4 & 0xff)});
      }
    }
 else     if (thriftField.isEqualTo(PORT)) {
      result.port(bytes.getShort());
    }
 else     if (thriftField.isEqualTo(SERVICE_NAME)) {
      result.serviceName(ThriftCodec.readUtf8(bytes));
    }
 else     if (thriftField.isEqualTo(IPV6)) {
      result.parseIp(ThriftCodec.readByteArray(bytes));
    }
 else {
      skip(bytes,thriftField.type);
    }
  }
  return result.build();
}
Program: 46886
Project: 46886
Buggy source:
static Endpoint read(ByteBuffer bytes){
  Endpoint.Builder result=Endpoint.newBuilder();
  while (true) {
    ThriftField thriftField=ThriftField.read(bytes);
    if (thriftField.type == TYPE_STOP)     break;
    if (thriftField.isEqualTo(IPV4)) {
      int ipv4=bytes.getInt();
      if (ipv4 != 0) {
        result.parseIp(new byte[]{(byte)(ipv4 >> 24 & 0xff),(byte)(ipv4 >> 16 & 0xff),(byte)(ipv4 >> 8 & 0xff),(byte)(ipv4 & 0xff)});
      }
    }
 else     if (thriftField.isEqualTo(PORT)) {
      result.port(bytes.getShort());
    }
 else     if (thriftField.isEqualTo(SERVICE_NAME)) {
      result.serviceName(ThriftCodec.readUtf8(bytes));
    }
 else     if (thriftField.isEqualTo(IPV6)) {
      result.parseIp(ThriftCodec.readByteArray(bytes));
    }
 else {
      skip(bytes,thriftField.type);
    }
  }
  return result.build();
}

Fixed version (ground truth):
static Endpoint read(ByteBuffer bytes){
  Endpoint.Builder result=Endpoint.newBuilder();
  while (true) {
    ThriftField thriftField=ThriftField.read(bytes);
    if (thriftField.type == TYPE_STOP)     break;
    if (thriftField.isEqualTo(IPV4)) {
      int ipv4=bytes.getInt();
      if (ipv4 != 0) {
        result.parseIp(new byte[]{(byte)(ipv4 >> 24 & 0xff),(byte)(ipv4 >> 16 & 0xff),(byte)(ipv4 >> 8 & 0xff),(byte)(ipv4 & 0xff)});
      }
    }
 else     if (thriftField.isEqualTo(PORT)) {
      result.port(bytes.getShort() & 0xFFFF);
    }
 else     if (thriftField.isEqualTo(SERVICE_NAME)) {
      result.serviceName(ThriftCodec.readUtf8(bytes));
    }
 else     if (thriftField.isEqualTo(IPV6)) {
      result.parseIp(ThriftCodec.readByteArray(bytes));
    }
 else {
      skip(bytes,thriftField.type);
    }
  }
  return result.build();
}
Program: 46887
Project: 46887
Buggy source:
/** 
 * @see Span#shared 
 */
public Builder shared(@Nullable Boolean shared){
  if (shared != null)   return shared(shared);
  flags&=~FLAG_SHARED_SET;
  return this;
}

Fixed version (ground truth):
/** 
 * @see Span#shared 
 */
public Builder shared(@Nullable Boolean shared){
  if (shared != null)   return shared((boolean)shared);
  flags&=~FLAG_SHARED_SET;
  return this;
}
Program: 46888
Project: 46888
Buggy source:
/** 
 * @see Span#debug 
 */
public Builder debug(@Nullable Boolean debug){
  if (debug != null)   return debug(debug);
  flags&=~FLAG_DEBUG_SET;
  return this;
}

Fixed version (ground truth):
/** 
 * @see Span#debug 
 */
public Builder debug(@Nullable Boolean debug){
  if (debug != null)   return debug((boolean)debug);
  flags&=~FLAG_DEBUG_SET;
  return this;
}
Program: 46893
Project: 46893
Buggy source:
@Test public void spanRoundTrip_shared() throws IOException {
  span=span.toBuilder().shared(true).build();
  assertThat(SpanBytesDecoder.JSON_V2.decodeOne(SpanBytesEncoder.JSON_V2.encode(span))).isEqualTo(span);
}

Fixed version (ground truth):
@Test public void spanRoundTrip_shared() throws IOException {
  span=span.toBuilder().kind(Span.Kind.SERVER).shared(true).build();
  assertThat(SpanBytesDecoder.JSON_V2.decodeOne(SpanBytesEncoder.JSON_V2.encode(span))).isEqualTo(span);
}
Program: 46894
Project: 46894
Buggy source:
/** 
 * This isn't a test of what we "should" accept as a span, rather that characters that trip-up json don't fail in codec.
 */
@Test public void specialCharsInJson() throws IOException {
  Span worstSpanInTheWorld=Span.newBuilder().traceId("String_Node_Str").id("String_Node_Str").name(new String(new char[]{'"','\\','\t','\b','\n','\r','\f'})).addAnnotation(1L,"String_Node_Str").putTag("String_Node_Str","String_Node_Str").build();
  assertThat(SpanBytesDecoder.JSON_V2.decodeOne(SpanBytesEncoder.JSON_V2.encode(worstSpanInTheWorld))).isEqualTo(worstSpanInTheWorld);
}

Fixed version (ground truth):
/** 
 * This isn't a test of what we "should" accept as a span, rather that characters that trip-up json don't fail in codec.
 */
@Test public void specialCharsInJson() throws IOException {
  assertThat(SpanBytesDecoder.JSON_V2.decodeOne(SpanBytesEncoder.JSON_V2.encode(worstSpanInTheWorld))).isEqualTo(worstSpanInTheWorld);
}
Program: 46895
Project: 46895
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public ResponseEntity<List<String>> getSpanNames(@RequestParam(value="String_Node_Str",required=true) String serviceName) throws IOException {
  return maybeCacheNames(storage.v2SpanStore().getSpanNames(serviceName).execute());
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public ResponseEntity<List<String>> getSpanNames(@RequestParam(value="String_Node_Str",required=true) String serviceName) throws IOException {
  if (storage == null)   throw new Version2StorageNotConfigured();
  return maybeCacheNames(storage.v2SpanStore().getSpanNames(serviceName).execute());
}
Program: 46896
Project: 46896
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET,produces=APPLICATION_JSON_VALUE) public byte[] getDependencies(@RequestParam(value="String_Node_Str",required=true) long endTs,@Nullable @RequestParam(value="String_Node_Str",required=false) Long lookback) throws IOException {
  Call<List<DependencyLink>> call=storage.v2SpanStore().getDependencies(endTs,lookback != null ? lookback : defaultLookback);
  return Codec.JSON.writeDependencyLinks(call.execute());
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET,produces=APPLICATION_JSON_VALUE) public byte[] getDependencies(@RequestParam(value="String_Node_Str",required=true) long endTs,@Nullable @RequestParam(value="String_Node_Str",required=false) Long lookback) throws IOException {
  if (storage == null)   throw new Version2StorageNotConfigured();
  Call<List<DependencyLink>> call=storage.v2SpanStore().getDependencies(endTs,lookback != null ? lookback : defaultLookback);
  return Codec.JSON.writeDependencyLinks(call.execute());
}
Program: 46897
Project: 46897
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public ResponseEntity<List<String>> getServiceNames() throws IOException {
  List<String> serviceNames=storage.v2SpanStore().getServiceNames().execute();
  serviceCount=serviceNames.size();
  return maybeCacheNames(serviceNames);
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public ResponseEntity<List<String>> getServiceNames() throws IOException {
  if (storage == null)   throw new Version2StorageNotConfigured();
  List<String> serviceNames=storage.v2SpanStore().getServiceNames().execute();
  serviceCount=serviceNames.size();
  return maybeCacheNames(serviceNames);
}
Program: 46899
Project: 46899
Buggy source:
@Autowired ZipkinQueryApiV2(V2StorageComponent storage){
  this.storage=storage;
}

Fixed version (ground truth):
ZipkinQueryApiV2(StorageComponent storage,@Value("String_Node_Str") String storageType,@Value("String_Node_Str") long defaultLookback,@Value("String_Node_Str") int namesMaxAge){
  if (storage instanceof V2StorageComponent) {
    this.storage=(V2StorageComponent)storage;
  }
 else {
    this.storage=null;
  }
  this.storageType=storageType;
  this.defaultLookback=defaultLookback;
  this.namesMaxAge=namesMaxAge;
}
Program: 46900
Project: 46900
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET,produces=APPLICATION_JSON_VALUE) public String getTrace(@PathVariable String traceIdHex,WebRequest request) throws IOException {
  long traceIdHigh=traceIdHex.length() == 32 ? lowerHexToUnsignedLong(traceIdHex,0) : 0L;
  long traceIdLow=lowerHexToUnsignedLong(traceIdHex);
  List<Span> trace=storage.v2SpanStore().getTrace(traceIdHigh,traceIdLow).execute();
  if (trace.isEmpty()) {
    throw new TraceNotFoundException(traceIdHex,traceIdHigh,traceIdLow);
  }
  Buffer buffer=new Buffer();
  buffer.writeByte('[');
  for (int i=0, length=trace.size(); i < length; ) {
    buffer.write(Encoder.JSON.encode(trace.get(i)));
    if (++i < length)     buffer.writeByte(',');
  }
  buffer.writeByte(']');
  return buffer.readUtf8();
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET,produces=APPLICATION_JSON_VALUE) public String getTrace(@PathVariable String traceIdHex,WebRequest request) throws IOException {
  if (storage == null)   throw new Version2StorageNotConfigured();
  long traceIdHigh=traceIdHex.length() == 32 ? lowerHexToUnsignedLong(traceIdHex,0) : 0L;
  long traceIdLow=lowerHexToUnsignedLong(traceIdHex);
  List<Span> trace=storage.v2SpanStore().getTrace(traceIdHigh,traceIdLow).execute();
  if (trace.isEmpty()) {
    throw new TraceNotFoundException(traceIdHex,traceIdHigh,traceIdLow);
  }
  Buffer buffer=new Buffer();
  buffer.writeByte('[');
  for (int i=0, length=trace.size(); i < length; ) {
    buffer.write(Encoder.JSON.encode(trace.get(i)));
    if (++i < length)     buffer.writeByte(',');
  }
  buffer.writeByte(']');
  return buffer.readUtf8();
}
Program: 46901
Project: 46901
Buggy source:
@Test public void queryRelatedEndpoints404() throws Exception {
  MockMvc mockMvc=MockMvcBuilders.webAppContextSetup(this.context).build();
  mockMvc.perform(get("String_Node_Str")).andExpect(status().isNotFound());
  mockMvc.perform(get("String_Node_Str")).andExpect(status().isNotFound());
  mockMvc.perform(get("String_Node_Str")).andExpect(status().isOk());
}

Fixed version (ground truth):
@Test public void queryRelatedEndpoints404() throws Exception {
  MockMvc mockMvc=MockMvcBuilders.webAppContextSetup(this.context).build();
  mockMvc.perform(get("String_Node_Str")).andExpect(status().isNotFound());
  mockMvc.perform(get("String_Node_Str")).andExpect(status().isNotFound());
  mockMvc.perform(get("String_Node_Str")).andExpect(status().isNotFound());
  mockMvc.perform(get("String_Node_Str")).andExpect(status().isOk());
}
Program: 46902
Project: 46902
Buggy source:
@Test(expected=NoSuchBeanDefinitionException.class) public void disabledQueryBean() throws Exception {
  context.getBean(ZipkinQueryApiV1.class);
}

Fixed version (ground truth):
@Test(expected=NoSuchBeanDefinitionException.class) public void disabledQueryBean() throws Exception {
  context.getBean(ZipkinQueryApiV1.class);
  context.getBean(ZipkinQueryApiV2.class);
}
Program: 46903
Project: 46903
Buggy source:
public Builder clear(){
  traceId=null;
  traceIdHigh=null;
  name=null;
  id=null;
  parentId=null;
  timestamp=null;
  if (annotations != null)   annotations.clear();
  if (binaryAnnotations != null)   binaryAnnotations.clear();
  debug=null;
  isClientSpan=false;
  return this;
}

Fixed version (ground truth):
public Builder clear(){
  traceId=null;
  traceIdHigh=null;
  name=null;
  id=null;
  parentId=null;
  timestamp=null;
  duration=null;
  if (annotations != null)   annotations.clear();
  if (binaryAnnotations != null)   binaryAnnotations.clear();
  debug=null;
  isClientSpan=false;
  return this;
}
Program: 46904
Project: 46904
Buggy source:
public void addNode(Long parentId,long id,@Nullable V value){
  Node<V> node=new Node<V>().value(value);
  if (parentId == null) {
    if (rootNode == null) {
      rootNode=node;
    }
 else {
      idToNode.put(id,node);
      idToParent.put(id,null);
    }
  }
 else {
    idToNode.put(id,node);
    idToParent.put(id,parentId);
  }
}

Fixed version (ground truth):
public void addNode(@Nullable Long parentId,long id,V value){
  Node<V> node=new Node<V>().value(value);
  if (parentId == null && rootNode == null) {
    rootNode=node;
  }
 else {
    idToNode.put(id,node);
    idToParent.put(id,parentId);
  }
}
Program: 46905
Project: 46905
Buggy source:
/** 
 * Builds a tree from calls to   {@link #addNode}, or returns an empty tree. 
 */
public Node<V> build(){
  for (  Map.Entry<Long,Long> entry : idToParent.entrySet()) {
    Node<V> node=idToNode.get(entry.getKey());
    Node<V> parent=idToNode.get(entry.getValue());
    if (parent == null) {
      if (rootNode == null) {
        rootNode=new Node<>();
        rootNode.missingRootDummyNode=true;
      }
      rootNode.addChild(node);
    }
 else {
      parent.addChild(node);
    }
  }
  return rootNode != null ? rootNode : new Node<>();
}

Fixed version (ground truth):
/** 
 * Builds a tree from calls to   {@link #addNode}, or returns an empty tree. 
 */
public Node<V> build(){
  for (  Map.Entry<Long,Long> entry : idToParent.entrySet()) {
    Node<V> node=idToNode.get(entry.getKey());
    Node<V> parent=idToNode.get(entry.getValue());
    if (parent == null || node == parent) {
      if (rootNode == null) {
        rootNode=new Node<>();
        rootNode.missingRootDummyNode=true;
      }
      rootNode.addChild(node);
    }
 else {
      parent.addChild(node);
    }
  }
  return rootNode != null ? rootNode : new Node<>();
}
Program: 46906
Project: 46906
Buggy source:
public Node<V> value(V newValue){
  this.value=newValue;
  return this;
}

Fixed version (ground truth):
public Node<V> value(V newValue){
  this.value=checkNotNull(newValue,"String_Node_Str");
  return this;
}
Program: 46907
Project: 46907
Buggy source:
public Node<V> addChild(Node<V> child){
  child.parent=this;
  if (children.equals(Collections.emptyList()))   children=new LinkedList<>();
  children.add(child);
  return this;
}

Fixed version (ground truth):
public Node<V> addChild(Node<V> child){
  checkArgument(child != this,"String_Node_Str",this);
  child.parent=this;
  if (children.equals(Collections.emptyList()))   children=new LinkedList<>();
  children.add(child);
  return this;
}
Program: 46908
Project: 46908
Buggy source:
public static void main(String[] args) throws RunnerException {
  if (!new String(prefix_byteArray("String_Node_Str".getBytes())).equals("String_Node_Str" + Long.toString(TIMESTAMP_MILLIS) + "String_Node_Str")) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (!new String(prefix_channelBuffer("String_Node_Str".getBytes()).toByteBuffer().array()).equals("String_Node_Str" + Long.toString(TIMESTAMP_MILLIS) + "String_Node_Str")) {
    throw new IllegalStateException("String_Node_Str");
  }
  Options opt=new OptionsBuilder().include("String_Node_Str" + ElasticsearchBenchmarks.class.getSimpleName() + "String_Node_Str").build();
  new Runner(opt).run();
}

Fixed version (ground truth):
public static void main(String[] args) throws RunnerException {
  if (!new String(prefix_byteArray("String_Node_Str".getBytes(UTF_8)),UTF_8).equals("String_Node_Str" + Long.toString(TIMESTAMP_MILLIS) + "String_Node_Str")) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (!new String(prefix_channelBuffer("String_Node_Str".getBytes(UTF_8)).toByteBuffer().array(),UTF_8).equals("String_Node_Str" + Long.toString(TIMESTAMP_MILLIS) + "String_Node_Str")) {
    throw new IllegalStateException("String_Node_Str");
  }
  Options opt=new OptionsBuilder().include("String_Node_Str" + ElasticsearchBenchmarks.class.getSimpleName() + "String_Node_Str").build();
  new Runner(opt).run();
}
Program: 46909
Project: 46909
Buggy source:
@Override public ListenableFuture<List<Span>> findSpans(String[] indices,QueryBuilder query){
  if (indices.length > MAX_INDICES) {
    query=QueryBuilders.indicesQuery(query,indices).noMatchQuery("String_Node_Str");
    indices=allIndices;
  }
  return transform(toGuava(lenientSearch(new SearchSourceBuilder().query(query).size(InternalElasticsearchClient.MAX_RAW_SPANS).toString()).addIndex(Arrays.asList(indices)).addType(SPAN).build()),new Function<SearchResult,List<Span>>(){
    @Override public List<Span> apply(    SearchResult input){
      if (input.getTotal() == 0)       return null;
      ImmutableList.Builder<Span> builder=ImmutableList.builder();
      for (      SearchResult.Hit<Span,?> hit : input.getHits(Span.class)) {
        builder.add(hit.source);
      }
      return builder.build();
    }
  }
);
}

Fixed version (ground truth):
@Override public ListenableFuture<List<Span>> findSpans(String[] indices,QueryBuilder query){
  if (indices.length > MAX_INDICES) {
    query=QueryBuilders.indicesQuery(query,indices).noMatchQuery("String_Node_Str");
    indices=allIndices;
  }
  return transform(toGuava(lenientSearch(new SearchSourceBuilder().query(query).size(InternalElasticsearchClient.MAX_RAW_SPANS).toString()).addIndex(Arrays.asList(indices)).addType(SPAN).build()),new Function<SearchResult,List<Span>>(){
    @Override public List<Span> apply(    SearchResult input){
      if (input.getTotal() == null || input.getTotal() == 0)       return null;
      ImmutableList.Builder<Span> builder=ImmutableList.builder();
      for (      SearchResult.Hit<Span,?> hit : input.getHits(Span.class)) {
        builder.add(hit.source);
      }
      return builder.build();
    }
  }
);
}
Program: 46910
Project: 46910
Buggy source:
@Override public String apply(TermsAggregation.Entry input){
  return input.getKey();
}

Fixed version (ground truth):
@Override public ListenableFuture apply(Object input){
  return toGuava(new Flush.Builder().addIndex(indices).build());
}
Program: 46911
Project: 46911
Buggy source:
@Override public ListenableFuture<Collection<DependencyLink>> findDependencies(String[] indices){
  QueryBuilder query=QueryBuilders.matchAllQuery();
  if (indices.length > MAX_INDICES) {
    query=QueryBuilders.indicesQuery(query,indices).noMatchQuery("String_Node_Str");
    indices=allIndices;
  }
  Search.Builder search=lenientSearch(new SearchSourceBuilder().query(query).toString()).addIndex(Arrays.asList(indices)).addType(DEPENDENCY_LINK);
  return transform(toGuava(search.build()),new Function<SearchResult,Collection<DependencyLink>>(){
    @Override public Collection<DependencyLink> apply(    SearchResult input){
      ImmutableList.Builder<DependencyLink> builder=ImmutableList.builder();
      for (      SearchResult.Hit<DependencyLink,?> hit : input.getHits(DependencyLink.class)) {
        builder.add(hit.source);
      }
      return builder.build();
    }
  }
);
}

Fixed version (ground truth):
@Override public ListenableFuture<List<DependencyLink>> findDependencies(String[] indices){
  QueryBuilder query=QueryBuilders.matchAllQuery();
  if (indices.length > MAX_INDICES) {
    query=QueryBuilders.indicesQuery(query,indices).noMatchQuery("String_Node_Str");
    indices=allIndices;
  }
  Search.Builder search=lenientSearch(new SearchSourceBuilder().query(query).toString()).addIndex(Arrays.asList(indices)).addType(DEPENDENCY_LINK);
  return transform(toGuava(search.build()),new Function<SearchResult,List<DependencyLink>>(){
    @Override public List<DependencyLink> apply(    SearchResult input){
      ImmutableList.Builder<DependencyLink> builder=ImmutableList.builder();
      for (      SearchResult.Hit<DependencyLink,?> hit : input.getHits(DependencyLink.class)) {
        builder.add(hit.source);
      }
      return builder.build();
    }
  }
);
}
Program: 46912
Project: 46912
Buggy source:
IndexNameFormatter(String index){
  this.index=index;
  this.dateFormat=new SimpleDateFormat(DAILY_INDEX_FORMAT);
}

Fixed version (ground truth):
IndexNameFormatter(String index){
  this.index=index;
  this.dateFormat=new ThreadLocal<SimpleDateFormat>(){
    @Override protected SimpleDateFormat initialValue(){
      return new SimpleDateFormat(DAILY_INDEX_FORMAT);
    }
  }
;
}
Program: 46913
Project: 46913
Buggy source:
String indexNameForTimestamp(long timestampMillis){
  return index + "String_Node_Str" + dateFormat.format(new Date(timestampMillis));
}

Fixed version (ground truth):
String indexNameForTimestamp(long timestampMillis){
  return index + "String_Node_Str" + dateFormat.get().format(new Date(timestampMillis));
}
Program: 46914
Project: 46914
Buggy source:
static byte[] gunzip(byte[] input) throws IOException {
  Inflater inflater=new Inflater();
  inflater.setInput(input);
  try (ByteArrayOutputStream outputStream=new ByteArrayOutputStream(input.length)){
    while (!inflater.finished()) {
      int count=inflater.inflate(GZIP_BUFFER.get());
      outputStream.write(GZIP_BUFFER.get(),0,count);
    }
    return outputStream.toByteArray();
  }
 catch (  DataFormatException e) {
    throw new IOException(e.getMessage(),e);
  }
}

Fixed version (ground truth):
static byte[] gunzip(byte[] input) throws IOException {
  GZIPInputStream in=new GZIPInputStream(new ByteArrayInputStream(input));
  try (ByteArrayOutputStream outputStream=new ByteArrayOutputStream(input.length)){
    byte[] buf=GZIP_BUFFER.get();
    int len;
    while ((len=in.read(buf)) > 0) {
      outputStream.write(buf,0,len);
    }
    return outputStream.toByteArray();
  }
 }
Program: 46915
Project: 46915
Buggy source:
DeferredResult<ResponseEntity<?>> validateAndStoreSpans(String encoding,Codec codec,byte[] body){
  DeferredResult<ResponseEntity<?>> result=new DeferredResult<>();
  metrics.incrementMessages();
  if (encoding != null && encoding.contains("String_Node_Str")) {
    try {
      body=gunzip(body);
    }
 catch (    IOException e) {
      metrics.incrementMessagesDropped();
      result.setResult(ResponseEntity.badRequest().body("String_Node_Str"));
      return result;
    }
  }
  collector.acceptSpans(body,codec,new Callback<Void>(){
    @Override public void onSuccess(    @Nullable Void value){
      result.setResult(SUCCESS);
    }
    @Override public void onError(    Throwable t){
      String message=t.getMessage();
      result.setErrorResult(message.startsWith("String_Node_Str") ? ResponseEntity.status(500).body(message + "String_Node_Str") : ResponseEntity.status(400).body(message + "String_Node_Str"));
    }
  }
);
  return result;
}

Fixed version (ground truth):
DeferredResult<ResponseEntity<?>> validateAndStoreSpans(String encoding,Codec codec,byte[] body){
  DeferredResult<ResponseEntity<?>> result=new DeferredResult<>();
  metrics.incrementMessages();
  if (encoding != null && encoding.contains("String_Node_Str")) {
    try {
      body=gunzip(body);
    }
 catch (    IOException e) {
      metrics.incrementMessagesDropped();
      result.setResult(ResponseEntity.badRequest().body("String_Node_Str" + e.getMessage() + "String_Node_Str"));
      return result;
    }
  }
  collector.acceptSpans(body,codec,new Callback<Void>(){
    @Override public void onSuccess(    @Nullable Void value){
      result.setResult(SUCCESS);
    }
    @Override public void onError(    Throwable t){
      String message=t.getMessage();
      result.setErrorResult(message.startsWith("String_Node_Str") ? ResponseEntity.status(500).body(message + "String_Node_Str") : ResponseEntity.status(400).body(message + "String_Node_Str"));
    }
  }
);
  return result;
}