nus-yam/ex-repair huggingface dataset:
Program: 109731
Project: 109731
Buggy source:
public Status process() throws EventDeliveryException {
  log.trace("String_Node_Str");
  Channel channel=getChannel();
  Transaction tx=channel.getTransaction();
  try {
    tx.begin();
    Event e=channel.take();
    if (e == null) {
      tx.rollback();
      log.trace("String_Node_Str");
      return Status.BACKOFF;
    }
    try {
      log.trace("String_Node_Str");
      producer.send(new ProducerData<String,String>(this.topic,new String(e.getBody())));
      tx.commit();
      return Status.READY;
    }
 catch (    Exception ex) {
      log.trace("String_Node_Str",ex);
      throw ex;
    }
  }
 catch (  Exception e) {
    tx.rollback();
    log.debug("String_Node_Str",e);
    return Status.BACKOFF;
  }
 finally {
    log.trace("String_Node_Str");
    tx.close();
  }
}

Fixed version (ground truth):
public Status process() throws EventDeliveryException {
  Channel channel=getChannel();
  Transaction tx=channel.getTransaction();
  try {
    tx.begin();
    Event e=channel.take();
    if (e == null) {
      tx.rollback();
      return Status.BACKOFF;
    }
    try {
      producer.send(new ProducerData<String,String>(this.topic,new String(e.getBody())));
      log.debug("String_Node_Str" + e.getBody());
      tx.commit();
      return Status.READY;
    }
 catch (    Exception ex) {
      throw ex;
    }
  }
 catch (  Exception e) {
    tx.rollback();
    return Status.BACKOFF;
  }
 finally {
    tx.close();
  }
}
Program: 109732
Project: 109732
Buggy source:
public void configure(Context context){
  this.topic=KafkaUtil.getKafkaConfigParameter(context,"String_Node_Str");
  this.producer=KafkaUtil.getProducer(context);
  log.debug("String_Node_Str");
}

Fixed version (ground truth):
public void configure(Context context){
  this.topic=KafkaUtil.getKafkaConfigParameter(context,"String_Node_Str");
  this.producer=KafkaUtil.getProducer(context);
}
Program: 109733
Project: 109733
Buggy source:
public Status process() throws EventDeliveryException {
  try {
    ArrayList<Event> eventList=new ArrayList<Event>();
    Message message;
    Event event;
    ByteBuffer buffer;
    Map<String,String> headers;
    byte[] bytes;
    for (int i=0; i < batchSize; i++) {
      if (it.hasNext()) {
        log.trace("String_Node_Str");
        message=it.next().message();
        log.info("String_Node_Str" + message);
        event=new SimpleEvent();
        buffer=message.payload();
        headers=new HashMap<String,String>();
        headers.put("String_Node_Str",String.valueOf(System.currentTimeMillis()));
        bytes=new byte[buffer.remaining()];
        buffer.get(bytes);
        event.setBody(bytes);
        event.setHeaders(headers);
        log.trace(new String(bytes));
        eventList.add(event);
      }
      log.trace("String_Node_Str");
    }
    getChannelProcessor().processEventBatch(eventList);
    log.trace("String_Node_Str");
    return Status.READY;
  }
 catch (  Exception e) {
    log.debug("String_Node_Str" + e);
    return Status.BACKOFF;
  }
}

Fixed version (ground truth):
public Status process() throws EventDeliveryException {
  ArrayList<Event> eventList=new ArrayList<Event>();
  Message message;
  Event event;
  ByteBuffer buffer;
  Map<String,String> headers;
  byte[] bytes;
  try {
    for (int i=0; i < batchSize; i++) {
      if (it.hasNext()) {
        message=it.next().message();
        event=new SimpleEvent();
        buffer=message.payload();
        headers=new HashMap<String,String>();
        headers.put("String_Node_Str",String.valueOf(System.currentTimeMillis()));
        bytes=new byte[buffer.remaining()];
        buffer.get(bytes);
        log.debug("String_Node_Str" + i + "String_Node_Str"+ "String_Node_Str"+ new String(bytes));
        event.setBody(bytes);
        event.setHeaders(headers);
        eventList.add(event);
      }
    }
    getChannelProcessor().processEventBatch(eventList);
    return Status.READY;
  }
 catch (  Exception e) {
    log.error("String_Node_Str" + e);
    return Status.BACKOFF;
  }
 finally {
  }
}
Program: 109734
Project: 109734
Buggy source:
public void configure(Context context){
  this.topic=KafkaUtil.getKafkaConfigParameter(context,"String_Node_Str");
  try {
    this.consumer=KafkaUtil.getConsumer(context);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  KeeperException e) {
    e.printStackTrace();
  }
catch (  InterruptedException e) {
    e.printStackTrace();
  }
  Map<String,Integer> topicCountMap=new HashMap<String,Integer>();
  topicCountMap.put(topic,new Integer(1));
  Map<String,List<KafkaStream<Message>>> consumerMap=consumer.createMessageStreams(topicCountMap);
  KafkaStream<Message> stream=consumerMap.get(topic).get(0);
  it=stream.iterator();
}

Fixed version (ground truth):
public void configure(Context context){
  this.topic=KafkaUtil.getKafkaConfigParameter(context,"String_Node_Str");
  this.batchSize=Integer.parseInt(KafkaUtil.getKafkaConfigParameter(context,"String_Node_Str"));
  try {
    this.consumer=KafkaUtil.getConsumer(context);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  KeeperException e) {
    e.printStackTrace();
  }
catch (  InterruptedException e) {
    e.printStackTrace();
  }
  Map<String,Integer> topicCountMap=new HashMap<String,Integer>();
  topicCountMap.put(topic,new Integer(1));
  Map<String,List<KafkaStream<Message>>> consumerMap=consumer.createMessageStreams(topicCountMap);
  KafkaStream<Message> stream=consumerMap.get(topic).get(0);
  it=stream.iterator();
}
Program: 109735
Project: 109735
Buggy source:
public static Producer<String,String> getProducer(Context context){
  Producer<String,String> producer;
  Properties props=new Properties();
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str",getZkConnect(context));
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str",getBatchSize(context));
  props.put("String_Node_Str",15000);
  producer=new Producer<String,String>(new ProducerConfig(props));
  log.debug("String_Node_Str");
  return producer;
}

Fixed version (ground truth):
public static Producer<String,String> getProducer(Context context){
  Producer<String,String> producer;
  Properties props=new Properties();
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str",getZkConnect(context));
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str",getBatchSize(context));
  props.put("String_Node_Str","String_Node_Str");
  producer=new Producer<String,String>(new ProducerConfig(props));
  log.debug("String_Node_Str");
  return producer;
}
Program: 109736
Project: 109736
Buggy source:
protected void configureBounds(){
  if (isFrist) {
    oriRationWH=((float)mDrawable.getIntrinsicWidth()) / ((float)mDrawable.getIntrinsicHeight());
    final float scale=mContext.getResources().getDisplayMetrics().density;
    int w=Math.min(getWidth(),(int)(mDrawable.getIntrinsicWidth() * scale + 0.5f));
    int h=(int)(w / oriRationWH);
    int left=(getWidth() - w) / 2;
    int top=(getHeight() - h) / 2;
    int right=left + w;
    int bottom=top + h;
    mDrawableSrc.set(left,top,right,bottom);
    mDrawableDst.set(mDrawableSrc);
    int floatWidth=dipTopx(mContext,cropWidth);
    int floatHeight=dipTopx(mContext,cropHeight);
    int floatLeft=(getWidth() - floatWidth) / 2;
    int floatTop=(getHeight() - floatHeight) / 2;
    mDrawableFloat.set(floatLeft,floatTop,floatLeft + floatWidth,floatTop + floatHeight);
    isFrist=false;
  }
  mDrawable.setBounds(mDrawableDst);
  mFloatDrawable.setBounds(mDrawableFloat);
}

Fixed version (ground truth):
protected void configureBounds(){
  if (isFrist) {
    oriRationWH=((float)mDrawable.getIntrinsicWidth()) / ((float)mDrawable.getIntrinsicHeight());
    final float scale=mContext.getResources().getDisplayMetrics().density;
    int w=Math.min(getWidth(),(int)(mDrawable.getIntrinsicWidth() * scale + 0.5f));
    int h=(int)(w / oriRationWH);
    int left=(getWidth() - w) / 2;
    int top=(getHeight() - h) / 2;
    int right=left + w;
    int bottom=top + h;
    mDrawableSrc.set(left,top,right,bottom);
    mDrawableDst.set(mDrawableSrc);
    int floatWidth=dipTopx(mContext,cropWidth);
    int floatHeight=dipTopx(mContext,cropHeight);
    if (floatWidth > getWidth()) {
      floatWidth=getWidth();
      floatHeight=cropHeight * floatWidth / cropWidth;
    }
    if (floatHeight > getHeight()) {
      floatHeight=getHeight();
      floatWidth=cropWidth * floatHeight / cropHeight;
    }
    int floatLeft=(getWidth() - floatWidth) / 2;
    int floatTop=(getHeight() - floatHeight) / 2;
    mDrawableFloat.set(floatLeft,floatTop,floatLeft + floatWidth,floatTop + floatHeight);
    isFrist=false;
  }
  mDrawable.setBounds(mDrawableDst);
  mFloatDrawable.setBounds(mDrawableFloat);
}
Program: 109737
Project: 109737
Buggy source:
protected void configureBounds(){
  if (isFrist) {
    oriRationWH=((float)mDrawable.getIntrinsicWidth()) / ((float)mDrawable.getIntrinsicHeight());
    final float scale=mContext.getResources().getDisplayMetrics().density;
    int w=Math.min(getWidth(),(int)(mDrawable.getIntrinsicWidth() * scale + 0.5f));
    int h=(int)(w / oriRationWH);
    int left=(getWidth() - w) / 2;
    int top=(getHeight() - h) / 2;
    int right=left + w;
    int bottom=top + h;
    mDrawableSrc.set(left,top,right,bottom);
    mDrawableDst.set(mDrawableSrc);
    int floatWidth=dipTopx(mContext,cropWidth);
    int floatHeight=dipTopx(mContext,cropHeight);
    int floatLeft=(getWidth() - floatWidth) / 2;
    int floatTop=(getHeight() - floatHeight) / 2;
    mDrawableFloat.set(floatLeft,floatTop,floatLeft + floatWidth,floatTop + floatHeight);
    isFrist=false;
  }
  mDrawable.setBounds(mDrawableDst);
  mFloatDrawable.setBounds(mDrawableFloat);
}

Fixed version (ground truth):
protected void configureBounds(){
  if (isFrist) {
    oriRationWH=((float)mDrawable.getIntrinsicWidth()) / ((float)mDrawable.getIntrinsicHeight());
    final float scale=mContext.getResources().getDisplayMetrics().density;
    int w=Math.min(getWidth(),(int)(mDrawable.getIntrinsicWidth() * scale + 0.5f));
    int h=(int)(w / oriRationWH);
    int left=(getWidth() - w) / 2;
    int top=(getHeight() - h) / 2;
    int right=left + w;
    int bottom=top + h;
    mDrawableSrc.set(left,top,right,bottom);
    mDrawableDst.set(mDrawableSrc);
    int floatWidth=dipTopx(mContext,cropWidth);
    int floatHeight=dipTopx(mContext,cropHeight);
    if (floatWidth > getWidth()) {
      floatWidth=getWidth();
      floatHeight=cropHeight * floatWidth / cropWidth;
    }
    if (floatHeight > getHeight()) {
      floatHeight=getHeight();
      floatWidth=cropWidth * floatHeight / cropHeight;
    }
    int floatLeft=(getWidth() - floatWidth) / 2;
    int floatTop=(getHeight() - floatHeight) / 2;
    mDrawableFloat.set(floatLeft,floatTop,floatLeft + floatWidth,floatTop + floatHeight);
    isFrist=false;
  }
  mDrawable.setBounds(mDrawableDst);
  mFloatDrawable.setBounds(mDrawableFloat);
}
Program: 109738
Project: 109738
Buggy source:
protected void configureBounds(){
  if (isFrist) {
    oriRationWH=((float)mDrawable.getIntrinsicWidth()) / ((float)mDrawable.getIntrinsicHeight());
    final float scale=mContext.getResources().getDisplayMetrics().density;
    int w=Math.min(getWidth(),(int)(mDrawable.getIntrinsicWidth() * scale + 0.5f));
    int h=(int)(w / oriRationWH);
    int left=(getWidth() - w) / 2;
    int top=(getHeight() - h) / 2;
    int right=left + w;
    int bottom=top + h;
    mDrawableSrc.set(left,top,right,bottom);
    mDrawableDst.set(mDrawableSrc);
    int floatWidth=dipTopx(mContext,cropWidth);
    int floatHeight=dipTopx(mContext,cropHeight);
    int floatLeft=(getWidth() - floatWidth) / 2;
    int floatTop=(getHeight() - floatHeight) / 2;
    mDrawableFloat.set(floatLeft,floatTop,floatLeft + floatWidth,floatTop + floatHeight);
    isFrist=false;
  }
  mDrawable.setBounds(mDrawableDst);
  mFloatDrawable.setBounds(mDrawableFloat);
}

Fixed version (ground truth):
protected void configureBounds(){
  if (isFrist) {
    oriRationWH=((float)mDrawable.getIntrinsicWidth()) / ((float)mDrawable.getIntrinsicHeight());
    final float scale=mContext.getResources().getDisplayMetrics().density;
    int w=Math.min(getWidth(),(int)(mDrawable.getIntrinsicWidth() * scale + 0.5f));
    int h=(int)(w / oriRationWH);
    int left=(getWidth() - w) / 2;
    int top=(getHeight() - h) / 2;
    int right=left + w;
    int bottom=top + h;
    mDrawableSrc.set(left,top,right,bottom);
    mDrawableDst.set(mDrawableSrc);
    int floatWidth=dipTopx(mContext,cropWidth);
    int floatHeight=dipTopx(mContext,cropHeight);
    if (floatWidth > getWidth()) {
      floatWidth=getWidth();
      floatHeight=cropHeight * floatWidth / cropWidth;
    }
    if (floatHeight > getHeight()) {
      floatHeight=getHeight();
      floatWidth=cropWidth * floatHeight / cropHeight;
    }
    int floatLeft=(getWidth() - floatWidth) / 2;
    int floatTop=(getHeight() - floatHeight) / 2;
    mDrawableFloat.set(floatLeft,floatTop,floatLeft + floatWidth,floatTop + floatHeight);
    isFrist=false;
  }
  mDrawable.setBounds(mDrawableDst);
  mFloatDrawable.setBounds(mDrawableFloat);
}
Program: 109739
Project: 109739
Buggy source:
protected void configureBounds(){
  if (isFrist) {
    oriRationWH=((float)mDrawable.getIntrinsicWidth()) / ((float)mDrawable.getIntrinsicHeight());
    final float scale=mContext.getResources().getDisplayMetrics().density;
    int w=Math.min(getWidth(),(int)(mDrawable.getIntrinsicWidth() * scale + 0.5f));
    int h=(int)(w / oriRationWH);
    int left=(getWidth() - w) / 2;
    int top=(getHeight() - h) / 2;
    int right=left + w;
    int bottom=top + h;
    mDrawableSrc.set(left,top,right,bottom);
    mDrawableDst.set(mDrawableSrc);
    int floatWidth=dipTopx(mContext,cropWidth);
    int floatHeight=dipTopx(mContext,cropHeight);
    int floatLeft=(getWidth() - floatWidth) / 2;
    int floatTop=(getHeight() - floatHeight) / 2;
    mDrawableFloat.set(floatLeft,floatTop,floatLeft + floatWidth,floatTop + floatHeight);
    isFrist=false;
  }
  mDrawable.setBounds(mDrawableDst);
  mFloatDrawable.setBounds(mDrawableFloat);
}

Fixed version (ground truth):
protected void configureBounds(){
  if (isFrist) {
    oriRationWH=((float)mDrawable.getIntrinsicWidth()) / ((float)mDrawable.getIntrinsicHeight());
    final float scale=mContext.getResources().getDisplayMetrics().density;
    int w=Math.min(getWidth(),(int)(mDrawable.getIntrinsicWidth() * scale + 0.5f));
    int h=(int)(w / oriRationWH);
    int left=(getWidth() - w) / 2;
    int top=(getHeight() - h) / 2;
    int right=left + w;
    int bottom=top + h;
    mDrawableSrc.set(left,top,right,bottom);
    mDrawableDst.set(mDrawableSrc);
    int floatWidth=dipTopx(mContext,cropWidth);
    int floatHeight=dipTopx(mContext,cropHeight);
    if (floatWidth > getWidth()) {
      floatWidth=getWidth();
      floatHeight=cropHeight * floatWidth / cropWidth;
    }
    if (floatHeight > getHeight()) {
      floatHeight=getHeight();
      floatWidth=cropWidth * floatHeight / cropHeight;
    }
    int floatLeft=(getWidth() - floatWidth) / 2;
    int floatTop=(getHeight() - floatHeight) / 2;
    mDrawableFloat.set(floatLeft,floatTop,floatLeft + floatWidth,floatTop + floatHeight);
    isFrist=false;
  }
  mDrawable.setBounds(mDrawableDst);
  mFloatDrawable.setBounds(mDrawableFloat);
}
Program: 109740
Project: 109740
Buggy source:
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  if (requestCode == SCRIPT_EXEC_PY) {
    Bundle bundle=data.getExtras();
    String flag=bundle.getString("String_Node_Str");
    String param=bundle.getString("String_Node_Str");
    String result=bundle.getString("String_Node_Str");
    Toast.makeText(this,"String_Node_Str" + result + "String_Node_Str",Toast.LENGTH_SHORT).show();
  }
}

Fixed version (ground truth):
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  if (requestCode == SCRIPT_EXEC_PY) {
    if (data != null) {
      Bundle bundle=data.getExtras();
      String flag=bundle.getString("String_Node_Str");
      String param=bundle.getString("String_Node_Str");
      String result=bundle.getString("String_Node_Str");
      Toast.makeText(this,"String_Node_Str" + result + "String_Node_Str",Toast.LENGTH_SHORT).show();
    }
 else {
      Toast.makeText(this,"String_Node_Str",Toast.LENGTH_SHORT).show();
    }
  }
}
Program: 109741
Project: 109741
Buggy source:
public void onQPyExec(View v){
  if (checkAppInstalledByName(getApplicationContext(),extPlgPlusName)) {
    Toast.makeText(this,"String_Node_Str",Toast.LENGTH_SHORT).show();
    Intent intent=new Intent();
    intent.setClassName(extPlgPlusName,extPlgPlusName + "String_Node_Str");
    intent.setAction(extPlgPlusName + "String_Node_Str");
    Bundle mBundle=new Bundle();
    mBundle.putString("String_Node_Str","String_Node_Str");
    mBundle.putString("String_Node_Str","String_Node_Str");
    mBundle.putString("String_Node_Str","String_Node_Str");
    mBundle.putString("String_Node_Str","String_Node_Str");
    EditText codeTxt=(EditText)findViewById(R.id.edit_text);
    String code=codeTxt.getText().toString();
    mBundle.putString("String_Node_Str",code);
    intent.putExtras(mBundle);
    startActivityForResult(intent,SCRIPT_EXEC_PY);
  }
 else {
    Toast.makeText(getApplicationContext(),"String_Node_Str",Toast.LENGTH_LONG).show();
    try {
      Uri uLink=Uri.parse("String_Node_Str");
      Intent intent=new Intent(Intent.ACTION_VIEW,uLink);
      startActivity(intent);
    }
 catch (    Exception e) {
      Uri uLink=Uri.parse("String_Node_Str");
      Intent intent=new Intent(Intent.ACTION_VIEW,uLink);
      startActivity(intent);
    }
  }
}

Fixed version (ground truth):
public void onQPyExec(View v){
  if (checkAppInstalledByName(getApplicationContext(),extPlgPlusName)) {
    Toast.makeText(this,"String_Node_Str",Toast.LENGTH_SHORT).show();
    Intent intent=new Intent();
    intent.setClassName(extPlgPlusName,"String_Node_Str");
    intent.setAction(extPlgPlusName + "String_Node_Str");
    Bundle mBundle=new Bundle();
    mBundle.putString("String_Node_Str","String_Node_Str");
    mBundle.putString("String_Node_Str","String_Node_Str");
    mBundle.putString("String_Node_Str","String_Node_Str");
    mBundle.putString("String_Node_Str","String_Node_Str");
    EditText codeTxt=(EditText)findViewById(R.id.edit_text);
    String code=codeTxt.getText().toString();
    mBundle.putString("String_Node_Str",code);
    intent.putExtras(mBundle);
    startActivityForResult(intent,SCRIPT_EXEC_PY);
  }
 else {
    Toast.makeText(getApplicationContext(),"String_Node_Str",Toast.LENGTH_LONG).show();
    try {
      Uri uLink=Uri.parse("String_Node_Str");
      Intent intent=new Intent(Intent.ACTION_VIEW,uLink);
      startActivity(intent);
    }
 catch (    Exception e) {
      Uri uLink=Uri.parse("String_Node_Str");
      Intent intent=new Intent(Intent.ACTION_VIEW,uLink);
      startActivity(intent);
    }
  }
}
Program: 109742
Project: 109742
Buggy source:
private byte[] readFully(final InputStream stream){
  try {
    int totalLength=0;
    byte[] buffer=getOrCreateBuffer();
    int read;
    while ((read=stream.read(buffer,totalLength,BUFFER_SIZE)) != -1) {
      totalLength+=read;
      if (totalLength >= buffer.length - 1) {
        byte[] newBuffer=new byte[buffer.length + BUFFER_SIZE];
        System.arraycopy(buffer,0,newBuffer,0,buffer.length);
        buffer=newBuffer;
      }
    }
    final byte[] result=new byte[totalLength];
    System.arraycopy(buffer,0,result,0,totalLength);
    return result;
  }
 catch (  Throwable t) {
    LogWrapper.log(Level.WARNING,t,"String_Node_Str");
    return new byte[0];
  }
}

Fixed version (ground truth):
private byte[] readFully(final InputStream stream){
  try {
    int totalLength=0;
    byte[] buffer=getOrCreateBuffer();
    int read;
    while ((read=stream.read(buffer,totalLength,totalLength - buffer.length)) != -1) {
      totalLength+=read;
      if (totalLength >= buffer.length - 1) {
        byte[] newBuffer=new byte[buffer.length + BUFFER_SIZE];
        System.arraycopy(buffer,0,newBuffer,0,buffer.length);
        buffer=newBuffer;
      }
    }
    final byte[] result=new byte[totalLength];
    System.arraycopy(buffer,0,result,0,totalLength);
    return result;
  }
 catch (  Throwable t) {
    LogWrapper.log(Level.WARNING,t,"String_Node_Str");
    return new byte[0];
  }
}
Program: 109743
Project: 109743
Buggy source:
private byte[] runTransformers(final String name,final String transformedName,byte[] basicClass){
  if (DEBUG_FINER) {
    LogWrapper.finest("String_Node_Str",name,transformedName,(basicClass == null ? 0 : basicClass.length));
    for (    final IClassTransformer transformer : transformers) {
      final String transName=transformer.getClass().getName();
      LogWrapper.finest("String_Node_Str",transName,(basicClass == null ? 0 : basicClass.length));
      basicClass=transformer.transform(name,transformedName,basicClass);
      LogWrapper.finest("String_Node_Str",transName,(basicClass == null ? 0 : basicClass.length));
    }
    LogWrapper.finest("String_Node_Str",name,transformedName,(basicClass == null ? 0 : basicClass.length));
  }
 else {
    for (    final IClassTransformer transformer : transformers) {
      basicClass=transformer.transform(name,transformedName,basicClass);
    }
  }
  return basicClass;
}

Fixed version (ground truth):
private byte[] runTransformers(final String name,final String transformedName,byte[] basicClass){
  if (DEBUG_FINER) {
    LogWrapper.finest("String_Node_Str",name,transformedName,(basicClass == null ? 0 : basicClass.length));
    for (    final IClassTransformer transformer : transformers) {
      final String transName=transformer.getClass().getName();
      LogWrapper.finest("String_Node_Str",name,transformedName,transName,(basicClass == null ? 0 : basicClass.length));
      basicClass=transformer.transform(name,transformedName,basicClass);
      LogWrapper.finest("String_Node_Str",name,transformedName,transName,(basicClass == null ? 0 : basicClass.length));
    }
    LogWrapper.finest("String_Node_Str",name,transformedName,(basicClass == null ? 0 : basicClass.length));
  }
 else {
    for (    final IClassTransformer transformer : transformers) {
      basicClass=transformer.transform(name,transformedName,basicClass);
    }
  }
  return basicClass;
}
Program: 109745
Project: 109745
Buggy source:
public byte[] getClassBytes(String name) throws IOException {
  if (name.indexOf('.') == -1) {
    for (    final String reservedName : RESERVED_NAMES) {
      if (name.toUpperCase(Locale.ENGLISH).startsWith(reservedName)) {
        final byte[] data=getClassBytes("String_Node_Str" + name);
        if (data != null) {
          return data;
        }
      }
    }
  }
  InputStream classStream=null;
  try {
    final String resourcePath=name.replace('.','/').concat("String_Node_Str");
    final URL classResource=findResource(resourcePath);
    if (classResource == null) {
      if (DEBUG)       LogWrapper.finest("String_Node_Str",resourcePath);
      return null;
    }
    classStream=classResource.openStream();
    if (DEBUG)     LogWrapper.finest("String_Node_Str",name,classResource.toString());
    return readFully(classStream);
  }
  finally {
    closeSilently(classStream);
  }
}

Fixed version (ground truth):
public byte[] getClassBytes(String name) throws IOException {
  if (negativeResourceCache.contains(name)) {
    return null;
  }
 else   if (resourceCache.containsKey(name)) {
    return resourceCache.get(name);
  }
  if (name.indexOf('.') == -1) {
    for (    final String reservedName : RESERVED_NAMES) {
      if (name.toUpperCase(Locale.ENGLISH).startsWith(reservedName)) {
        final byte[] data=getClassBytes("String_Node_Str" + name);
        if (data != null) {
          resourceCache.put(name,data);
          return data;
        }
      }
    }
  }
  InputStream classStream=null;
  try {
    final String resourcePath=name.replace('.','/').concat("String_Node_Str");
    final URL classResource=findResource(resourcePath);
    if (classResource == null) {
      if (DEBUG)       LogWrapper.finest("String_Node_Str",resourcePath);
      negativeResourceCache.add(name);
      return null;
    }
    classStream=classResource.openStream();
    if (DEBUG)     LogWrapper.finest("String_Node_Str",name,classResource.toString());
    final byte[] data=readFully(classStream);
    resourceCache.put(name,data);
    return data;
  }
  finally {
    closeSilently(classStream);
  }
}
Program: 109746
Project: 109746
Buggy source:
/** 
 * Returns whether an in-progress EntityAIBase should continue executing
 */
public boolean shouldContinueExecuting(){
  return this.entity.getFollowingEntity() != null && this.entity.followingHoldingPinaColada();
}

Fixed version (ground truth):
/** 
 * Returns whether an in-progress EntityAIBase should continue executing
 */
public boolean shouldContinueExecuting(){
  return this.entity.getFollowingEntity() != null && this.entity.followingHoldingPinaColada() && !this.entity.isTamed();
}
Program: 109747
Project: 109747
Buggy source:
/** 
 * Returns whether the EntityAIBase should begin execution.
 */
public boolean shouldExecute(){
  if (this.entity.isSitting())   return false;
  if (this.entity.getOwner() != null)   return false;
  List<EntityPlayer> list=this.entity.world.<EntityPlayer>getEntitiesWithinAABB(EntityPlayer.class,this.entity.getEntityBoundingBox().grow((double)this.areaSize),this.followPredicate);
  if (!list.isEmpty()) {
    for (    EntityPlayer entityliving : list) {
      if (!entityliving.isInvisible()) {
        this.entity.setFollowingEntity(entityliving);
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns whether the EntityAIBase should begin execution.
 */
public boolean shouldExecute(){
  if (this.entity.isSitting())   return false;
  if (this.entity.isTamed())   return false;
  if (this.entity.selfHoldingDrink(Drink.pinaColada))   return false;
  List<EntityPlayer> list=this.entity.world.<EntityPlayer>getEntitiesWithinAABB(EntityPlayer.class,this.entity.getEntityBoundingBox().grow((double)this.areaSize),this.followPredicate);
  if (!list.isEmpty()) {
    for (    EntityPlayer entityliving : list) {
      if (!entityliving.isInvisible()) {
        this.entity.setFollowingEntity(entityliving);
        return true;
      }
    }
  }
  return false;
}
Program: 109748
Project: 109748
Buggy source:
public EntityAIMonkeySitInChair(EntityVMonkey monkey){
  this.entity=monkey;
  this.setMutexBits(5);
}

Fixed version (ground truth):
public EntityAIMonkeySitInChair(EntityVMonkey monkey,EntityAISit aiSit){
  this.entity=monkey;
  this.aiSit=aiSit;
  this.setMutexBits(5);
}
Program: 109749
Project: 109749
Buggy source:
/** 
 * Returns whether an in-progress EntityAIBase should continue executing
 */
@Override public boolean shouldContinueExecuting(){
  return !this.entity.isRiding();
}

Fixed version (ground truth):
/** 
 * Returns whether an in-progress EntityAIBase should continue executing
 */
@Override public boolean shouldContinueExecuting(){
  return isOwnerNearAndSitting();
}
Program: 109750
Project: 109750
Buggy source:
@Override public void resetTask(){
  this.entity.dismountRidingEntity();
  this.entity.setSitting(false);
}

Fixed version (ground truth):
@Override public void resetTask(){
  this.entity.dismountRidingEntity();
  this.entity.setSitting(false);
  this.aiSit.setSitting(false);
  this.entity.resetRideCooldown();
}
Program: 109751
Project: 109751
Buggy source:
@Override public boolean shouldExecute(){
  if (this.entity.getOwner() == null || this.entity == null)   return false;
  return isOwnerNear() && isEmptyChairNear();
}

Fixed version (ground truth):
@Override public boolean shouldExecute(){
  if (!this.entity.isTamed() || this.entity == null)   return false;
  return isOwnerNearAndSitting();
}
Program: 109752
Project: 109752
Buggy source:
private boolean isOwnerNear(){
  return this.entity.getOwner() != null && this.entity != null && this.entity.getOwner().getDistanceSq(this.entity) < 16D;
}

Fixed version (ground truth):
private boolean isOwnerNear(){
  return this.entity.getOwner() != null && this.entity != null && this.entity.getOwner().getDistanceSq(this.entity) < 32D;
}
Program: 109753
Project: 109753
Buggy source:
private boolean isEmptyChairNear(){
  List<EntityChair> list=this.entity.world.<EntityChair>getEntitiesWithinAABB(EntityChair.class,this.entity.getEntityBoundingBox().grow(16D));
  boolean emptyChairFound=false;
  if (!list.isEmpty()) {
    for (    EntityChair chair : list) {
      if (!chair.isInvisible()) {
        if (!chair.isBeingRidden()) {
          emptyChairFound=true;
        }
      }
    }
  }
  return emptyChairFound;
}

Fixed version (ground truth):
private boolean isEmptyChairNear(){
  List<EntityChair> list=this.entity.world.<EntityChair>getEntitiesWithinAABB(EntityChair.class,this.entity.getEntityBoundingBox().grow(32D));
  boolean emptyChairFound=false;
  if (!list.isEmpty()) {
    for (    EntityChair chair : list) {
      if (!chair.isInvisible()) {
        if (!chair.isBeingRidden()) {
          emptyChairFound=true;
        }
      }
    }
  }
  return emptyChairFound;
}
Program: 109754
Project: 109754
Buggy source:
/** 
 * Execute a one shot task or start executing a continuous task
 */
@Override public void startExecuting(){
  List<EntityChair> list=this.entity.world.<EntityChair>getEntitiesWithinAABB(EntityChair.class,this.entity.getEntityBoundingBox().grow(16D));
  if (!list.isEmpty()) {
    for (    EntityChair chair : list) {
      if (!chair.isInvisible()) {
        if (!chair.isBeingRidden()) {
          this.entity.startRiding(chair);
          this.entity.setSitting(true);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Execute a one shot task or start executing a continuous task
 */
@Override public void startExecuting(){
  List<EntityChair> list=this.entity.world.<EntityChair>getEntitiesWithinAABB(EntityChair.class,this.entity.getEntityBoundingBox().grow(32D));
  if (!list.isEmpty()) {
    for (    EntityChair chair : list) {
      if (!chair.isInvisible()) {
        if (!chair.isBeingRidden()) {
          this.entity.setSitting(true);
          this.aiSit.setSitting(true);
          this.entity.startRiding(chair);
          return;
        }
      }
    }
  }
}
Program: 109755
Project: 109755
Buggy source:
@Override public boolean shouldContinueExecuting(){
  return selfHoldingDrink(Drink.pinaColada);
}

Fixed version (ground truth):
@Override public boolean shouldContinueExecuting(){
  return this.entity.selfHoldingDrink(Drink.pinaColada);
}
Program: 109756
Project: 109756
Buggy source:
@Override public boolean shouldExecute(){
  return selfHoldingDrink(Drink.pinaColada);
}

Fixed version (ground truth):
@Override public boolean shouldExecute(){
  return this.entity.selfHoldingDrink(Drink.pinaColada);
}
Program: 109757
Project: 109757
Buggy source:
@Override public boolean shouldContinueExecuting(){
  return entity.followingHoldingPinaColada() && !selfHoldingDrink(Drink.pinaColada);
}

Fixed version (ground truth):
@Override public boolean shouldContinueExecuting(){
  return entity.getOwner() == null && entity.followingHoldingPinaColada() && !selfHoldingDrink(Drink.pinaColada);
}
Program: 109758
Project: 109758
Buggy source:
@Override public boolean shouldExecute(){
  return entity.followingHoldingPinaColada() && !selfHoldingDrink(Drink.pinaColada) && entity.isAngry();
}

Fixed version (ground truth):
@Override public boolean shouldExecute(){
  return entity.getOwner() == null && entity.followingHoldingPinaColada() && !selfHoldingDrink(Drink.pinaColada) && entity.isAngry();
}
Program: 109759
Project: 109759
Buggy source:
@Override protected void initEntityAI(){
  super.initEntityAI();
  this.aiSit=new EntityAISit(this);
  this.tasks.addTask(1,new EntityAISwimming(this));
  this.tasks.addTask(3,new EntityAIMonkeyFollowNearestWithCondition(this,1.0D,2.0F,10.0F,followPredicate));
  this.tasks.addTask(3,new EntityAIMonkeyLeap(this,0.4F));
  this.tasks.addTask(2,new EntityAIStealDrink(this));
  this.tasks.addTask(2,new EntityAISitAndDrink(this));
  this.tasks.addTask(4,new EntityAIMonkeySitInChair(this));
  this.tasks.addTask(4,this.aiSit);
  this.tasks.addTask(5,new EntityAIAttackMelee(this,1.0D,true));
  this.tasks.addTask(6,new EntityAIFollowOwner(this,1.0D,10.0F,2.0F));
  this.tasks.addTask(7,new EntityAIWander(this,1.0D));
  this.tasks.addTask(9,new EntityAIWatchClosest(this,EntityPlayer.class,8.0F));
  this.tasks.addTask(9,new EntityAILookIdle(this));
  this.targetTasks.addTask(1,new EntityAIOwnerHurtByTarget(this));
  this.targetTasks.addTask(2,new EntityAIOwnerHurtTarget(this));
  this.targetTasks.addTask(3,new EntityAIHurtByTarget(this,true,new Class[0]));
}

Fixed version (ground truth):
@Override protected void initEntityAI(){
  super.initEntityAI();
  this.aiSit=new EntityAIMonkeySit(this);
  this.tasks.addTask(1,new EntityAISwimming(this));
  this.tasks.addTask(3,new EntityAIMonkeyFollowNearestWithCondition(this,1.0D,2.0F,10.0F,followPredicate));
  this.tasks.addTask(3,new EntityAIMonkeyLeap(this,0.4F));
  this.tasks.addTask(2,new EntityAIStealDrink(this));
  this.tasks.addTask(2,new EntityAISitAndDrink(this));
  this.tasks.addTask(4,new EntityAIMonkeySitInChair(this,this.aiSit));
  this.tasks.addTask(4,this.aiSit);
  this.tasks.addTask(6,new EntityAIAttackMelee(this,1.0D,true));
  this.tasks.addTask(7,new EntityAIFollowOwner(this,1.0D,10.0F,2.0F));
  this.tasks.addTask(8,new EntityAIWander(this,1.0D));
  this.tasks.addTask(9,new EntityAIWatchClosest(this,EntityPlayer.class,8.0F));
  this.tasks.addTask(9,new EntityAILookIdle(this));
  this.targetTasks.addTask(1,new EntityAIOwnerHurtByTarget(this));
  this.targetTasks.addTask(2,new EntityAIOwnerHurtTarget(this));
  this.targetTasks.addTask(3,new EntityAIHurtByTarget(this,true,new Class[0]));
}
Program: 109760
Project: 109760
Buggy source:
@Override public boolean processInteract(EntityPlayer player,EnumHand hand){
  ItemStack stack=player.getHeldItem(hand);
  if (this.isTamed()) {
    if (this.isOwner(player) && !this.world.isRemote && !stack.isEmpty()&& !this.isBreedingItem(stack)) {
      this.aiSit.setSitting(!this.isSitting());
      this.isJumping=false;
      this.navigator.clearPath();
      this.setAttackTarget((EntityLivingBase)null);
    }
  }
 else   if (!stack.isEmpty() && stack.getItem() == ItemRegistry.cocktail) {
    if (!player.capabilities.isCreativeMode) {
      stack.shrink(1);
    }
    if (!this.world.isRemote) {
      if (this.rand.nextInt(3) == 0) {
        this.setTamed(true);
        this.navigator.clearPath();
        this.setAttackTarget((EntityLivingBase)null);
        this.aiSit.setSitting(true);
        this.setHealth(20.0F);
        this.setOwnerId(player.getUniqueID());
        this.playTameEffect(true);
        this.world.setEntityState(this,(byte)7);
      }
 else {
        this.playTameEffect(false);
        this.world.setEntityState(this,(byte)6);
      }
    }
    return true;
  }
  return super.processInteract(player,hand);
}

Fixed version (ground truth):
@Override public boolean processInteract(EntityPlayer player,EnumHand hand){
  ItemStack stack=player.getHeldItem(hand);
  if (this.isTamed()) {
    if (this.isOwner(player) && !this.world.isRemote) {
      System.out.println("String_Node_Str" + ((EntityAIMonkeySit)this.aiSit).getSitting());
      this.aiSit.setSitting(!this.isSitting());
      this.isJumping=false;
      this.navigator.clearPath();
      this.setAttackTarget((EntityLivingBase)null);
      this.setAngry(false);
    }
  }
 else   if (!stack.isEmpty() && stack.getItem() == ItemRegistry.cocktail) {
    if (!player.capabilities.isCreativeMode) {
      stack.shrink(1);
    }
    if (!this.world.isRemote) {
      if (this.rand.nextInt(3) == 0) {
        this.setTamed(true);
        this.navigator.clearPath();
        this.setAttackTarget((EntityLivingBase)null);
        this.aiSit.setSitting(true);
        this.setHealth(20.0F);
        this.setOwnerId(player.getUniqueID());
        this.playTameEffect(true);
        this.world.setEntityState(this,(byte)7);
      }
 else {
        this.playTameEffect(false);
        this.world.setEntityState(this,(byte)6);
      }
    }
    return true;
  }
  return super.processInteract(player,hand);
}
Program: 109761
Project: 109761
Buggy source:
private boolean isFullyGrown(IBlockState state){
  return ((Integer)state.getValue(STAGE)) == TOTAL_GROW_TICKS;
}

Fixed version (ground truth):
private boolean isFullyGrown(IBlockState state){
  return ((Integer)state.getValue(STAGE)) == TOTAL_GROW_TICKS || ((PlantHalf)state.getValue(BlockTallPlant.HALF)) == PlantHalf.UPPER;
}
Program: 109762
Project: 109762
Buggy source:
@SubscribeEvent public void handlePineappleBreakEvent(HarvestDropsEvent event){
  EntityPlayer player=event.getHarvester();
  if (player == null) {
    return;
  }
  ItemStack held=player.getHeldItemMainhand();
  IBlockState state=event.getState();
  if (state.getBlock() != BlockRegistry.pineapple) {
    return;
  }
  IBlockState stateUp=event.getWorld().getBlockState(event.getPos().up());
  boolean isTop=state.getValue(BlockPineapple.HALF) == PlantHalf.UPPER;
  boolean isGrown=isTop || (state.getValue(BlockPineapple.STAGE) == BlockPineapple.TOTAL_GROW_TICKS && stateUp.getBlock() instanceof BlockPineapple && stateUp.getValue(BlockPineapple.HALF) == PlantHalf.UPPER);
  if (isGrown) {
    if (held != null && held.getItem() instanceof ItemSword) {
      event.getDrops().add(new ItemStack(ItemRegistry.pineappleCubes,event.getWorld().rand.nextInt(3) + 2));
    }
 else {
      event.getDrops().add(new ItemStack(BlockRegistry.pineapple));
    }
  }
  if (!isTop) {
    event.getWorld().setBlockToAir(event.getPos().up());
  }
}

Fixed version (ground truth):
@SubscribeEvent public void handlePineappleBreakEvent(HarvestDropsEvent event){
  EntityPlayer player=event.getHarvester();
  ItemStack held=ItemStack.EMPTY;
  if (player != null)   held=player.getHeldItemMainhand();
  IBlockState state=event.getState();
  if (state.getBlock() != BlockRegistry.pineapple) {
    return;
  }
  IBlockState stateUp=event.getWorld().getBlockState(event.getPos().up());
  boolean isTop=state.getValue(BlockPineapple.HALF) == PlantHalf.UPPER;
  boolean isGrown=isTop || (state.getValue(BlockPineapple.HALF) == PlantHalf.LOWER && stateUp.getBlock() instanceof BlockPineapple && stateUp.getValue(BlockPineapple.HALF) == PlantHalf.UPPER);
  if (isGrown) {
    if (!held.isEmpty() && held.getItem() instanceof ItemSword) {
      event.getDrops().add(new ItemStack(ItemRegistry.pineappleCubes,event.getWorld().rand.nextInt(3) + 2));
    }
 else {
      event.getDrops().add(new ItemStack(BlockRegistry.pineapple));
    }
  }
  if (!isTop) {
    event.getWorld().setBlockState(event.getPos(),state.withProperty(BlockPineapple.STAGE,Integer.valueOf(1)));
  }
}
Program: 109763
Project: 109763
Buggy source:
@Override public boolean onBlockActivated(@Nonnull World world,@Nonnull BlockPos pos,@Nonnull IBlockState state,@Nonnull EntityPlayer entityPlayer,@Nonnull EnumHand hand,@Nonnull EnumFacing side,float hitX,float hitY,float hitZ){
  if (world.isRemote) {
    return true;
  }
  ItemStack stack=entityPlayer.getHeldItemMainhand();
  TileEntityDrinkMixer mixer=(TileEntityDrinkMixer)world.getTileEntity(pos);
  if (mixer == null) {
    return false;
  }
  if (mixer.isDoneMixing()) {
    mixer.retrieveResult(entityPlayer);
    return true;
  }
  if (stack.isEmpty()) {
    mixer.emptyMixer(entityPlayer);
    return true;
  }
  ItemStack ingredientStack=stack.copy();
  ingredientStack.setCount(1);
  if (mixer.addToMixer(ingredientStack)) {
    entityPlayer.inventory.decrStackSize(entityPlayer.inventory.currentItem,1);
  }
  if (stack.getItem() == ItemRegistry.bambooMug && mixer.canMix()) {
    mixer.startMixing();
    entityPlayer.inventory.decrStackSize(entityPlayer.inventory.currentItem,1);
    Drink craftedDrink=MixerRecipes.getDrink(mixer.ingredients);
    Drink pinaColada=Drink.pinaColada;
    if (craftedDrink != null && craftedDrink.drinkId == pinaColada.drinkId) {
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onBlockActivated(@Nonnull World world,@Nonnull BlockPos pos,@Nonnull IBlockState state,@Nonnull EntityPlayer entityPlayer,@Nonnull EnumHand hand,@Nonnull EnumFacing side,float hitX,float hitY,float hitZ){
  if (world.isRemote) {
    return true;
  }
  ItemStack stack=entityPlayer.getHeldItemMainhand();
  TileEntityDrinkMixer mixer=(TileEntityDrinkMixer)world.getTileEntity(pos);
  if (mixer == null) {
    return false;
  }
  if (mixer.isDoneMixing()) {
    mixer.retrieveResult(entityPlayer);
    return true;
  }
  if (stack.isEmpty()) {
    mixer.emptyMixer(entityPlayer);
    return true;
  }
  ItemStack ingredientStack=stack.copy();
  ingredientStack.setCount(1);
  if (mixer.addToMixer(ingredientStack)) {
    entityPlayer.inventory.decrStackSize(entityPlayer.inventory.currentItem,1);
  }
  if (ingredientStack.getItem() == ItemRegistry.bambooMug && mixer.canMix()) {
    mixer.startMixing();
    entityPlayer.inventory.decrStackSize(entityPlayer.inventory.currentItem,1);
    Drink craftedDrink=MixerRecipes.getDrink(mixer.ingredients);
    Drink pinaColada=Drink.pinaColada;
    if (craftedDrink != null && craftedDrink.drinkId == pinaColada.drinkId) {
    }
  }
  return true;
}
Program: 109766
Project: 109766
Buggy source:
@Override public boolean onBlockActivated(World world,BlockPos pos,IBlockState state,EntityPlayer entityPlayer,EnumHand hand,EnumFacing side,float hitX,float hitY,float hitZ){
  if (world.isRemote) {
    return true;
  }
  ItemStack stack=entityPlayer.getHeldItem(hand);
  TileEntitySifter tileentitysifta=(TileEntitySifter)world.getTileEntity(pos);
  if (tileentitysifta != null && !stack.isEmpty() && !tileentitysifta.isSifting()) {
    Item helditem=stack.getItem();
    if (helditem == Item.getItemFromBlock(Blocks.SAND) || (helditem == Item.getItemFromBlock(BlockRegistry.sands))) {
      entityPlayer.getHeldItemMainhand().shrink(1);
      tileentitysifta.addItemToSifter(stack);
      tileentitysifta.startSifting();
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onBlockActivated(World world,BlockPos pos,IBlockState state,EntityPlayer entityPlayer,EnumHand hand,EnumFacing side,float hitX,float hitY,float hitZ){
  if (world.isRemote) {
    return true;
  }
  ItemStack stack=entityPlayer.getHeldItem(hand);
  TileEntitySifter tileentitysifta=(TileEntitySifter)world.getTileEntity(pos);
  if (tileentitysifta != null && !stack.isEmpty() && !tileentitysifta.isSifting()) {
    Item helditem=stack.getItem();
    if (helditem == Item.getItemFromBlock(Blocks.SAND) || (helditem == Item.getItemFromBlock(BlockRegistry.sands))) {
      tileentitysifta.addItemToSifter(stack);
      tileentitysifta.startSifting();
      entityPlayer.getHeldItemMainhand().shrink(1);
    }
  }
  return true;
}
Program: 109767
Project: 109767
Buggy source:
/** 
 * Drop all the necessary blocks/items from the sifter after sifting is complete
 */
public void dumpResults(double x,double y,double z,SiftType type){
  if (type == SiftType.HEATED) {
    spawn(new ItemStack(BlockRegistry.sands,1,0),x,y,z);
  }
 else {
    dumpBeachResults(x,y,z);
  }
  this.syncInventory();
}

Fixed version (ground truth):
/** 
 * Drop all the necessary blocks/items from the sifter after sifting is complete
 */
public void dumpResults(double x,double y,double z,SiftType type){
  dumpBeachResults(x,y,z);
  this.syncInventory();
}
Program: 109768
Project: 109768
Buggy source:
/** 
 * Dump the items involved in regular sifting
 */
private void dumpBeachResults(double x,double y,double z){
  int dumpCount=rand.nextInt(3) + 1;
  ItemStack stack;
  spawn(new ItemStack(BlockRegistry.sands,1,0),x,y,z);
  while (dumpCount > 0) {
    dumpCount--;
    if (rand.nextInt(10) == 0) {
      stack=getRareItem();
    }
 else {
      stack=getCommonItem();
    }
    spawn(stack,x,y,z);
  }
}

Fixed version (ground truth):
/** 
 * Dump the items involved in regular sifting
 */
private void dumpBeachResults(double x,double y,double z){
  int dumpCount=rand.nextInt(3) + 1;
  ItemStack stack;
  while (dumpCount > 0) {
    dumpCount--;
    if (rand.nextInt(10) == 0) {
      stack=getRareItem();
    }
 else {
      stack=getCommonItem();
    }
    spawn(stack,x,y,z);
  }
}
Program: 109769
Project: 109769
Buggy source:
@Override public void renderTileEntityFast(TileSeaweed te,double x,double y,double z,float partialTicks,int destroyStage,float alpha,BufferBuilder buf){
  if (te == null) {
    return;
  }
  buf.setTranslation(x,y,z);
  Vec3d bot=new Vec3d(0.5,1,0.5).add(te.getOffset());
  Vec3d prevSway=new Vec3d(0,1,0);
  for (int i=0; i < te.getHeight(); i++) {
    Vec3d sway=computeSwayVector(te.getSwayAngle(),i,TropicraftRenderUtils.getElapsedTicks() + partialTicks + te.getSwayDelay());
    Vec3d top=bot.add(sway);
    int texture=i == te.getHeight() - 1 ? SPRITES.length - 1 : (te.getHeight() + i) % (SPRITES.length - 1);
    TextureAtlasSprite sprite=SPRITES[texture];
    renderQuad(buf,sprite,bot,top,sway,prevSway,new Vec3d(1,0,1));
    renderQuad(buf,sprite,bot,top,sway,prevSway,new Vec3d(-1,0,1));
    bot=top;
  }
  buf.setTranslation(0,0,0);
}

Fixed version (ground truth):
@Override public void renderTileEntityFast(TileSeaweed te,double x,double y,double z,float partialTicks,int destroyStage,float alpha,BufferBuilder buf){
  if (te == null) {
    return;
  }
  buf.setTranslation(x,y,z);
  Vec3d bot=new Vec3d(0.5,1,0.5).add(te.getOffset());
  Vec3d prevSway=new Vec3d(0,1,0);
  for (int i=0; i < te.getHeight(); i++) {
    Vec3d sway=computeSwayVector(te.getSwayAngle(),i,TropicraftRenderUtils.getElapsedTicks() + partialTicks + te.getSwayDelay());
    Vec3d top=bot.add(sway);
    int texture=i == te.getHeight() - 1 ? SPRITES.length - 1 : (te.getHeight() + i) % (SPRITES.length - 1);
    TextureAtlasSprite sprite=SPRITES[texture];
    renderQuad(buf,sprite,bot,top,sway,prevSway,new Vec3d(1,0,1));
    renderQuad(buf,sprite,bot,top,sway,prevSway,new Vec3d(-1,0,1));
    bot=top;
    prevSway=sway;
  }
  buf.setTranslation(0,0,0);
}
Program: 109770
Project: 109770
Buggy source:
@EventHandler public void init(FMLInitializationEvent event){
  TCPacketHandler.init();
  ItemRegistry.init();
  proxy.init();
  proxy.registerBooks();
  MinecraftForge.EVENT_BUS.register(new ItemEvents());
  MinecraftForge.EVENT_BUS.register(new BlockEvents());
  MinecraftForge.EVENT_BUS.register(new AchievementEvents());
  MinecraftForge.EVENT_BUS.register(new BuildEvents());
  MinecraftForge.EVENT_BUS.register(new MiscEvents());
  MinecraftForge.EVENT_BUS.register(new SpawnEvents());
  MinecraftForge.EVENT_BUS.register(new ScubaHandlerCommon());
  BiomeTropicraft.registerBiomes();
  GameRegistry.registerWorldGenerator(new TCWorldGenerator(),10);
  TropicraftWorldUtils.initializeDimension();
}

Fixed version (ground truth):
@EventHandler public void init(FMLInitializationEvent event){
  TCPacketHandler.init();
  proxy.init();
  proxy.registerBooks();
  SmeltingRegistry.init();
  MinecraftForge.EVENT_BUS.register(new ItemEvents());
  MinecraftForge.EVENT_BUS.register(new BlockEvents());
  MinecraftForge.EVENT_BUS.register(new AchievementEvents());
  MinecraftForge.EVENT_BUS.register(new BuildEvents());
  MinecraftForge.EVENT_BUS.register(new MiscEvents());
  MinecraftForge.EVENT_BUS.register(new SpawnEvents());
  MinecraftForge.EVENT_BUS.register(new ScubaHandlerCommon());
  BiomeTropicraft.registerBiomes();
  GameRegistry.registerWorldGenerator(new TCWorldGenerator(),10);
  TropicraftWorldUtils.initializeDimension();
}
Program: 109771
Project: 109771
Buggy source:
/** 
 * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
 */
@SideOnly(Side.CLIENT) public void getSubBlocks(Item item,CreativeTabs tab,List<ItemStack> list){
  for (int i=0; i < TropicraftLogs.values().length; i++) {
    list.add(new ItemStack(item,1,i));
  }
}

Fixed version (ground truth):
/** 
 * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
 */
@Override @SideOnly(Side.CLIENT) public void getSubBlocks(CreativeTabs tab,NonNullList<ItemStack> list){
  for (int i=0; i < TropicraftLogs.values().length; i++) {
    list.add(new ItemStack(this,1,i));
  }
}