nus-yam/ex-repair huggingface dataset:
Program: 144233
Project: 144233
Buggy source:
public String toString(){
  return documentFullName + "String_Node_Str" + documentShortName+ "String_Node_Str"+ documentDescription+ "String_Node_Str"+ templateid+ "String_Node_Str"+ formatCode;
}

Fixed version (ground truth):
public String toString(){
  return documentFullName + "String_Node_Str" + documentShortName+ "String_Node_Str"+ documentDescription+ "String_Node_Str"+ templateid+ "String_Node_Str"+ formatCode+ "String_Node_Str"+ parentTemplateId;
}
Program: 144234
Project: 144234
Buggy source:
public static Section buildChiefComplaintSection(Patient patient){
  Section section=CDAFactory.eINSTANCE.createSection();
  ChiefComplaintSection ccs=new ChiefComplaintSection();
  section.getTemplateIds().add(CDAHelper.buildTemplateID(ccs.getTemplateid(),null,null));
  section.setCode(CDAHelper.buildCodeCE(ccs.getCode(),ccs.getCodeSystem(),ccs.getSectionName(),ccs.getCodeSystemName()));
  section.setTitle(CDAHelper.buildTitle(ccs.getSectionDescription()));
  StrucDocText text=CDAFactory.eINSTANCE.createStrucDocText();
  StringBuilder builder=new StringBuilder();
  builder.append("String_Node_Str");
  ConceptService service=Context.getConceptService();
  Map<String,Date> latestObsdate=new HashMap<String,Date>();
  Concept concept=service.getConceptByMapping("String_Node_Str","String_Node_Str");
  List<Obs> observationList=new ArrayList<Obs>();
  observationList.addAll(Context.getObsService().getObservationsByPersonAndConcept(patient,concept));
  String value="String_Node_Str";
  for (  Obs obs : observationList) {
    int type=obs.getConcept().getDatatype().getId();
    if (latestObsdate.isEmpty()) {
      latestObsdate.put("String_Node_Str",obs.getObsDatetime());
      value=CDAHelper.getDatatypesValue(type,obs);
    }
 else {
      Date date=latestObsdate.get("String_Node_Str");
      if (date.before(obs.getObsDatetime())) {
        latestObsdate.put("String_Node_Str",obs.getObsDatetime());
        value=CDAHelper.getDatatypesValue(type,obs);
      }
    }
  }
  builder.append(value);
  builder.append("String_Node_Str");
  text.addText(builder.toString());
  section.setText(text);
  return section;
}

Fixed version (ground truth):
public static Section buildChiefComplaintSection(Patient patient){
  Section section=CDAFactory.eINSTANCE.createSection();
  ChiefComplaintSection ccs=new ChiefComplaintSection();
  section.getTemplateIds().add(CDAHelper.buildTemplateID(ccs.getTemplateid(),null,null));
  section.setCode(CDAHelper.buildCodeCE(ccs.getCode(),ccs.getCodeSystem(),ccs.getSectionName(),ccs.getCodeSystemName()));
  section.setTitle(CDAHelper.buildTitle(ccs.getSectionDescription()));
  StrucDocText text=CDAFactory.eINSTANCE.createStrucDocText();
  StringBuilder builder=new StringBuilder();
  builder.append("String_Node_Str");
  ConceptService service=Context.getConceptService();
  Concept concept=service.getConceptByMapping("String_Node_Str","String_Node_Str");
  List<Obs> observationList=new ArrayList<Obs>();
  observationList.addAll(Context.getObsService().getObservationsByPersonAndConcept(patient,concept));
  String value="String_Node_Str";
  Obs obs=CDAHelper.getLatestObs(observationList);
  int type=obs.getConcept().getDatatype().getId();
  value=CDAHelper.getDatatypesValue(type,obs);
  builder.append(value);
  builder.append("String_Node_Str");
  text.addText(builder.toString());
  section.setText(text);
  return section;
}
Program: 144235
Project: 144235
Buggy source:
public static Section buildHistoryOfPresentIllnessSection(Patient patient){
  Section section=CDAFactory.eINSTANCE.createSection();
  HistoryOfPresentIllnessSection ccs=new HistoryOfPresentIllnessSection();
  section.getTemplateIds().add(CDAHelper.buildTemplateID(ccs.getTemplateid(),null,null));
  section.setCode(CDAHelper.buildCodeCE(ccs.getCode(),ccs.getCodeSystem(),ccs.getSectionName(),ccs.getCodeSystemName()));
  section.setTitle(CDAHelper.buildTitle(ccs.getSectionDescription()));
  StrucDocText text=CDAFactory.eINSTANCE.createStrucDocText();
  StringBuilder builder=new StringBuilder();
  builder.append("String_Node_Str");
  ConceptService service=Context.getConceptService();
  Map<String,Date> latestObsdate=new HashMap<String,Date>();
  Concept concept=service.getConceptByMapping("String_Node_Str","String_Node_Str");
  List<Obs> observationList=new ArrayList<Obs>();
  observationList.addAll(Context.getObsService().getObservationsByPersonAndConcept(patient,concept));
  String value="String_Node_Str";
  for (  Obs obs : observationList) {
    int type=obs.getConcept().getDatatype().getId();
    if (latestObsdate.isEmpty()) {
      latestObsdate.put("String_Node_Str",obs.getObsDatetime());
      value=CDAHelper.getDatatypesValue(type,obs);
    }
 else {
      Date date=latestObsdate.get("String_Node_Str");
      if (date.before(obs.getObsDatetime())) {
        latestObsdate.put("String_Node_Str",obs.getObsDatetime());
        value=CDAHelper.getDatatypesValue(type,obs);
      }
    }
  }
  builder.append(value);
  builder.append("String_Node_Str");
  text.addText(builder.toString());
  section.setText(text);
  return section;
}

Fixed version (ground truth):
public static Section buildHistoryOfPresentIllnessSection(Patient patient){
  Section section=CDAFactory.eINSTANCE.createSection();
  HistoryOfPresentIllnessSection ccs=new HistoryOfPresentIllnessSection();
  section.getTemplateIds().add(CDAHelper.buildTemplateID(ccs.getTemplateid(),null,null));
  section.setCode(CDAHelper.buildCodeCE(ccs.getCode(),ccs.getCodeSystem(),ccs.getSectionName(),ccs.getCodeSystemName()));
  section.setTitle(CDAHelper.buildTitle(ccs.getSectionDescription()));
  StrucDocText text=CDAFactory.eINSTANCE.createStrucDocText();
  StringBuilder builder=new StringBuilder();
  builder.append("String_Node_Str");
  ConceptService service=Context.getConceptService();
  Concept concept=service.getConceptByMapping("String_Node_Str","String_Node_Str");
  List<Obs> observationList=new ArrayList<Obs>();
  observationList.addAll(Context.getObsService().getObservationsByPersonAndConcept(patient,concept));
  String value="String_Node_Str";
  Obs obs=CDAHelper.getLatestObs(observationList);
  int type=obs.getConcept().getDatatype().getId();
  value=CDAHelper.getDatatypesValue(type,obs);
  builder.append(value);
  builder.append("String_Node_Str");
  text.addText(builder.toString());
  section.setText(text);
  return section;
}
Program: 144236
Project: 144236
Buggy source:
public static IVL_TS buildEffectiveTimeinIVL(Date d,Date d1){
  IVL_TS effectiveTime=DatatypesFactory.eINSTANCE.createIVL_TS();
  SimpleDateFormat s=new SimpleDateFormat("String_Node_Str");
  String creationDate=s.format(d);
  IVXB_TS low=DatatypesFactory.eINSTANCE.createIVXB_TS();
  low.setValue(creationDate);
  effectiveTime.setLow(low);
  IVXB_TS high=DatatypesFactory.eINSTANCE.createIVXB_TS();
  if (d1 != null)   high.setValue(s.format(d1));
  effectiveTime.setHigh(high);
  return effectiveTime;
}

Fixed version (ground truth):
public static IVL_TS buildEffectiveTimeinIVL(Date d){
  IVL_TS effectiveTime=DatatypesFactory.eINSTANCE.createIVL_TS();
  SimpleDateFormat s=new SimpleDateFormat("String_Node_Str");
  String creationDate=s.format(d);
  IVXB_TS low=DatatypesFactory.eINSTANCE.createIVXB_TS();
  low.setValue(creationDate);
  effectiveTime.setLow(low);
  return effectiveTime;
}
Program: 144238
Project: 144238
Buggy source:
public ClinicalDocument buildAPHPMessage(Patient patient,BaseCdaTypeHandler handler){
  ClinicalDocument doc=CDAFactory.eINSTANCE.createClinicalDocument();
  Section section=CDAFactory.eINSTANCE.createSection();
  CdaHeaderBuilder header=new CdaHeaderBuilder();
  doc=header.buildHeader(doc,handler,patient);
  section=HistoryOfPresentIllnessSection.buildHistoryOfPresentIllnessSection(patient);
  doc.addSection(section);
  section=ChiefComplaintSection.buildChiefComplaintSection(patient);
  doc.addSection(section);
  section=SocialHistorySection.buildSocialHistorySection(patient);
  doc.addSection(section);
  section=HistoryOfInfectionSection.buildHistoryOfInfectionSection();
  doc.addSection(section);
  section=HistoryOfPastIllnessSection.buildHistoryOfPastIllnessSection();
  doc.addSection(section);
  section=PregnancyHistorySection.buildPregnancyHistorySection();
  doc.addSection(section);
  section=CodedFamilyMedicalHistorySection.buildCodedFamilyMedicalHistorySection();
  doc.addSection(section);
  section=ReviewOfSystemsSection.buildReviewOfSystemsSection();
  doc.addSection(section);
  section=PhysicalExamSection.buildPhysicalExamSection();
  doc.addSection(section);
  return doc;
}

Fixed version (ground truth):
public ClinicalDocument buildAPHPMessage(Patient patient,BaseCdaTypeHandler handler){
  ClinicalDocument doc=CDAFactory.eINSTANCE.createClinicalDocument();
  Section section=CDAFactory.eINSTANCE.createSection();
  CdaHeaderBuilder header=new CdaHeaderBuilder();
  doc=header.buildHeader(doc,handler,patient);
  section=HistoryOfPresentIllnessSection.buildHistoryOfPresentIllnessSection(patient);
  doc.addSection(section);
  section=ChiefComplaintSection.buildChiefComplaintSection(patient);
  doc.addSection(section);
  section=SocialHistorySection.buildSocialHistorySection(patient);
  doc.addSection(section);
  section=ReviewOfSystemsSection.buildReviewOfSystemsSection(patient);
  doc.addSection(section);
  return doc;
}
Program: 144242
Project: 144242
Buggy source:
public void handleError(Diagnostic diagnostic){
  errorList.add(diagnostic.getMessage());
  errorMap.put("String_Node_Str",errorList);
  System.out.println("String_Node_Str" + diagnostic.getMessage());
}

Fixed version (ground truth):
public void handleError(Diagnostic diagnostic){
  errorList.add(diagnostic.getMessage());
  errorMap.put("String_Node_Str",errorList);
}
Program: 144243
Project: 144243
Buggy source:
public void handleWarning(Diagnostic diagnostic){
  errorList.add(diagnostic.getMessage());
  errorMap.put("String_Node_Str",errorList);
  System.out.println("String_Node_Str" + diagnostic.getMessage());
}

Fixed version (ground truth):
public void handleWarning(Diagnostic diagnostic){
  errorList.add(diagnostic.getMessage());
  errorMap.put("String_Node_Str",errorList);
}
Program: 144244
Project: 144244
Buggy source:
public void handleInfo(Diagnostic diagnostic){
  errorList.add(diagnostic.getMessage());
  errorMap.put("String_Node_Str",errorList);
  System.out.println("String_Node_Str" + diagnostic.getMessage());
}

Fixed version (ground truth):
public void handleInfo(Diagnostic diagnostic){
  errorList.add(diagnostic.getMessage());
  errorMap.put("String_Node_Str",errorList);
}
Program: 144248
Project: 144248
Buggy source:
String compileToRegexp(String path){
  Matcher m=matchPattern.matcher(path);
  StringBuffer sb=new StringBuffer(path.length());
  while (m.find()) {
    if (m.group(1) != null) {
      namedGroups.add(m.group("String_Node_Str"));
      String replace="String_Node_Str" + m.group("String_Node_Str") + "String_Node_Str";
      m.appendReplacement(sb,replace);
    }
 else     if (m.group(3) != null) {
      namedGroups.add(starKey);
      String replace="String_Node_Str" + starKey + "String_Node_Str";
      m.appendReplacement(sb,replace);
    }
 else     if (m.group(4) != null) {
      namedGroups.add(m.group("String_Node_Str"));
      String delimiter=m.group("String_Node_Str").equals("String_Node_Str") ? "String_Node_Str" : "String_Node_Str";
      m.appendReplacement(sb,new StringBuilder("String_Node_Str").append(m.group("String_Node_Str")).append("String_Node_Str").append(m.group("String_Node_Str")).append("String_Node_Str").append(delimiter).toString());
    }
 else     if (m.group(8) != null) {
      String replace="String_Node_Str" + m.group(8);
      m.appendReplacement(sb,replace);
    }
 else {
      throw new RuntimeException();
    }
  }
  m.appendTail(sb);
  return sb.toString();
}

Fixed version (ground truth):
String compileToRegexp(String path){
  Matcher m=matchPattern.matcher(path);
  StringBuffer sb=new StringBuffer(path.length());
  while (m.find()) {
    if (m.group(1) != null) {
      namedGroups.add(m.group("String_Node_Str"));
      String replace="String_Node_Str" + m.group("String_Node_Str") + "String_Node_Str";
      m.appendReplacement(sb,replace);
    }
 else     if (m.group(3) != null) {
      namedGroups.add(starKey);
      String replace="String_Node_Str" + starKey + "String_Node_Str";
      m.appendReplacement(sb,replace);
    }
 else     if (m.group(4) != null) {
      namedGroups.add(m.group("String_Node_Str"));
      String delimiter=m.group("String_Node_Str").equals("String_Node_Str") ? "String_Node_Str" : "String_Node_Str";
      m.appendReplacement(sb,"String_Node_Str" + m.group("String_Node_Str") + "String_Node_Str"+ m.group("String_Node_Str")+ "String_Node_Str"+ delimiter);
    }
 else     if (m.group(8) != null) {
      String replace="String_Node_Str" + m.group(8);
      m.appendReplacement(sb,replace);
    }
 else {
      throw new RuntimeException();
    }
  }
  m.appendTail(sb);
  return sb.toString();
}
Program: 144249
Project: 144249
Buggy source:
@Override protected void onCancelled(Result result){
  EventBus.getDefault().post(new ActivityEvent(IDLE));
  listener.netCatIsFailed(result);
}

Fixed version (ground truth):
@Override protected void onCancelled(Result result){
  listener.netCatIsFailed(result);
}
Program: 144250
Project: 144250
Buggy source:
@Override public void netCatIsFailed(Result result){
  Toast.makeText(getActivity(),result.getErrorMessage(),Toast.LENGTH_LONG).show();
}

Fixed version (ground truth):
@Override public void netCatIsFailed(Result result){
  EventBus.getDefault().post(new ActivityEvent(IDLE,outputView.getText().toString()));
  Toast.makeText(getActivity(),result.getErrorMessage(),Toast.LENGTH_LONG).show();
}
Program: 144251
Project: 144251
Buggy source:
@Override public void onDestroy(){
  pager=null;
  EventBus.getDefault().unregister(this);
  super.onDestroy();
}

Fixed version (ground truth):
@Override public void onDestroy(){
  EventBus.getDefault().unregister(this);
  super.onDestroy();
}
Program: 144252
Project: 144252
Buggy source:
@Override public void netCatIsCompleted(Result result){
switch (result.op) {
case CONNECT:
case LISTEN:
    Socket socket=result.getSocket();
  output=new ByteArrayOutputStream();
netCat.setSocket(socket);
netCat.setOutput(output);
netCat.executeParallel(RECEIVE.toString());
EventBus.getDefault().post(new ActivityEvent(CONNECTED));
break;
case RECEIVE:
String s=output.toString();
outputView.setText(s.substring(0,s.length() - 1));
disconnect();
break;
case SEND:
inputText.setText("String_Node_Str");
break;
case DISCONNECT:
Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_LONG).show();
EventBus.getDefault().post(new ActivityEvent(IDLE,outputView.getText().toString()));
break;
}
updateUIWithValidation();
}

Fixed version (ground truth):
@Override public void netCatIsCompleted(Result result){
switch (result.op) {
case CONNECT:
case LISTEN:
    Socket socket=result.getSocket();
  output=new ByteArrayOutputStream();
netCat.setSocket(socket);
netCat.setOutput(output);
netCat.executeParallel(RECEIVE.toString());
EventBus.getDefault().post(new ActivityEvent(CONNECTED));
break;
case RECEIVE:
String s=output.toString();
if (s.length() > 0) {
outputView.setText(s.substring(0,s.length() - 1));
}
disconnect();
break;
case SEND:
inputText.setText("String_Node_Str");
break;
case DISCONNECT:
Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_LONG).show();
EventBus.getDefault().post(new ActivityEvent(IDLE,outputView.getText().toString()));
break;
}
updateUIWithValidation();
}
Program: 144253
Project: 144253
Buggy source:
public void onEvent(FragmentEvent event){
  if (event.op != null) {
switch (event.op) {
case CONNECT:
      connect(event.data);
    break;
case LISTEN:
  listen(event.data);
break;
case DISCONNECT:
if (netCat.isConnected()) {
disconnect();
}
 else if (netCat.isListening()) {
netCat.cancel();
}
break;
case CLEAR_OUTPUT_VIEW:
outputView.setText("String_Node_Str");
EventBus.getDefault().post(new ActivityEvent(OUTPUT_VIEW_CLEARED));
break;
}
}
}

Fixed version (ground truth):
/** 
 * Event handler
 */
public void onEvent(FragmentEvent event){
switch (event.op) {
case CONNECT:
    connect(event.data);
  break;
case LISTEN:
listen(event.data);
break;
case DISCONNECT:
if (netCat.isConnected()) {
disconnect();
}
 else if (netCat.isListening()) {
netCat.cancel();
}
break;
case CLEAR_OUTPUT_VIEW:
outputView.setText("String_Node_Str");
EventBus.getDefault().post(new ActivityEvent(OUTPUT_VIEW_CLEARED));
break;
}
}
Program: 144255
Project: 144255
Buggy source:
public void listen(String port){
  if (!port.matches("String_Node_Str")) {
    Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_LONG).show();
    return;
  }
  netCat=new NetCat(this);
  netCat.execute(LISTEN.toString(),port);
}

Fixed version (ground truth):
public void listen(String port){
  if (Utils.isActive(netCat)) {
    Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_LONG).show();
    return;
  }
  if (!port.matches("String_Node_Str")) {
    Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_LONG).show();
    return;
  }
  netCat=new NetCat(this);
  netCat.execute(LISTEN.toString(),port);
}
Program: 144256
Project: 144256
Buggy source:
private void updateUIWithValidation(){
  if (Utils.connected(netCat)) {
    sendButton.setEnabled(Utils.populated(inputText));
  }
 else {
    sendButton.setEnabled(false);
  }
}

Fixed version (ground truth):
private void updateUIWithValidation(){
  if (Utils.isActive(netCat)) {
    sendButton.setEnabled(Utils.populated(inputText));
  }
 else {
    sendButton.setEnabled(false);
  }
}
Program: 144257
Project: 144257
Buggy source:
public void onEvent(FragmentEvent event){
switch (event.op) {
case CONNECT:
    connect(event.data);
  break;
case LISTEN:
listen(event.data);
break;
case DISCONNECT:
if (netCat.isConnected()) {
disconnect();
}
 else {
netCat.cancel();
}
break;
case CLEAR_OUTPUT_VIEW:
outputView.setText("String_Node_Str");
EventBus.getDefault().post(new ActivityEvent(OUTPUT_VIEW_CLEARED));
break;
}
}

Fixed version (ground truth):
public void onEvent(FragmentEvent event){
switch (event.op) {
case CONNECT:
    connect(event.data);
  break;
case LISTEN:
listen(event.data);
break;
case DISCONNECT:
if (netCat.isConnected()) {
disconnect();
}
 else if (netCat.isListening()) {
netCat.cancel();
}
break;
case CLEAR_OUTPUT_VIEW:
outputView.setText("String_Node_Str");
EventBus.getDefault().post(new ActivityEvent(OUTPUT_VIEW_CLEARED));
break;
}
}
Program: 144258
Project: 144258
Buggy source:
public void connect(String connectTo){
  if (!connectTo.matches("String_Node_Str")) {
    Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_LONG).show();
    return;
  }
  String[] tokens=connectTo.split("String_Node_Str");
  netCat=new NetCat(this);
  netCat.execute(CONNECT.toString(),tokens[0],tokens[1]);
}

Fixed version (ground truth):
public void connect(String connectTo){
  if (Utils.isActive(netCat)) {
    Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_LONG).show();
    return;
  }
  if (!connectTo.matches("String_Node_Str")) {
    Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_LONG).show();
    return;
  }
  String[] tokens=connectTo.split("String_Node_Str");
  netCat=new NetCat(this);
  netCat.execute(CONNECT.toString(),tokens[0],tokens[1]);
}
Program: 144259
Project: 144259
Buggy source:
@Override public void netCatIsCompleted(Result result){
switch (result.op) {
case CONNECT:
case LISTEN:
    Socket socket=result.getSocket();
  output=new ByteArrayOutputStream();
netCat.setSocket(socket);
netCat.setOutput(output);
netCat.executeParallel(RECEIVE.toString());
EventBus.getDefault().post(new ActivityEvent(CONNECTED));
break;
case RECEIVE:
OutputStream resultStream=new OutputStream(){
@Override public void write(int oneByte) throws IOException {
char ch=(char)oneByte;
outputView.setText(outputView.getText() + String.valueOf(ch));
System.out.write(oneByte);
}
}
;
try {
output.writeTo(resultStream);
}
 catch (IOException e) {
Log.e(CLASS_NAME,e.getMessage());
}
break;
case SEND:
inputText.setText("String_Node_Str");
break;
case DISCONNECT:
Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_LONG).show();
EventBus.getDefault().post(new ActivityEvent(IDLE,outputView.getText().toString()));
break;
}
updateUIWithValidation();
}

Fixed version (ground truth):
@Override public void netCatIsCompleted(Result result){
switch (result.op) {
case CONNECT:
case LISTEN:
    Socket socket=result.getSocket();
  output=new ByteArrayOutputStream();
netCat.setSocket(socket);
netCat.setOutput(output);
netCat.executeParallel(RECEIVE.toString());
EventBus.getDefault().post(new ActivityEvent(CONNECTED));
break;
case RECEIVE:
outputView.setText(output.toString());
break;
case SEND:
inputText.setText("String_Node_Str");
break;
case DISCONNECT:
Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_LONG).show();
EventBus.getDefault().post(new ActivityEvent(IDLE,outputView.getText().toString()));
break;
}
updateUIWithValidation();
}
Program: 144260
Project: 144260
Buggy source:
public static <T>Future<T> addTickCallback(Callable<T> callback){
  FutureTask<T> task=new FutureTask<T>(callback){
    @Override protected void done(){
      try {
        if (!isCancelled())         get();
      }
 catch (      Throwable t) {
        LogUtil.warn("String_Node_Str" + this);
        t.printStackTrace();
      }
    }
  }
;
  callbacks.add(task);
  return task;
}

Fixed version (ground truth):
public static <T>Future<T> addTickCallback(World world,Callable<T> callback){
  if (!callbacks.containsKey(world.provider.dimensionId))   callbacks.put(world.provider.dimensionId,new LinkedBlockingQueue<FutureTask>());
  FutureTask<T> task=new FutureTask<T>(callback){
    @Override protected void done(){
      try {
        if (!isCancelled())         get();
      }
 catch (      Throwable t) {
        LogUtil.warn("String_Node_Str" + this);
        t.printStackTrace();
      }
    }
  }
;
  try {
    callbacks.get(world.provider.dimensionId).put(task);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  return task;
}
Program: 144261
Project: 144261
Buggy source:
public static boolean shouldRegister(){
  return ConfigData.enableFireworkLauncher;
}

Fixed version (ground truth):
public static boolean shouldRegister(){
  return ConfigData.enableFireworkLauncher || ConfigData.enableInteractiveSorter;
}
Program: 144262
Project: 144262
Buggy source:
@SubscribeEvent public void onServerTick(TickEvent.ServerTickEvent event){
  if (event.type == TickEvent.Type.SERVER) {
    FutureTask callback;
    while ((callback=callbacks.poll()) != null) {
      callback.run();
    }
  }
}

Fixed version (ground truth):
@SubscribeEvent public void onServerTick(TickEvent.WorldTickEvent event){
  if (event.type == TickEvent.Type.WORLD) {
    if (callbacks.containsKey(event.world.provider.dimensionId)) {
      Queue<FutureTask> callbackList=callbacks.get(event.world.provider.dimensionId);
      FutureTask callback;
      while ((callback=callbackList.poll()) != null) {
        callback.run();
      }
    }
  }
}
Program: 144263
Project: 144263
Buggy source:
@LuaFunction public int extract(Side from,Side to,int slot,int amount) throws LuaException {
  if (from == to)   return 0;
  if (amount <= 0)   return 0;
  final TileEntity fromTile=getTileForSide(from);
  if (!(fromTile instanceof IInventory))   return 0;
  final IInventory fromInv=(IInventory)fromTile;
  if (slot < 1 || slot > fromInv.getSizeInventory())   throw new LuaException("String_Node_Str" + fromInv.getSizeInventory());
  final ItemStack stack=fromInv.getStackInSlot(--slot);
  if (stack == null)   return 0;
  amount=Math.min(stack.stackSize,amount);
  final TileEntity toTile=getTileForSide(to);
  if (toTile == null)   return 0;
  return sort(stack,amount,toTile,fromInv,ForgeDirection.getOrientation(from.ordinal()));
}

Fixed version (ground truth):
@LuaFunction public int extract(Side from,Side to,int slot,int amount) throws Exception {
  if (from == to)   return 0;
  if (amount <= 0)   return 0;
  final TileEntity fromTile=getTileForSide(from);
  if (!(fromTile instanceof IInventory))   return 0;
  final IInventory fromInv=(IInventory)fromTile;
  if (slot < 1 || slot > fromInv.getSizeInventory())   throw new LuaException("String_Node_Str" + fromInv.getSizeInventory());
  final ItemStack stack=fromInv.getStackInSlot(--slot);
  if (stack == null)   return 0;
  amount=Math.min(stack.stackSize,amount);
  final TileEntity toTile=getTileForSide(to);
  if (toTile == null)   return 0;
  return sort(stack,amount,toTile,fromInv,ForgeDirection.getOrientation(from.ordinal()));
}
Program: 144264
Project: 144264
Buggy source:
private int sort(ItemStack stack,int amount,TileEntity target,IInventory source,ForgeDirection direction){
  final IInteractiveSorterRegistry registry=InteractiveSorterRegistry.INSTANCE;
  final ItemStack outputStack=stack.copy().splitStack(amount);
  for (int i=0; i < registry.size(); ++i) {
    final IInteractiveSorterOutput output=registry.getSorterOutput(i);
    int sorted=output.output(outputStack,target,direction);
    if (sorted > 0) {
      stack.stackSize-=sorted;
      source.setInventorySlotContents(0,stack.stackSize > 0 ? stack : null);
      return sorted;
    }
  }
  return 0;
}

Fixed version (ground truth):
private int sort(final ItemStack stack,final int amount,final TileEntity target,final IInventory source,final ForgeDirection direction) throws Exception {
  final IInteractiveSorterRegistry registry=InteractiveSorterRegistry.INSTANCE;
  Future<Integer> callback=TickHandler.addTickCallback(worldObj,new Callable<Integer>(){
    @Override public Integer call() throws Exception {
      final ItemStack outputStack=stack.copy().splitStack(amount);
      for (int i=0; i < registry.size(); ++i) {
        final IInteractiveSorterOutput output=registry.getSorterOutput(i);
        int sorted=output.output(outputStack,target,direction);
        if (sorted > 0) {
          stack.stackSize-=sorted;
          source.setInventorySlotContents(0,stack.stackSize > 0 ? stack : null);
          return sorted;
        }
      }
      return 0;
    }
  }
);
  return callback.get();
}
Program: 144265
Project: 144265
Buggy source:
public Object[] launch(final World world,double x,double y,double z){
  final ItemStack firework=rocketBuffer.getNextItemStack();
  if (firework != null) {
    final EntityFireworkRocket rocket=new EntityFireworkRocket(world,x + xOffset,y + yOffset,z + zOffset,firework);
    TickHandler.addTickCallback(new Callable<Object>(){
      @Override public Object call() throws Exception {
        world.spawnEntityInWorld(rocket);
        coolDownActive=true;
        return null;
      }
    }
);
    return new Object[]{true};
  }
  return new Object[]{false,"String_Node_Str"};
}

Fixed version (ground truth):
public Object[] launch(final World world,double x,double y,double z){
  final ItemStack firework=rocketBuffer.getNextItemStack();
  if (firework != null) {
    final EntityFireworkRocket rocket=new EntityFireworkRocket(world,x + xOffset,y + yOffset,z + zOffset,firework);
    TickHandler.addTickCallback(world,new Callable<Object>(){
      @Override public Object call() throws Exception {
        world.spawnEntityInWorld(rocket);
        coolDownActive=true;
        return null;
      }
    }
);
    return new Object[]{true};
  }
  return new Object[]{false,"String_Node_Str"};
}
Program: 144266
Project: 144266
Buggy source:
@LuaFunction public ItemStack getCraftingSlot(int slot) throws LuaException {
  --slot;
  if (slot >= 0 || slot <= craftingInv.getSizeInventory()) {
    return craftingInv.getStackInSlot(slot);
  }
  return null;
}

Fixed version (ground truth):
@LuaFunction public ItemStack getCraftingSlot(int slot) throws LuaException {
  --slot;
  if (slot >= 0 && slot < craftingInv.getSizeInventory()) {
    return craftingInv.getStackInSlot(slot);
  }
  return null;
}
Program: 144267
Project: 144267
Buggy source:
/** 
 * Loads a pre-made Firework Rocket from the Firework Launchers inventory into the end of the firework rocket launch queue. Or loads a Firework Star from the inventory into the star queue.
 * @param slot the slot the rocket is in
 * @return the result. if crafting failed it will return false, and a string message as to why it failed. if craftingsucceeded then it will return true, and how many more firework stars can be added to the firework rocket
 */
@LuaFunction(isMultiReturn=true) public Object[] load(int slot){
  --slot;
  if (slot < 0 || slot > getSizeInventory()) {
    return new Object[]{false,"String_Node_Str" + getSizeInventory()};
  }
  final ItemStack stack=getStackInSlot(slot);
  final Item item=stack.getItem();
  if (item instanceof ItemFirework) {
    bufferRocket.addItemStack(stack.splitStack(1));
    return new Object[]{true};
  }
  if (item instanceof ItemFireworkCharge) {
    bufferStar.addItemStack(stack.splitStack(1));
    return new Object[]{true};
  }
  return new Object[]{false,"String_Node_Str"};
}

Fixed version (ground truth):
/** 
 * Loads a pre-made Firework Rocket from the Firework Launchers inventory into the end of the firework rocket launch queue. Or loads a Firework Star from the inventory into the star queue.
 * @param slot the slot the rocket is in
 * @return the result. if crafting failed it will return false, and a string message as to why it failed. if craftingsucceeded then it will return true, and how many more firework stars can be added to the firework rocket
 */
@LuaFunction(isMultiReturn=true) public Object[] load(int slot){
  --slot;
  if (slot < 0 || slot > getSizeInventory()) {
    return new Object[]{false,"String_Node_Str" + getSizeInventory()};
  }
  final ItemStack stack=getStackInSlot(slot);
  if (stack == null) {
    return new Object[]{false,"String_Node_Str"};
  }
  final Item item=stack.getItem();
  if (item instanceof ItemFirework) {
    bufferRocket.addItemStack(stack.splitStack(1));
    return new Object[]{true};
  }
  if (item instanceof ItemFireworkCharge) {
    bufferStar.addItemStack(stack.splitStack(1));
    return new Object[]{true};
  }
  return new Object[]{false,"String_Node_Str"};
}
Program: 144269
Project: 144269
Buggy source:
/** 
 * Loads a pre-made Firework Rocket from the Firework Launchers inventory into the end of the firework rocket launch queue. Or loads a Firework Star from the inventory into the star queue.
 * @param slot the slot the rocket is in
 * @return the result. if crafting failed it will return false, and a string message as to why it failed. if craftingsucceeded then it will return true, and how many more firework stars can be added to the firework rocket
 */
@LuaFunction(isMultiReturn=true) public Object[] load(int slot){
  --slot;
  if (slot < 0 || slot > getSizeInventory()) {
    return new Object[]{false,"String_Node_Str" + getSizeInventory()};
  }
  final ItemStack stack=getStackInSlot(slot);
  if (stack == null) {
    return new Object[]{false,"String_Node_Str"};
  }
  final Item item=stack.getItem();
  if (item instanceof ItemFirework) {
    bufferRocket.addItemStack(stack.splitStack(1));
    return new Object[]{true};
  }
  if (item instanceof ItemFireworkCharge) {
    bufferStar.addItemStack(stack.splitStack(1));
    return new Object[]{true};
  }
  return new Object[]{false,"String_Node_Str"};
}

Fixed version (ground truth):
/** 
 * Loads a single pre-made Firework Rocket from the Firework Launchers inventory into the end of the firework rocket launch queue. Or loads a Firework Star from the inventory into the star queue.
 * @param slot the slot the rocket is in
 * @return the result. if crafting failed it will return false, and a string message as to why it failed. if craftingsucceeded then it will return true, and how many more firework stars can be added to the firework rocket
 */
@LuaFunction(isMultiReturn=true) public Object[] load(int slot){
  --slot;
  if (slot < 0 || slot > getSizeInventory()) {
    return new Object[]{false,"String_Node_Str" + getSizeInventory()};
  }
  final ItemStack stack=getStackInSlot(slot);
  if (stack == null) {
    return new Object[]{false,"String_Node_Str"};
  }
  final Item item=stack.getItem();
  QueueBuffer buffer=null;
  if (item instanceof ItemFirework) {
    buffer=bufferRocket;
  }
  if (item instanceof ItemFireworkCharge) {
    buffer=bufferStar;
  }
  if (buffer == null) {
    return new Object[]{false,"String_Node_Str"};
  }
  if (stack.stackSize == 1) {
    setInventorySlotContents(slot,null);
  }
  return new Object[]{true,buffer.addItemStack(stack.splitStack(1))};
}
Program: 144270
Project: 144270
Buggy source:
protected int findQtyOf(ItemStack template){
  return InventoryUtils.findQtyOf(this,template);
}

Fixed version (ground truth):
protected int findQtyOf(ItemStack stack){
  return InventoryUtils.findQtyOf(this,stack);
}
Program: 144271
Project: 144271
Buggy source:
protected ItemStack extract(ItemStack template,boolean ignoreMeta){
  return InventoryUtils.extract(this,template,1,ignoreMeta);
}

Fixed version (ground truth):
protected ItemStack extract(ItemStack stack){
  return InventoryUtils.takeItems(this,stack,1);
}
Program: 144272
Project: 144272
Buggy source:
private static boolean validColor(int color,boolean multi){
  if (color < 0 || (multi && color > 65535) || (!multi && color > 32768))   return false;
  if (multi)   return true;
  double val=Math.log(color) / Math.log(2);
  return val >= 0 && val <= 15 && val % 1 == 0;
}

Fixed version (ground truth):
private static boolean validColor(int color,boolean multi){
  if (color < 1 || (multi && color > 65535) || (!multi && color > 32768))   return false;
  if (multi)   return true;
  double val=Math.log(color) / Math.log(2);
  return val >= 0 && val <= 15 && val % 1 == 0;
}
Program: 144273
Project: 144273
Buggy source:
@Override protected ItemStack extract(ItemStack template){
  final ItemStack stack=template.copy();
  stack.stackSize=1;
  return stack;
}

Fixed version (ground truth):
@Override protected ItemStack extract(ItemStack stack){
  final ItemStack s=stack.copy();
  s.stackSize=1;
  return s;
}
Program: 144274
Project: 144274
Buggy source:
@Override protected int findQtyOf(ItemStack template){
  return 64;
}

Fixed version (ground truth):
@Override protected int findQtyOf(ItemStack stack){
  return 64;
}
Program: 144275
Project: 144275
Buggy source:
public void insertOrExplode(IInventory inv,World world,int x,int y,int z,int id){
  insertOrExplodeInternal(getItemStackWithId(id),inv,world,x,y,z);
}

Fixed version (ground truth):
public void insertOrExplode(IInventory inv,World world,int x,int y,int z,int id){
  InventoryUtils.storeOrDropItemStack(inv,getItemStackWithId(id),world,x,y,z);
}
Program: 144276
Project: 144276
Buggy source:
public void explodeBuffer(World world,int x,int y,int z){
  for (  final ItemStackWrapper item : inventory) {
    InventoryUtils.spawnInWorld(item.getItemStack(),world,x,y,z);
  }
}

Fixed version (ground truth):
public void explodeBuffer(World world,int x,int y,int z){
  for (  final ItemStackWrapper item : inventory) {
    InventoryUtils.spawnItemStackInWorld(item.getItemStack(),world,x,y,z);
  }
}
Program: 144277
Project: 144277
Buggy source:
private void store(final ItemStack stack){
  if (!storeItemStack(stack)) {
    ChunkCoordinates coordinates=turtle.getPosition();
    int direction=turtle.getDirection();
    int x=coordinates.posX + Facing.offsetsXForSide[direction];
    int y=coordinates.posY + Facing.offsetsYForSide[direction];
    int z=coordinates.posZ + Facing.offsetsZForSide[direction];
    InventoryUtils.spawnInWorld(stack,turtle.getWorld(),x,y,z);
  }
}

Fixed version (ground truth):
private void store(final ItemStack stack){
  if (!storeItemStack(stack)) {
    ChunkCoordinates coordinates=turtle.getPosition();
    int direction=turtle.getDirection();
    int x=coordinates.posX + Facing.offsetsXForSide[direction];
    int y=coordinates.posY + Facing.offsetsYForSide[direction];
    int z=coordinates.posZ + Facing.offsetsZForSide[direction];
    InventoryUtils.spawnItemStackInWorld(stack,turtle.getWorld(),x,y,z);
  }
}
Program: 144278
Project: 144278
Buggy source:
public static void explodeInventory(IInventory inv,World world,int x,int y,int z){
  for (int i=0; i < inv.getSizeInventory(); ++i) {
    spawnInWorld(inv.getStackInSlot(i),world,x,y,z);
  }
}

Fixed version (ground truth):
public static void explodeInventory(IInventory inv,World world,int x,int y,int z){
  for (int i=0; i < inv.getSizeInventory(); ++i) {
    spawnItemStackInWorld(inv.getStackInSlot(i),world,x,y,z);
  }
}
Program: 144279
Project: 144279
Buggy source:
public static int findQtyOf(IInventory inv,ItemStack stack){
  int qty=0;
  for (int i=0; i < inv.getSizeInventory(); ++i) {
    final ItemStack item=inv.getStackInSlot(i);
    if (areItemsStackable(item,stack)) {
      qty+=stack.stackSize;
    }
  }
  return qty;
}

Fixed version (ground truth):
public static int findQtyOf(IInventory inv,ItemStack stack){
  int qty=0;
  for (int i=0; i < inv.getSizeInventory(); ++i) {
    final ItemStack item=inv.getStackInSlot(i);
    if (areItemsStackable(item,stack)) {
      qty+=item.stackSize;
    }
  }
  return qty;
}
Program: 144280
Project: 144280
Buggy source:
public static boolean areItemsStackable(ItemStack a,ItemStack b){
  if (a == b) {
    return true;
  }
  if (a == null || b == null) {
    return false;
  }
  if (a.getItem() == b.getItem()) {
    if (((!a.getHasSubtypes()) && (!a.isItemStackDamageable())) || (a.getItemDamage() == b.getItemDamage())) {
      if (a.stackTagCompound == null && b.stackTagCompound == null) {
        return true;
      }
      if (a.stackTagCompound != null && b.stackTagCompound != null && a.stackTagCompound.equals(b.stackTagCompound)) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean areItemsStackable(ItemStack a,ItemStack b){
  if (a == null || b == null) {
    return false;
  }
  if (a == b) {
    return true;
  }
  if (a.getItem() == b.getItem()) {
    if (((!a.getHasSubtypes()) && (!a.isItemStackDamageable())) || (a.getItemDamage() == b.getItemDamage())) {
      if (a.stackTagCompound == null && b.stackTagCompound == null) {
        return true;
      }
      if (a.stackTagCompound != null && b.stackTagCompound != null && a.stackTagCompound.equals(b.stackTagCompound)) {
        return true;
      }
    }
  }
  return false;
}
Program: 144281
Project: 144281
Buggy source:
private static ArrayList<String> getDescription(QueueBuffer buffer,int id) throws LuaException {
  final ArrayList<String> info=Lists.newArrayList();
  final ItemStack stack=buffer.getItemStackWithId(id);
  stack.getItem().addInformation(stack,null,info,true);
  for (int i=0; i < info.size(); ++i) {
    info.set(i,ChatAllowedCharacters.filerAllowedCharacters(info.get(i)));
  }
  return info;
}

Fixed version (ground truth):
private static ArrayList<String> getDescription(QueueBuffer buffer,int id) throws LuaException {
  final ArrayList<String> info=Lists.newArrayList();
  final ItemStack stack=buffer.peekItemStackWithId(id);
  stack.getItem().addInformation(stack,null,info,true);
  for (int i=0; i < info.size(); ++i) {
    info.set(i,ChatAllowedCharacters.filerAllowedCharacters(info.get(i)));
  }
  return info;
}
Program: 144282
Project: 144282
Buggy source:
/** 
 * Loads a pre-made Firework Rocket from the Firework Launchers inventory into the end of the firework rocket launch queue. Or loads a Firework Star from the inventory into the star queue.
 * @param slot the slot the rocket is in
 * @return the result. if crafting failed it will return false, and a string message as to why it failed. if craftingsucceeded then it will return true, and how many more firework stars can be added to the firework rocket
 */
@LuaFunction(isMultiReturn=true) public Object[] load(int slot){
  --slot;
  if (slot < 0 || slot > getSizeInventory()) {
    return new Object[]{false,"String_Node_Str" + getSizeInventory()};
  }
  final ItemStack stack=getStackInSlot(slot);
  final Item item=stack.getItem();
  if (item instanceof ItemFirework) {
    bufferRocket.addItemStack(stack);
    return new Object[]{true};
  }
  if (item instanceof ItemFireworkCharge) {
    bufferStar.addItemStack(stack);
    return new Object[]{true};
  }
  return new Object[]{false,"String_Node_Str"};
}

Fixed version (ground truth):
/** 
 * Loads a pre-made Firework Rocket from the Firework Launchers inventory into the end of the firework rocket launch queue. Or loads a Firework Star from the inventory into the star queue.
 * @param slot the slot the rocket is in
 * @return the result. if crafting failed it will return false, and a string message as to why it failed. if craftingsucceeded then it will return true, and how many more firework stars can be added to the firework rocket
 */
@LuaFunction(isMultiReturn=true) public Object[] load(int slot){
  --slot;
  if (slot < 0 || slot > getSizeInventory()) {
    return new Object[]{false,"String_Node_Str" + getSizeInventory()};
  }
  final ItemStack stack=getStackInSlot(slot);
  final Item item=stack.getItem();
  if (item instanceof ItemFirework) {
    bufferRocket.addItemStack(stack.splitStack(1));
    return new Object[]{true};
  }
  if (item instanceof ItemFireworkCharge) {
    bufferStar.addItemStack(stack.splitStack(1));
    return new Object[]{true};
  }
  return new Object[]{false,"String_Node_Str"};
}
Program: 144283
Project: 144283
Buggy source:
public ItemStack getNextItemStack(){
  return inventory.size() > 0 ? inventory.remove(1).getItemStack() : null;
}

Fixed version (ground truth):
public ItemStack getNextItemStack(){
  return inventory.size() > 0 ? inventory.remove(0).getItemStack() : null;
}
Program: 144284
Project: 144284
Buggy source:
@LuaFunction public void playNote(int instrument,int pitch) throws Exception {
  Preconditions.checkArgument(instrument >= MIN_INST && instrument <= MAX_INST,"String_Node_Str");
  Preconditions.checkArgument(pitch >= MIN_PITCH && pitch <= MAX_PITCH,"String_Node_Str");
  Preconditions.checkArgument(ticker++ <= MAX_TICK,"String_Node_Str" + MAX_TICK + "String_Node_Str");
  Preconditions.checkArgument(ConfigHandler.noteRange > 0,"String_Node_Str");
  play(worldObj,xCoord,yCoord,zCoord,instrument,pitch);
  int dimId=worldObj.provider.dimensionId;
  MessageGeneric message=new MessageGeneric();
  message.intData=new int[]{dimId,xCoord,yCoord,zCoord,instrument,pitch};
  PacketHandler.INSTANCE.sendToAllAround(message,new NetworkRegistry.TargetPoint(dimId,xCoord,yCoord,zCoord,ConfigHandler.noteRange));
}

Fixed version (ground truth):
@LuaFunction public void playNote(int instrument,int pitch) throws Exception {
  Preconditions.checkArgument(instrument >= MIN_INST && instrument <= MAX_INST,"String_Node_Str");
  Preconditions.checkArgument(pitch >= MIN_PITCH && pitch <= MAX_PITCH,"String_Node_Str");
  Preconditions.checkArgument(ticker++ < MAX_TICK,"String_Node_Str" + MAX_TICK + "String_Node_Str");
  Preconditions.checkArgument(ConfigHandler.noteRange > 0,"String_Node_Str");
  play(worldObj,xCoord,yCoord,zCoord,instrument,pitch);
  int dimId=worldObj.provider.dimensionId;
  MessageGeneric message=new MessageGeneric();
  message.intData=new int[]{dimId,xCoord,yCoord,zCoord,instrument,pitch};
  PacketHandler.INSTANCE.sendToAllAround(message,new NetworkRegistry.TargetPoint(dimId,xCoord,yCoord,zCoord,ConfigHandler.noteRange));
}
Program: 144285
Project: 144285
Buggy source:
@Override public float getPlayerRelativeBlockHardness(EntityPlayer player,World world,int x,int y,int z){
  final TileEntity tile=world.getTileEntity(x,y,z);
  if ((((TileMoarP)tile).canPlayerAccess(player) || isOpBreakable(player))) {
    return blockHardness;
  }
  return -1.0f;
}

Fixed version (ground truth):
@Override public float getPlayerRelativeBlockHardness(EntityPlayer player,World world,int x,int y,int z){
  final TileEntity tile=world.getTileEntity(x,y,z);
  if (tile == null || (((TileMoarP)tile).canPlayerAccess(player) || isOpBreakable(player))) {
    return blockHardness;
  }
  return -1.0f;
}
Program: 144286
Project: 144286
Buggy source:
@Override public IMessage onMessage(MessageIronNote message,MessageContext ctx){
  final World world=MoarPeripherals.proxy.getClientWorld(intData[0]);
  TileIronNote.play(world,intData[1],intData[2],intData[3],intData[4],intData[5]);
  return null;
}

Fixed version (ground truth):
@Override public IMessage onMessage(MessageIronNote message,MessageContext ctx){
  final World world=MoarPeripherals.proxy.getClientWorld(message.intData[0]);
  TileIronNote.play(world,message.intData[1],message.intData[2],message.intData[3],message.intData[4],message.intData[5]);
  return null;
}
Program: 144287
Project: 144287
Buggy source:
public static void init(){
  INSTANCE.registerMessage(MessageIronNote.class,MessageIronNote.class,id++,Side.SERVER);
}

Fixed version (ground truth):
public static void init(){
  INSTANCE.registerMessage(MessageIronNoteHandler.class,MessageGeneric.class,id++,Side.CLIENT);
}
Program: 144288
Project: 144288
Buggy source:
@LuaFunction public void playNote(int instrument,int pitch) throws Exception {
  Preconditions.checkArgument(instrument >= MIN_INST && instrument <= MAX_INST,"String_Node_Str");
  Preconditions.checkArgument(pitch >= MIN_PITCH && pitch <= MAX_PITCH,"String_Node_Str");
  Preconditions.checkArgument(ticker++ <= MAX_TICK,"String_Node_Str" + MAX_TICK + "String_Node_Str");
  Preconditions.checkArgument(ConfigHandler.noteRange > 0,"String_Node_Str");
  play(worldObj,xCoord,yCoord,zCoord,instrument,pitch);
  int dimId=worldObj.provider.dimensionId;
  MessageIronNote message=new MessageIronNote();
  message.intData=new int[]{dimId,xCoord,yCoord,zCoord,instrument,pitch};
  PacketHandler.INSTANCE.sendToAllAround(message,new NetworkRegistry.TargetPoint(dimId,xCoord,yCoord,zCoord,ConfigHandler.noteRange));
}

Fixed version (ground truth):
@LuaFunction public void playNote(int instrument,int pitch) throws Exception {
  Preconditions.checkArgument(instrument >= MIN_INST && instrument <= MAX_INST,"String_Node_Str");
  Preconditions.checkArgument(pitch >= MIN_PITCH && pitch <= MAX_PITCH,"String_Node_Str");
  Preconditions.checkArgument(ticker++ <= MAX_TICK,"String_Node_Str" + MAX_TICK + "String_Node_Str");
  Preconditions.checkArgument(ConfigHandler.noteRange > 0,"String_Node_Str");
  play(worldObj,xCoord,yCoord,zCoord,instrument,pitch);
  int dimId=worldObj.provider.dimensionId;
  MessageGeneric message=new MessageGeneric();
  message.intData=new int[]{dimId,xCoord,yCoord,zCoord,instrument,pitch};
  PacketHandler.INSTANCE.sendToAllAround(message,new NetworkRegistry.TargetPoint(dimId,xCoord,yCoord,zCoord,ConfigHandler.noteRange));
}
Program: 144289
Project: 144289
Buggy source:
TriplesMapImpl(RDF rdf,LogicalTable lt,SubjectMap sm,String resourceIdentifier){
  super(rdf);
  pomList=new ArrayList<>();
  setLogicalTable(lt);
  setSubjectMap(sm);
  setNode(getRDF().createIRI(resourceIdentifier));
}

Fixed version (ground truth):
TriplesMapImpl(RDF rdf,LogicalTable lt,SubjectMap sm,String resourceIdentifier){
  super(rdf);
  pomList=new ArrayList<>();
  setLogicalTable(lt);
  setSubjectMap(sm);
  String triplesMapIRI=resourceIdentifier.contains("String_Node_Str") ? resourceIdentifier : "String_Node_Str" + resourceIdentifier;
  setNode(getRDF().createIRI(triplesMapIRI));
}
Program: 144290
Project: 144290
Buggy source:
@Override public void addGraphMap(List<GraphMap> gms){
  graphList.addAll(gms);
}

Fixed version (ground truth):
@Override public void addGraphMap(GraphMap gm){
  graphList.add(gm);
}