nus-yam/ex-repair huggingface dataset:
Program: 42784
Project: 42784
Buggy source:
private void init(File outputDir,String outputFilename,Date startTime){
  if (outputDir == null) {
    throw new RuntimeException("String_Node_Str");
  }
 else   if (!outputDir.exists()) {
    outputDir.mkdirs();
  }
  File csvFile=new File(outputDir,outputFilename + "String_Node_Str");
  System.out.println("String_Node_Str" + outputFilename);
  try {
    csvOutstream=new PrintStream(csvFile);
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
    throw new RuntimeException("String_Node_Str" + csvFile + "String_Node_Str");
  }
  new Thread(new CsvWriter(csvOutstream)).start();
}

Fixed version (ground truth):
private void init(File outputDir,String outputFilename,Date startTime){
  if (outputDir == null) {
    throw new RuntimeException("String_Node_Str");
  }
 else   if (!outputDir.exists()) {
    if (!outputDir.mkdirs())     throw new RuntimeException("String_Node_Str");
  }
  File csvFile=new File(outputDir,outputFilename + "String_Node_Str");
  System.out.println("String_Node_Str" + outputFilename);
  try {
    csvOutstream=new PrintStream(csvFile,"String_Node_Str");
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
    throw new RuntimeException("String_Node_Str" + csvFile + "String_Node_Str");
  }
catch (  UnsupportedEncodingException e) {
    e.printStackTrace();
  }
  new Thread(new CsvWriter(csvOutstream)).start();
}
Program: 42785
Project: 42785
Buggy source:
/** 
 * Creates a new log file to record data in using the   {@link RobotLegger}
 */
public static void createLog(){
  getInstance();
  if (instance != null) {
    SimpleDateFormat df=new SimpleDateFormat("String_Node_Str");
    logFolder=new File(logDir,df.format(new Date()));
    logFolder.mkdirs();
    File msgFile=new File(logFolder,"String_Node_Str");
    sensor=new SensorLogger(logFolder,new Date());
    try {
      msgFile.createNewFile();
      Handler handler=new StreamHandler(new FileOutputStream(msgFile),new SimpleFormatter());
      instance.message.addHandler(handler);
      System.out.println("String_Node_Str" + msgFile.getAbsolutePath());
    }
 catch (    FileNotFoundException e) {
      e.printStackTrace();
      throw new RuntimeException("String_Node_Str" + msgFile + "String_Node_Str");
    }
catch (    IOException e) {
      e.printStackTrace();
      throw new RuntimeException("String_Node_Str" + msgFile + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Creates a new log file to record data in using the   {@link RobotLegger}
 */
public static void createLog(){
  getInstance();
  if (instance != null) {
    SimpleDateFormat df=new SimpleDateFormat("String_Node_Str");
    logFolder=new File(logDir,df.format(new Date()));
    if (!logFolder.mkdirs())     throw new RuntimeException("String_Node_Str");
    File msgFile=new File(logFolder,"String_Node_Str");
    sensor=new SensorLogger(logFolder,new Date());
    try {
      if (!msgFile.createNewFile())       throw new RuntimeException("String_Node_Str");
      Handler handler=new StreamHandler(new FileOutputStream(msgFile),new SimpleFormatter());
      instance.message.addHandler(handler);
      System.out.println("String_Node_Str" + msgFile.getAbsolutePath());
    }
 catch (    FileNotFoundException e) {
      e.printStackTrace();
      throw new RuntimeException("String_Node_Str" + msgFile + "String_Node_Str");
    }
catch (    IOException e) {
      e.printStackTrace();
      throw new RuntimeException("String_Node_Str" + msgFile + "String_Node_Str");
    }
  }
}
Program: 42786
Project: 42786
Buggy source:
/** 
 * Returns a reference to the one   {@link RobotLogger} object.If no  {@link RobotLogger} object exists, one will be constructed.
 * @return a reference to the one {@link RobotLogger} object
 */
public static RobotLogger getInstance(){
  if (instance == null) {
    logDir=new File(Config.LOG_FILE_LOCATION);
    logDir.mkdirs();
    try {
      instance=new RobotLogger(logDir);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  return instance;
}

Fixed version (ground truth):
/** 
 * Returns a reference to the one   {@link RobotLogger} object.If no  {@link RobotLogger} object exists, one will be constructed.
 * @return a reference to the one {@link RobotLogger} object
 */
public static RobotLogger getInstance(){
  if (instance == null) {
    logDir=new File(Config.LOG_FILE_LOCATION);
    if (!logDir.mkdirs())     throw new RuntimeException("String_Node_Str");
    try {
      instance=new RobotLogger(logDir);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  return instance;
}
Program: 42787
Project: 42787
Buggy source:
/** 
 * Construct a new   {@link SensorLogger} object
 * @param outputDir {@link File} of the output file directory
 * @param startTime {@link Date} of the start time of the logger
 */
public SensorLogger(File outputDir,Date startTime){
  if (outputDir == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
 else   if (!outputDir.exists()) {
    outputDir.mkdirs();
  }
  File logFile=new File(outputDir,"String_Node_Str");
  System.out.println("String_Node_Str" + logFile.getAbsolutePath());
  try {
    log=new PrintStream(logFile);
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
    throw new RuntimeException("String_Node_Str" + logFile + "String_Node_Str");
  }
  logQueue=startLoggingThread(log);
  subscribers=new ArrayList<Subscriber>();
  for (  NodeChannel channel : NodeChannel.values()) {
    subscribers.add(new Subscriber(channel.getMsgPath(),new MessageListener(){
      @Override public void actionPerformed(      String topicName,      Message m){
        logQueue.offer(topicName + "String_Node_Str" + m.toLogString());
      }
    }
));
  }
}

Fixed version (ground truth):
/** 
 * Construct a new   {@link SensorLogger} object
 * @param outputDir {@link File} of the output file directory
 * @param startTime {@link Date} of the start time of the logger
 */
public SensorLogger(File outputDir,Date startTime){
  if (outputDir == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
 else   if (!outputDir.exists()) {
    if (!outputDir.mkdirs())     throw new RuntimeException("String_Node_Str");
  }
  File logFile=new File(outputDir,"String_Node_Str");
  System.out.println("String_Node_Str" + logFile.getAbsolutePath());
  try {
    log=new PrintStream(logFile,"String_Node_Str");
  }
 catch (  FileNotFoundException|UnsupportedEncodingException e) {
    e.printStackTrace();
    throw new RuntimeException("String_Node_Str" + logFile + "String_Node_Str");
  }
  logQueue=startLoggingThread(log);
  subscribers=new ArrayList<Subscriber>();
  for (  NodeChannel channel : NodeChannel.values()) {
    subscribers.add(new Subscriber(channel.getMsgPath(),new MessageListener(){
      @Override public void actionPerformed(      String topicName,      Message m){
        logQueue.offer(topicName + "String_Node_Str" + m.toLogString());
      }
    }
));
  }
}
Program: 42790
Project: 42790
Buggy source:
@SuppressWarnings("String_Node_Str") public static JSONObject translatePeelMessageToJObject(String message){
  JSONObject data=new JSONObject();
  JSONObject params=new JSONObject();
  String[] messageData=message.split("String_Node_Str");
  params.put("String_Node_Str",Float.valueOf(messageData[3]));
  params.put("String_Node_Str",messageData[4]);
  params.put("String_Node_Str",Float.valueOf(messageData[5]));
  params.put("String_Node_Str",messageData[6]);
  params.put("String_Node_Str",messageData[7]);
  params.put("String_Node_Str",messageData[8]);
  params.put("String_Node_Str",Float.valueOf(messageData[9]));
  params.put("String_Node_Str",Float.valueOf(messageData[10]));
  data.put("String_Node_Str",messageData[1]);
  data.put("String_Node_Str","String_Node_Str");
  data.put("String_Node_Str",params);
  return data;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static JSONObject translatePeelMessageToJObject(String message){
  JSONObject data=new JSONObject();
  JSONObject params=new JSONObject();
  String[] messageData=message.split("String_Node_Str");
  params.put("String_Node_Str",Double.valueOf(messageData[3]));
  params.put("String_Node_Str",messageData[4]);
  params.put("String_Node_Str",Double.valueOf(messageData[5]));
  params.put("String_Node_Str",messageData[6]);
  params.put("String_Node_Str",messageData[7]);
  params.put("String_Node_Str",messageData[8]);
  params.put("String_Node_Str",Double.valueOf(messageData[9]));
  params.put("String_Node_Str",Float.valueOf(messageData[10]));
  data.put("String_Node_Str",messageData[1]);
  data.put("String_Node_Str","String_Node_Str");
  data.put("String_Node_Str",params);
  return data;
}
Program: 42791
Project: 42791
Buggy source:
@Override public int peel(byte[] buffer,int start,int bytes_available){
  RBPair rbp=RBSerial.peel(buffer,start,bytes_available);
switch (rbp.getNumberOfBytesRead()) {
case 0:
    return 0;
case 1:
  return 1;
case 6:
break;
default :
{
System.out.println("String_Node_Str");
}
}
RBSerialMessage message=rbp.getMessage();
if (message.getHeaderByte() == RBSerialMessage.ENC_TICK_SINCE_RESET) {
encTicks=message.getDataWord() & 0xFFF;
messagePub_enc.publish(estimateVelocity(message.getDataWord()));
System.out.println(encTicks);
}
 else if (message.getHeaderByte() == RBSerialMessage.RBSM_MID_MEGA_STEER_FEEDBACK) {
potValue=message.getDataWord();
System.out.println(potValue);
messagePub_pot.publish(new SteeringMeasurement(-(potValue + OFFSET) / ARD_TO_DEG));
}
 else if (message.getHeaderByte() == RBSerialMessage.FP_HASH) {
System.out.println(message.getDataWord());
}
return 6;
}

Fixed version (ground truth):
@Override public int peel(byte[] buffer,int start,int bytes_available){
  RBPair rbp=RBSerial.peel(buffer,start,bytes_available);
switch (rbp.getNumberOfBytesRead()) {
case 0:
    return 0;
  break;
case 1:
return 1;
break;
case 6:
break;
default :
{
System.out.println("String_Node_Str");
break;
}
}
RBSerialMessage message=rbp.getMessage();
if (message.getHeaderByte() == RBSerialMessage.ENC_TICK_SINCE_RESET) {
encTicks=message.getDataWord() & 0xFFF;
messagePub_enc.publish(estimateVelocity(message.getDataWord()));
System.out.println(encTicks);
}
 else if (message.getHeaderByte() == RBSerialMessage.RBSM_MID_MEGA_STEER_FEEDBACK) {
potValue=message.getDataWord();
System.out.println(potValue);
messagePub_pot.publish(new SteeringMeasurement(-(potValue + OFFSET) / ARD_TO_DEG));
}
 else if (message.getHeaderByte() == RBSerialMessage.FP_HASH) {
System.out.println(message.getDataWord());
}
return 6;
}
Program: 42792
Project: 42792
Buggy source:
public ControlPanel(){
  logging_button_pub=new Publisher(SensorChannel.GUI_LOGGING_BUTTON.getMsgPath());
  timer=new Timer(10,new timerHandler());
  timer.setDelay(100);
  timer.setRepeats(true);
  startTime=new Date(0);
  this.setBorder(BorderFactory.createLineBorder(Color.black));
  this.setLayout(new GridBagLayout());
  this.setBackground(Color.DARK_GRAY);
  GridBagConstraints gbc=new GridBagConstraints();
  gbc.weightx=1;
  gbc.weighty=0.5;
  gbc.gridx=0;
  gbc.gridy=0;
  gbc.fill=GridBagConstraints.BOTH;
  addLoggingPanel(gbc);
  gbc.gridy=1;
  addSensorSwitchPanel(gbc);
}

Fixed version (ground truth):
public ControlPanel(){
  logging_button_pub=new Publisher(SensorChannel.GUI_LOGGING_BUTTON.getMsgPath());
  timer=new Timer(10,new timerHandler());
  timer.setDelay(100);
  timer.setRepeats(true);
  startTime=new Date();
  this.setBorder(BorderFactory.createLineBorder(Color.black));
  this.setLayout(new GridBagLayout());
  this.setBackground(Color.DARK_GRAY);
  GridBagConstraints gbc=new GridBagConstraints();
  gbc.weightx=1;
  gbc.weighty=0.5;
  gbc.gridx=0;
  gbc.gridy=0;
  gbc.fill=GridBagConstraints.BOTH;
  addLoggingPanel(gbc);
  gbc.gridy=1;
  addSensorSwitchPanel(gbc);
}
Program: 42793
Project: 42793
Buggy source:
@Override public int baudRate(){
  return 9600;
}

Fixed version (ground truth):
@Override public int baudRate(){
  return 115200;
}
Program: 42794
Project: 42794
Buggy source:
@Override public int peel(byte[] buffer,int start,int bytes_available){
  RBPair rbp=RBSerial.peel(buffer,start,bytes_available);
switch (rbp.getNumberOfBytesRead()) {
case 0:
    return 0;
case 1:
  return 1;
case 6:
break;
default :
{
System.out.println("String_Node_Str");
}
}
RBSerialMessage message=rbp.getMessage();
if (message.getHeaderByte() == RBSerialMessage.ENC_TICKS_SINCE_LAST) {
encTicks+=message.getDataWord();
estimateVelocity(message.getDataWord());
System.out.println(encTicks);
}
if (message.getHeaderByte() == RBSerialMessage.RBSM_MID_MEGA_STEER_FEEDBACK) {
potValue=message.getDataWord();
System.out.println(potValue);
messagePub_pot.publish(new SteeringMeasurement(potValue));
}
return 6;
}

Fixed version (ground truth):
@Override public int peel(byte[] buffer,int start,int bytes_available){
  RBPair rbp=RBSerial.peel(buffer,start,bytes_available);
switch (rbp.getNumberOfBytesRead()) {
case 0:
    return 0;
case 1:
  return 1;
case 6:
break;
default :
{
System.out.println("String_Node_Str");
}
}
RBSerialMessage message=rbp.getMessage();
if (message.getHeaderByte() == RBSerialMessage.ENC_TICK_SINCE_RESET) {
encTicks=message.getDataWord() & 0xFFF;
estimateVelocity(message.getDataWord());
System.out.println(encTicks);
}
if (message.getHeaderByte() == RBSerialMessage.RBSM_MID_MEGA_STEER_FEEDBACK) {
potValue=message.getDataWord();
System.out.println(potValue);
messagePub_pot.publish(new SteeringMeasurement(potValue));
}
return 6;
}
Program: 42795
Project: 42795
Buggy source:
private static int parseInt(byte[] buf,int start,int num_elements){
  int val=0;
  val|=buf[(start + 1) % buf.length];
  val=val << 0x8;
  val|=buf[(start + 2) % buf.length];
  val=val << 0x8;
  val|=buf[(start + 3) % buf.length];
  val=val << 0x8;
  val|=buf[(start + 4) % buf.length];
  return val;
}

Fixed version (ground truth):
private static int parseInt(byte[] buf,int start,int num_elements){
  int val=0;
  val+=(int)buf[(start + 1) % buf.length] & 0xff;
  val=val << 0x8;
  val+=(int)buf[(start + 2) % buf.length] & 0xff;
  val=val << 0x8;
  val+=(int)buf[(start + 3) % buf.length] & 0xff;
  val=val << 0x8;
  val+=(int)buf[(start + 4) % buf.length] & 0xff;
  return val;
}
Program: 42796
Project: 42796
Buggy source:
public static boolean isValidHeader(byte headerByte){
switch (headerByte) {
default :
    return false;
case ENC_MS_SINCE_RESET:
case ENC_TICK_SINCE_RESET:
case ENC_TICKS_SINCE_LAST:
case STEERING:
case BRAKE:
case AUTO:
case BATTERY:
case ERROR:
case DEVICE_ID:
  return true;
}
}

Fixed version (ground truth):
public static boolean isValidHeader(byte headerByte){
switch (headerByte) {
default :
    return false;
case ENC_MS_SINCE_RESET:
case ENC_TICK_SINCE_RESET:
case ENC_TICKS_SINCE_LAST:
case STEERING:
case BRAKE:
case AUTO:
case BATTERY:
case RBSM_MID_MEGA_STEER_FEEDBACK:
case ERROR:
case DEVICE_ID:
  return true;
}
}
Program: 42797
Project: 42797
Buggy source:
@Override public long timeOfLastUpdate(){
  return 0;
}

Fixed version (ground truth):
public long timeOfLastUpdate(){
  return 0;
}
Program: 42798
Project: 42798
Buggy source:
@Override public SensorState getState(){
  return this.state;
}

Fixed version (ground truth):
public SensorState getState(){
  return this.state;
}
Program: 42799
Project: 42799
Buggy source:
@Override public boolean isConnected(){
  return this.connected;
}

Fixed version (ground truth):
public boolean isConnected(){
  return this.connected;
}
Program: 42800
Project: 42800
Buggy source:
@Override public boolean close(){
  if (connected) {
    try {
      frontFeed.release();
    }
 catch (    Exception e) {
      System.out.println("String_Node_Str");
    }
    try {
      rearFeed.release();
    }
 catch (    Exception e) {
      System.out.println("String_Node_Str");
    }
    frontPanel.setVisible(false);
    rearPanel.setVisible(false);
  }
  connected=false;
  state=SensorState.DISCONNECTED;
  return false;
}

Fixed version (ground truth):
public boolean close(){
  if (connected) {
    try {
      frontFeed.release();
    }
 catch (    Exception e) {
      System.out.println("String_Node_Str");
    }
    try {
      rearFeed.release();
    }
 catch (    Exception e) {
      System.out.println("String_Node_Str");
    }
    frontPanel.setVisible(false);
    rearPanel.setVisible(false);
  }
  connected=false;
  state=SensorState.DISCONNECTED;
  return false;
}
Program: 42801
Project: 42801
Buggy source:
@Override public SensorType getSensorType(){
  return this.sensorType;
}

Fixed version (ground truth):
public SensorType getSensorType(){
  return this.sensorType;
}
Program: 42802
Project: 42802
Buggy source:
private void step(){
  while (true) {
    encoderPub.publish(new EncoderMeasurement(10,2));
    gpsPub.publish(new GpsMeasurement(42.00f,-76.00f));
    imuPub.publish(new ImuMeasurement(0,0,1,2,3,4,5,6,7));
    reqAnglePub.publish(new RemoteWheelAngleRequest(0.5));
    try {
      Thread.sleep(5000);
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
private void step(){
  while (true) {
    encoderPub.publish(new EncoderMeasurement(10,2));
    gpsPub.publish(new GpsMeasurement(null,null,42.00f,false,-76.00f,false,0,0,brake_down,brake_down));
    imuPub.publish(new ImuMeasurement(0,0,1,2,3,4,5,6,7));
    reqAnglePub.publish(new RemoteWheelAngleRequest(0.5));
    try {
      Thread.sleep(5000);
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
  }
}
Program: 42803
Project: 42803
Buggy source:
private void findPort(int baudrate,String header,String owner){
  SerialPort port;
  CommPortIdentifier port_id;
  int TIMEOUT=0;
  int BUFFER_SIZE=512;
  InputStream input;
  OutputStream output;
  int index=0;
  boolean connected;
  char[] inputBuffer;
  Enumeration<CommPortIdentifier> port_list=CommPortIdentifier.getPortIdentifiers();
  while (port_list.hasMoreElements()) {
    port_id=(CommPortIdentifier)port_list.nextElement();
    if (port_id.getPortType() != CommPortIdentifier.PORT_SERIAL) {
      continue;
    }
    System.out.println("String_Node_Str" + port_id.getName());
    try {
      port=(SerialPort)port_id.open(owner,TIMEOUT);
      port.setInputBufferSize(BUFFER_SIZE);
      port.setSerialPortParams(baudrate,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);
      input=port.getInputStream();
      output=port.getOutputStream();
      if (isCorrectPort(input,header,512)) {
        port.notifyOnDataAvailable(true);
        inputBuffer=new char[BUFFER_SIZE];
        index=0;
        connected=true;
        port.addEventListener(this);
        System.out.println("String_Node_Str" + port.getName());
        return;
      }
      port.close();
      input.close();
      output.close();
    }
 catch (    PortInUseException e) {
    }
catch (    Exception e) {
      e.printStackTrace();
    }
  }
  System.out.println("String_Node_Str" + owner);
}

Fixed version (ground truth):
private void findPort(int baudrate,String header,String owner,SerialNode sn){
  SerialPort port;
  CommPortIdentifier port_id;
  int TIMEOUT=0;
  int BUFFER_SIZE=512;
  InputStream input;
  OutputStream output;
  int index=0;
  boolean connected;
  char[] inputBuffer;
  Enumeration<CommPortIdentifier> port_list=CommPortIdentifier.getPortIdentifiers();
  while (port_list.hasMoreElements()) {
    port_id=(CommPortIdentifier)port_list.nextElement();
    if (port_id.getPortType() != CommPortIdentifier.PORT_SERIAL) {
      continue;
    }
    System.out.println("String_Node_Str" + port_id.getName());
    try {
      port=(SerialPort)port_id.open(owner,TIMEOUT);
      port.setInputBufferSize(BUFFER_SIZE);
      port.setSerialPortParams(baudrate,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);
      input=port.getInputStream();
      output=port.getOutputStream();
      if (isCorrectPort(sn,input,header,512)) {
        port.notifyOnDataAvailable(true);
        inputBuffer=new char[BUFFER_SIZE];
        index=0;
        connected=true;
        System.out.println("String_Node_Str" + port.getName());
        return;
      }
      port.close();
      input.close();
      output.close();
    }
 catch (    PortInUseException e) {
    }
catch (    Exception e) {
      e.printStackTrace();
    }
  }
  System.out.println("String_Node_Str" + owner);
}
Program: 42804
Project: 42804
Buggy source:
@Override public int peel(byte[] buffer,int start,int bytes_available){
  RBPair rbp=RBSerial.peel(buffer,start,bytes_available);
  int bytes_read=rbp.get_num_bytes_read();
  RBSerialMessage message=rbp.getMessage();
  byte b=message.getHeaderByte();
  if (b == RBSerialMessage.BRAKE) {
  }
 else   if (b == RBSerialMessage.STEERING) {
  }
 else   if (b == RBSerialMessage.DEVICE_ID) {
  }
  return bytes_read;
}

Fixed version (ground truth):
@Override public int peel(byte[] buffer,int start,int bytes_available){
  RBPair rbp=RBSerial.peel(buffer,start,bytes_available);
  int bytes_read=rbp.getNumberOfBytesRead();
  RBSerialMessage message=rbp.getMessage();
  byte b=message.getHeaderByte();
  if (b == RBSerialMessage.BRAKE) {
  }
 else   if (b == RBSerialMessage.STEERING) {
  }
 else   if (b == RBSerialMessage.DEVICE_ID) {
  }
  return bytes_read;
}
Program: 42805
Project: 42805
Buggy source:
public static void UpdateImu(float aX,float aY,float aZ,float rX,float rY,float rZ,float mX,float mY,float mZ){
  if (config.logging) {
    RobotLogger rl=RobotLogger.getInstance();
    float[] acc={aX,aY,aZ};
    float[] gyro={rX,rY,rZ};
    float[] compass={mX,mY,mZ};
    if (config.active) {
    }
  }
}

Fixed version (ground truth):
public static void UpdateImu(float aX,float aY,float aZ,float rX,float rY,float rZ,float mX,float mY,float mZ){
  if (config.logging) {
    RobotLogger rl=RobotLogger.getInstance();
    float[] acc={aX,aY,aZ};
    float[] gyro={rX,rY,rZ};
    float[] compass={mX,mY,mZ};
    if (config.active) {
      rl.sensor.logImu(new Date().getTime(),acc,gyro,compass);
    }
  }
}
Program: 42806
Project: 42806
Buggy source:
public static void UpdateEnc(double distance,double velocity){
  if (config.logging) {
    RobotLogger rl=RobotLogger.getInstance();
    long time_in_millis=new Date().getTime();
  }
}

Fixed version (ground truth):
public static void UpdateEnc(int encTime,int encReset,int encTick){
  if (config.logging) {
    RobotLogger rl=RobotLogger.getInstance();
    if (config.active) {
      RobotLogger.sensor.logEncoder(new Date().getTime(),encTick,encReset,encTime);
    }
  }
}
Program: 42807
Project: 42807
Buggy source:
private Robot(){
  sensorList=new ArrayList<>();
  kf=new KalmanFilter();
  System.out.println("String_Node_Str");
  autonomous=config.AUTONOMUS_DEFAULT;
  if (config.getInstance().logging) {
    System.out.println("String_Node_Str");
    RobotLogger.getInstance();
  }
  System.out.println();
  if (config.GPS_DEFAULT) {
    System.out.println("String_Node_Str");
    gps=new Gps("String_Node_Str");
    sensorList.add(gps);
  }
  if (config.IMU_DEFAULT) {
    System.out.println("String_Node_Str");
    imu=new Imu("String_Node_Str");
    sensorList.add(imu);
  }
  if (config.ENCODER_DEFAULT) {
    System.out.println("String_Node_Str");
    encoder=new Encoder();
    sensorList.add(encoder);
  }
  if (config.DRIVE_DEFAULT) {
    System.out.println("String_Node_Str");
    mega=new DriveActuator();
    sensorList.add(mega);
  }
  if (config.VISION_SYSTEM_DEFAULT) {
  }
  if (config.active) {
  }
  if (autonomous) {
    System.out.println("String_Node_Str");
    alice=new Thread(new Planner());
    alice.start();
  }
  System.out.println();
}

Fixed version (ground truth):
private Robot(){
  sensorList=new ArrayList<>();
  kf=new KalmanFilter();
  System.out.println("String_Node_Str");
  autonomous=config.AUTONOMUS_DEFAULT;
  if (config.logging) {
    System.out.println("String_Node_Str");
    RobotLogger.getInstance();
  }
  System.out.println();
  if (config.GPS_DEFAULT) {
    System.out.println("String_Node_Str");
    gps=new Gps("String_Node_Str");
    sensorList.add(gps);
  }
  if (config.IMU_DEFAULT) {
    System.out.println("String_Node_Str");
    imu=new Imu("String_Node_Str");
    sensorList.add(imu);
  }
  if (config.ENCODER_DEFAULT) {
    System.out.println("String_Node_Str");
    encoder=new Encoder();
    sensorList.add(encoder);
  }
  if (config.DRIVE_DEFAULT) {
    System.out.println("String_Node_Str");
    mega=new DriveActuator();
    sensorList.add(mega);
  }
  if (config.VISION_SYSTEM_DEFAULT) {
  }
  if (config.active) {
  }
  if (autonomous) {
    System.out.println("String_Node_Str");
    alice=new Thread(new Planner());
    alice.start();
  }
  System.out.println();
}
Program: 42809
Project: 42809
Buggy source:
public DriveActuator(){
  super("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public DriveActuator(){
  super("String_Node_Str","String_Node_Str");
  thisSensorType=SensorType.GPS;
}
Program: 42810
Project: 42810
Buggy source:
public Encoder(){
  super("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public Encoder(){
  super("String_Node_Str","String_Node_Str");
  thisSensorType=SensorType.ENCODER;
}
Program: 42811
Project: 42811
Buggy source:
@Override public void publish(){
  float latitude=0, longitude=0;
  int state=0;
  String val="String_Node_Str";
  currentState=SensorState.ON;
  lastUpdateTime=System.currentTimeMillis();
  try {
    for (int i=0; i < index; i++) {
      if (inputBuffer[i] == '\n' || inputBuffer[i] == ',' || i == index) {
switch (state) {
case LAT_NUM:
          latitude=parseLat(val);
        break;
case LAT_DIR:
      if (val.equalsIgnoreCase("String_Node_Str"))       latitude=-1 * latitude;
    break;
case LONG_NUM:
  longitude=parseLon(val);
break;
case LONG_DIR:
if (val.equalsIgnoreCase("String_Node_Str")) longitude=-1 * longitude;
gpsPub.publish(new GpsMeasurement(latitude,longitude));
System.out.println("String_Node_Str" + latitude + "String_Node_Str"+ longitude);
return;
}
val="String_Node_Str";
state++;
}
 else val+=inputBuffer[i];
}
}
 catch (Exception e) {
System.out.println("String_Node_Str");
currentState=SensorState.ERROR;
}
}

Fixed version (ground truth):
@Override public void publish(){
  float latitude=0, longitude=0;
  int state=0;
  String val="String_Node_Str";
  currentState=SensorState.ON;
  lastUpdateTime=System.currentTimeMillis();
  try {
    for (int i=0; i < index; i++) {
      if (inputBuffer[i] == '\n' || inputBuffer[i] == ',' || i == index) {
switch (state) {
case LAT_NUM:
          latitude=parseLat(val);
        break;
case LAT_DIR:
      if (val.equalsIgnoreCase("String_Node_Str"))       latitude=-1 * latitude;
    break;
case LONG_NUM:
  longitude=parseLon(val);
break;
case LONG_DIR:
if (val.equalsIgnoreCase("String_Node_Str")) longitude=-1 * longitude;
publisher.publish(new GpsMeasurement(latitude,longitude));
System.out.println("String_Node_Str" + latitude + "String_Node_Str"+ longitude);
return;
}
val="String_Node_Str";
state++;
}
 else val+=inputBuffer[i];
}
}
 catch (Exception e) {
System.out.println("String_Node_Str");
currentState=SensorState.ERROR;
}
}
Program: 42812
Project: 42812
Buggy source:
public Gps(String publishPath){
  super("String_Node_Str",BAUDRATE,HEADER);
  gpsPub=new Publisher(publishPath);
}

Fixed version (ground truth):
public Gps(String publishPath){
  super("String_Node_Str",BAUDRATE,HEADER);
  publisher=new Publisher(publishPath);
  thisSensorType=SensorType.GPS;
}
Program: 42813
Project: 42813
Buggy source:
public Imu(String publishPath){
  super("String_Node_Str",BAUDRATE,HEADER);
  imuPub=new Publisher("String_Node_Str");
}

Fixed version (ground truth):
public Imu(String publishPath){
  super("String_Node_Str",BAUDRATE,HEADER);
  publisher=new Publisher("String_Node_Str");
  thisSensorType=SensorType.IMU;
}
Program: 42814
Project: 42814
Buggy source:
@Override public void publish(){
  float aX=0, aY=0, aZ=0, rX=0, rY=0, rZ=0, mX=0, mY=0, mZ=0;
  String val="String_Node_Str";
  int state=0;
  lastUpdateTime=System.currentTimeMillis();
  currentState=SensorState.ON;
  System.out.println("String_Node_Str" + currentState);
  try {
    for (int i=0; i < index; i++) {
      if (inputBuffer[i] == '\n' || inputBuffer[i] == ',' || i == index) {
switch (state) {
case AX:
          aX=Float.valueOf(val);
        break;
case AY:
      aY=Float.valueOf(val);
    break;
case AZ:
  aZ=Float.valueOf(val);
break;
case RX:
rX=Float.valueOf(val);
break;
case RY:
rY=Float.valueOf(val);
break;
case RZ:
rZ=Float.valueOf(val);
break;
case MX:
mX=Float.valueOf(val);
break;
case MY:
mY=Float.valueOf(val);
break;
case MZ:
mZ=Float.valueOf(val);
System.out.println("String_Node_Str" + aX + "String_Node_Str"+ aY+ "String_Node_Str"+ aZ+ "String_Node_Str"+ rX+ "String_Node_Str"+ rY+ "String_Node_Str"+ mX+ "String_Node_Str"+ mY+ "String_Node_Str"+ mZ);
Robot.UpdateImu(aX,aY,aZ,rX,rY,rZ,mX,mY,mZ);
imuPub.publish(new ImuMeasurement(aX,aY,aZ,rX,rY,rZ,mX,mY,mZ));
break;
}
val="String_Node_Str";
state++;
}
 else {
val+=inputBuffer[i];
}
}
}
 catch (Exception e) {
System.out.println("String_Node_Str");
currentState=SensorState.ERROR;
}
}

Fixed version (ground truth):
@Override public void publish(){
  float aX=0, aY=0, aZ=0, rX=0, rY=0, rZ=0, mX=0, mY=0, mZ=0;
  String val="String_Node_Str";
  int state=0;
  lastUpdateTime=System.currentTimeMillis();
  currentState=SensorState.ON;
  System.out.println("String_Node_Str" + currentState);
  try {
    for (int i=0; i < index; i++) {
      if (inputBuffer[i] == '\n' || inputBuffer[i] == ',' || i == index) {
switch (state) {
case AX:
          aX=Float.valueOf(val);
        break;
case AY:
      aY=Float.valueOf(val);
    break;
case AZ:
  aZ=Float.valueOf(val);
break;
case RX:
rX=Float.valueOf(val);
break;
case RY:
rY=Float.valueOf(val);
break;
case RZ:
rZ=Float.valueOf(val);
break;
case MX:
mX=Float.valueOf(val);
break;
case MY:
mY=Float.valueOf(val);
break;
case MZ:
mZ=Float.valueOf(val);
System.out.println("String_Node_Str" + aX + "String_Node_Str"+ aY+ "String_Node_Str"+ aZ+ "String_Node_Str"+ rX+ "String_Node_Str"+ rY+ "String_Node_Str"+ mX+ "String_Node_Str"+ mY+ "String_Node_Str"+ mZ);
Robot.UpdateImu(aX,aY,aZ,rX,rY,rZ,mX,mY,mZ);
publisher.publish(new ImuMeasurement(aX,aY,aZ,rX,rY,rZ,mX,mY,mZ));
break;
}
val="String_Node_Str";
state++;
}
 else {
val+=inputBuffer[i];
}
}
}
 catch (Exception e) {
System.out.println("String_Node_Str");
currentState=SensorState.ERROR;
}
}
Program: 42815
Project: 42815
Buggy source:
@SuppressWarnings("String_Node_Str") protected SerialConnection(String owner,int baud_rate,String header){
  port_list=CommPortIdentifier.getPortIdentifiers();
  connected=false;
  while (port_list.hasMoreElements()) {
    port_id=(CommPortIdentifier)port_list.nextElement();
    if (port_id.getPortType() == CommPortIdentifier.PORT_SERIAL) {
      System.out.println("String_Node_Str" + port_id.getName());
      try {
        port=(SerialPort)port_id.open(owner,TIMEOUT);
        port.setInputBufferSize(BUFFER_SIZE);
        port.setSerialPortParams(baud_rate,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);
        input=port.getInputStream();
        output=port.getOutputStream();
        if (isCorrectPort(input,header)) {
          port.notifyOnDataAvailable(true);
          inputBuffer=new char[BUFFER_SIZE];
          index=0;
          connected=true;
          port.addEventListener(this);
          System.out.println("String_Node_Str" + this.getName());
          return;
        }
        port.close();
        input.close();
        output.close();
      }
 catch (      PortInUseException e) {
      }
catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
  System.out.println("String_Node_Str" + owner);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") protected SerialConnection(String owner,int baud_rate,String header){
  port_list=CommPortIdentifier.getPortIdentifiers();
  connected=false;
  currentState=SensorState.DISCONECTED;
  lastUpdateTime=0;
  while (port_list.hasMoreElements()) {
    port_id=(CommPortIdentifier)port_list.nextElement();
    if (port_id.getPortType() == CommPortIdentifier.PORT_SERIAL) {
      System.out.println("String_Node_Str" + port_id.getName());
      try {
        port=(SerialPort)port_id.open(owner,TIMEOUT);
        port.setInputBufferSize(BUFFER_SIZE);
        port.setSerialPortParams(baud_rate,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);
        input=port.getInputStream();
        output=port.getOutputStream();
        if (isCorrectPort(input,header)) {
          port.notifyOnDataAvailable(true);
          inputBuffer=new char[BUFFER_SIZE];
          index=0;
          connected=true;
          currentState=SensorState.ON;
          port.addEventListener(this);
          System.out.println("String_Node_Str" + this.getName());
          return;
        }
        port.close();
        input.close();
        output.close();
      }
 catch (      PortInUseException e) {
      }
catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
  System.out.println("String_Node_Str" + owner);
}
Program: 42816
Project: 42816
Buggy source:
public void updatePanel(){
  System.out.println("String_Node_Str");
  gps_switch.setState(Robot.getInstance().getGpsState());
  gps_switch.repaint();
  IMU_switch.setState(Robot.getInstance().getImuState());
  IMU_switch.repaint();
  frontCam_switch.setState(Robot.getInstance().getFrontCamState());
  frontCam_switch.repaint();
  backCam_switch.setState(Robot.getInstance().getBackCamState());
  backCam_switch.repaint();
  encoders_switch.setState(Robot.getInstance().getEncoderState());
  encoders_switch.updateSensorMessage_lbl(Robot.getInstance().getEncoderMsg());
  encoders_switch.repaint();
  controlInputs_switch.setState(Robot.getInstance().getControlInputState());
  controlInputs_switch.repaint();
  updateStartPause_btn();
}

Fixed version (ground truth):
public void updatePanel(){
  System.out.println("String_Node_Str");
  Robot robot=Robot.getInstance();
  gps_switch.setState(robot.getGpsState());
  gps_switch.repaint();
  IMU_switch.setState(robot.getImuState());
  IMU_switch.repaint();
  frontCam_switch.setState(robot.getFrontCamState());
  frontCam_switch.repaint();
  backCam_switch.setState(robot.getBackCamState());
  backCam_switch.repaint();
  encoders_switch.setState(robot.getEncoderState());
  encoders_switch.updateSensorMessage_lbl(robot.getEncoderMsg());
  encoders_switch.repaint();
  controlInputs_switch.setState(robot.getControlInputState());
  controlInputs_switch.repaint();
  updateStartPause_btn();
}
Program: 42817
Project: 42817
Buggy source:
@Override public void run(){
  while (true) {
synchronized (local_inbox) {
      while (local_inbox.peek() != null) {
        try {
          local_inbox.wait();
        }
 catch (        InterruptedException ie) {
          System.out.println("String_Node_Str");
        }
        Message m=local_inbox.poll();
        if (m != null) {
          callback.actionPerformed(m);
        }
 else {
          System.out.println("String_Node_Str");
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
synchronized (local_inbox) {
    while (local_inbox.peek() != null) {
      try {
        local_inbox.wait();
      }
 catch (      InterruptedException ie) {
        System.out.println("String_Node_Str");
      }
      Message m=local_inbox.poll();
      if (m != null) {
        callback.actionPerformed(m);
      }
 else {
        System.out.println("String_Node_Str");
      }
    }
  }
}
Program: 42818
Project: 42818
Buggy source:
public FauxArduino(){
  System.out.println("String_Node_Str");
  int distance=0;
  while (true) {
    try {
      Thread.sleep(500);
    }
 catch (    InterruptedException ie) {
      throw new RuntimeException("String_Node_Str");
    }
    int speed=5;
    distance+=speed;
    encoderPub.publish(new EncoderMeasurement(distance,speed));
  }
}

Fixed version (ground truth):
public FauxArduino(){
  System.out.println("String_Node_Str");
  (new Thread(new Runnable(){
    @Override public void run(){
      int distance=0;
      int speed=5;
      while (true) {
        try {
          Thread.sleep(10000);
        }
 catch (        InterruptedException ie) {
          throw new RuntimeException("String_Node_Str");
        }
        distance+=speed;
        encoderPub.publish(new EncoderMeasurement(distance,speed));
        System.out.println("String_Node_Str");
      }
    }
  }
)).start();
}
Program: 42819
Project: 42819
Buggy source:
@Override public void run(){
  while (true) {
    Map.Entry<String,Message> request;
    try {
      request=inbox.take();
    }
 catch (    InterruptedException ie) {
      System.out.println("String_Node_Str");
      continue;
    }
    String topicName=request.getKey();
    Message m=request.getValue();
    outbox_lock.readLock().lock();
    List<Subscriber> subs=outbox_mapping.get(topicName);
    for (    Subscriber s : subs) {
      s.putMessage(m);
    }
    outbox_lock.readLock().unlock();
  }
}

Fixed version (ground truth):
@Override public void run(){
  while (true) {
    Map.Entry<String,Message> request;
    try {
      request=inbox.take();
    }
 catch (    InterruptedException ie) {
      System.out.println("String_Node_Str");
      continue;
    }
    String topicName=request.getKey();
    Message m=request.getValue();
    outbox_lock.readLock().lock();
    List<Subscriber> subs=outbox_mapping.get(topicName);
    if (subs != null) {
      for (      Subscriber s : subs) {
        s.putMessage(m);
      }
    }
    outbox_lock.readLock().unlock();
  }
}
Program: 42820
Project: 42820
Buggy source:
@Override public boolean next(Text key,Text value) throws IOException {
  if (eof) {
    return false;
  }
  try {
    if (!firstRecord && realReader.nextKeyValue()) {
      SimpleGroup g=realReader.getCurrentValue();
      ls=groupToStrings(g);
    }
    if (firstRecord)     firstRecord=false;
    if (key != null)     key.set(fetchKey());
    if (value != null)     value.set(fetchValue());
    return true;
  }
 catch (  InterruptedException e) {
    throw new IOException(e);
  }
}

Fixed version (ground truth):
@Override public boolean next(Text key,Text value) throws IOException {
  if (eof)   return false;
  try {
    if (!firstRecord) {
      if (!realReader.nextKeyValue())       return false;
      SimpleGroup g=realReader.getCurrentValue();
      ls=groupToStrings(g);
    }
 else     firstRecord=false;
    if (key != null)     key.set(fetchKey());
    if (value != null)     value.set(fetchValue());
    return true;
  }
 catch (  InterruptedException e) {
    throw new IOException(e);
  }
}
Program: 42821
Project: 42821
Buggy source:
@Test public void testParquetAsTextFmt() throws IOException {
  ParquetAsTextOutputFormat outfmt=new ParquetAsTextOutputFormat();
  FileOutputFormat.setOutputPath(defaultConf,file);
  String outpath=FileOutputFormat.getTaskOutputPath(defaultConf,"String_Node_Str").toString();
  defaultConf.set("String_Node_Str",outpath);
  RecordWriter<Text,Text> writer=outfmt.getRecordWriter(file.getFileSystem(defaultConf),defaultConf,fname,new dummyReporter());
  writer.write(new Text(tsv),null);
  writer.close(null);
  FileInputFormat.setInputPaths(defaultConf,outpath + "String_Node_Str" + fname+ "String_Node_Str");
  ParquetAsTextInputFormat informat=new ParquetAsTextInputFormat();
  RecordReader<Text,Text> reader=informat.getRecordReader(informat.getSplits(defaultConf,1)[0],defaultConf,new dummyReporter());
  Text k=new Text();
  Text v=new Text();
  reader.next(k,v);
  Assert.assertEquals("String_Node_Str",tsv,k.toString() + "String_Node_Str" + v.toString());
}

Fixed version (ground truth):
@Test public void testParquetAsTextFmt() throws IOException {
  ParquetAsTextOutputFormat outfmt=new ParquetAsTextOutputFormat();
  FileOutputFormat.setOutputPath(defaultConf,file);
  String outpath=FileOutputFormat.getTaskOutputPath(defaultConf,"String_Node_Str").toString();
  defaultConf.set("String_Node_Str",outpath);
  RecordWriter<Text,Text> writer=outfmt.getRecordWriter(file.getFileSystem(defaultConf),defaultConf,fname,new dummyReporter());
  for (  String s : tsv.split("String_Node_Str"))   writer.write(new Text(s),null);
  writer.close(null);
  FileInputFormat.setInputPaths(defaultConf,outpath + "String_Node_Str" + fname+ "String_Node_Str");
  ParquetAsTextInputFormat informat=new ParquetAsTextInputFormat();
  RecordReader<Text,Text> reader=informat.getRecordReader(informat.getSplits(defaultConf,1)[0],defaultConf,new dummyReporter());
  StringBuilder readBack=new StringBuilder();
  Text k=new Text();
  Text v=new Text();
  while (reader.next(k,v)) {
    readBack.append(k.toString());
    readBack.append("String_Node_Str");
    readBack.append(v.toString());
    readBack.append("String_Node_Str");
  }
  Assert.assertEquals("String_Node_Str",tsv,readBack.toString());
}
Program: 42822
Project: 42822
Buggy source:
@Override public void renderAnyTypes(ItemStack item,Object... data){
  plate.simpleRender(0F);
  PlateRender.renderPlateContents(new PlateRender.Plate(item));
}

Fixed version (ground truth):
@Override public void renderAnyTypes(ItemStack item,Object... data){
  plate.simpleRender(0F);
  PlateRender.renderPlateContents(new PlateRender.Plate(item));
  GL11.glEnable(GL12.GL_RESCALE_NORMAL);
}
Program: 42823
Project: 42823
Buggy source:
/** 
 * Sets the pan's ingredient to whatever the item links to.
 * @param clicked The item the pan is being clicked with.
 * @return Returns true if the ingredient was set successfully.
 */
private boolean setIngredient(ItemStack clicked){
  if (this.ingredient == Ingredient.getIngredient("String_Node_Str") && this.cookTime == 0) {
    Ingredient ingredientFromItem=KitchenItems.valueOf(clicked.getItem());
    if (ingredientFromItem != null) {
      this.ingredient=ingredientFromItem;
      return true;
    }
 else     return false;
  }
 else   return false;
}

Fixed version (ground truth):
/** 
 * Sets the pan's ingredient to whatever the item links to.
 * @param clicked The item the pan is being clicked with.
 * @return Returns true if the ingredient was set successfully.
 */
private boolean setIngredient(ItemStack clicked){
  System.out.println("String_Node_Str");
  if (this.ingredient == Ingredient.getIngredient("String_Node_Str") && this.cookTime == 0) {
    Ingredient ingredientFromItem=KitchenItems.valueOf(clicked.getItem());
    if (ingredientFromItem != Ingredient.getIngredient("String_Node_Str")) {
      this.ingredient=ingredientFromItem;
      return true;
    }
 else     return false;
  }
 else   return false;
}
Program: 42824
Project: 42824
Buggy source:
public static int getComboID(ItemStack sandwich){
  for (int i=0; i < combos.length; i++)   if (combos[i].matches(sandwich))   return i;
  return 0;
}

Fixed version (ground truth):
public static int getComboID(ItemStack sandwich){
  for (int i=1; i < combos.length && combos[i] != null; i++)   if (combos[i].matches(sandwich))   return i;
  return 0;
}
Program: 42825
Project: 42825
Buggy source:
@Override public int func_150905_g(ItemStack item){
  int healAmount=0;
  if (item.getTagCompound() != null)   if (item.getTagCompound().hasKey("String_Node_Str")) {
    NBTTagList layersList=item.getTagCompound().getTagList("String_Node_Str",10);
    if (layersList != null) {
      for (int i=0; i < layersList.tagCount(); ++i) {
        NBTTagCompound layerCompound=layersList.getCompoundTagAt(i);
        healAmount+=((ItemSandwichable)ItemStack.loadItemStackFromNBT(layerCompound).getItem()).getHealAmount();
      }
      byte combo=item.getTagCompound().getCompoundTag("String_Node_Str").getByte("String_Node_Str");
      if (SandwichCombo.combos[(int)combo] != null)       healAmount+=SandwichCombo.combos[(int)combo].getExtraHeal();
    }
  }
  return healAmount;
}

Fixed version (ground truth):
@Override public int func_150905_g(ItemStack item){
  int healAmount=0;
  if (item.getTagCompound() != null)   if (item.getTagCompound().hasKey("String_Node_Str")) {
    NBTTagList layersList=item.getTagCompound().getTagList("String_Node_Str",10);
    if (layersList != null) {
      for (int i=0; i < layersList.tagCount(); ++i) {
        NBTTagCompound layerCompound=layersList.getCompoundTagAt(i);
        healAmount+=ModConfig.getSandwichConfig().getHealAmount(ItemStack.loadItemStackFromNBT(layerCompound));
      }
      byte combo=item.getTagCompound().getCompoundTag("String_Node_Str").getByte("String_Node_Str");
      if (SandwichCombo.combos[(int)combo] != null)       healAmount+=SandwichCombo.combos[(int)combo].getExtraHeal();
    }
  }
  System.out.println("String_Node_Str" + healAmount);
  return healAmount;
}
Program: 42826
Project: 42826
Buggy source:
private void renderItemEntity(ItemStack item,double xOffset,double yOffset,double zOffset,int i){
  GL11.glPushMatrix();
  GL11.glTranslated(xOffset,yOffset,zOffset);
  if (((ItemSandwichable)this.items[i].getItem()).hasCustomModel)   if (i + 1 < this.items.length)   if (this.items[i + 1] != null) {
    ((ItemSandwichable)this.items[i].getItem()).getBottomModel().render(Minecraft.getMinecraft().renderViewEntity,0.0F,0.0F,0.0F,0.0F,0.0F,0.0625F);
    this.yItemOffset+=(((ItemSandwichable)this.items[i].getItem()).modelBottomHeight * 0.033D);
  }
 else {
    ((ItemSandwichable)this.items[i].getItem()).getTopModel().render(Minecraft.getMinecraft().renderViewEntity,0.0F,0.0F,0.0F,0.0F,0.0F,0.0625F);
    this.yItemOffset+=(((ItemSandwichable)this.items[i].getItem()).modelTopHeight * 0.033D);
  }
 else {
    ((ItemSandwichable)this.items[i].getItem()).getTopModel().render(Minecraft.getMinecraft().renderViewEntity,0.0F,0.0F,0.0F,0.0F,0.0F,0.0625F);
    this.yItemOffset+=(((ItemSandwichable)this.items[i].getItem()).modelTopHeight * 0.033D);
  }
 else {
    EntityItem itemEntity=new EntityItem(Minecraft.getMinecraft().thePlayer.getEntityWorld(),0D,0D,0D,item);
    itemEntity.hoverStart=0.0F;
    RenderItem.renderInFrame=true;
    GL11.glRotatef(180,0,1,1);
    RenderManager.instance.renderEntityWithPosYaw(itemEntity,0.0D,0.0D,0.0D,0.0F,0.0F);
    RenderItem.renderInFrame=false;
  }
  GL11.glPopMatrix();
}

Fixed version (ground truth):
private void renderItemEntity(ItemStack item,double xOffset,double yOffset,double zOffset,int i){
  GL11.glPushMatrix();
  GL11.glTranslated(xOffset,yOffset,zOffset);
  EntityItem itemEntity=new EntityItem(Minecraft.getMinecraft().thePlayer.getEntityWorld(),0D,0D,0D,item);
  itemEntity.hoverStart=0.0F;
  RenderItem.renderInFrame=true;
  GL11.glRotatef(180,0,1,1);
  RenderManager.instance.renderEntityWithPosYaw(itemEntity,0.0D,0.0D,0.0D,0.0F,0.0F);
  RenderItem.renderInFrame=false;
  GL11.glPopMatrix();
}
Program: 42827
Project: 42827
Buggy source:
public ItemStack finishSandwich(){
  if (!(ModConfig.getSandwichConfig().isBread(this.layers.get(0)) && ModConfig.getSandwichConfig().isBread(this.layers.get(this.layers.size()))) || this.layers.size() < 2)   return null;
  NBTTagList layersList=new NBTTagList();
  ItemStack sandwich=GameRegistry.findItemStack(ModInfo.modid,"String_Node_Str",1);
  for (  ItemStack layer : this.layers) {
    NBTTagCompound layerCompound=new NBTTagCompound();
    layer.writeToNBT(layerCompound);
    layersList.appendTag(layerCompound);
  }
  sandwich.setTagInfo("String_Node_Str",layersList);
  NBTTagCompound comboCompound=new NBTTagCompound();
  byte combo=(byte)SandwichCombo.getComboID(sandwich);
  comboCompound.setByte("String_Node_Str",combo);
  sandwich.setTagInfo("String_Node_Str",comboCompound);
  return sandwich;
}

Fixed version (ground truth):
public ItemStack finishSandwich(){
  if (!(ModConfig.getSandwichConfig().isBread(this.layers.get(0)) && ModConfig.getSandwichConfig().isBread(this.layers.get(this.layers.size() - 1))) || this.layers.size() < 2)   return null;
  NBTTagList layersList=new NBTTagList();
  ItemStack sandwich=GameRegistry.findItemStack(ModInfo.modid,"String_Node_Str",1);
  for (  ItemStack layer : this.layers) {
    NBTTagCompound layerCompound=new NBTTagCompound();
    layer.writeToNBT(layerCompound);
    layersList.appendTag(layerCompound);
  }
  sandwich.setTagInfo("String_Node_Str",layersList);
  NBTTagCompound comboCompound=new NBTTagCompound();
  byte combo=(byte)SandwichCombo.getComboID(sandwich);
  comboCompound.setByte("String_Node_Str",combo);
  sandwich.setTagInfo("String_Node_Str",comboCompound);
  this.resetLayers();
  return sandwich;
}