nus-yam/ex-repair huggingface dataset:
Program: 40061
Project: 40061
Buggy source:
@Override public void put(Collection<SinkRecord> records){
  log.info("String_Node_Str",records.size());
  handleFailedBatches();
  bufferedRecords.addAll(records);
  if (bufferedRecords.size() < connectorConfig.maxBatchSize) {
    if (System.currentTimeMillis() - lastFlushed < flushWindow) {
      return;
    }
    if (bufferedRecords.isEmpty()) {
      lastFlushed=System.currentTimeMillis();
      return;
    }
  }
  records=bufferedRecords;
  bufferedRecords=new ArrayList<>();
  lastFlushed=System.currentTimeMillis();
  if (connectorConfig.raw) {
    handleRaw(records);
  }
 else {
    handleEvent(records);
  }
}

Fixed version (ground truth):
@Override public void put(Collection<SinkRecord> records){
  log.info("String_Node_Str",records.size());
  handleFailedBatches();
  preventTooManyOutstandingEvents();
  bufferedRecords.addAll(records);
  if (bufferedRecords.size() < connectorConfig.maxBatchSize) {
    if (System.currentTimeMillis() - lastFlushed < flushWindow) {
      return;
    }
    if (bufferedRecords.isEmpty()) {
      lastFlushed=System.currentTimeMillis();
      return;
    }
  }
  records=bufferedRecords;
  bufferedRecords=new ArrayList<>();
  lastFlushed=System.currentTimeMillis();
  if (connectorConfig.raw) {
    handleRaw(records);
  }
 else {
    handleEvent(records);
  }
}
Program: 40062
Project: 40062
Buggy source:
private void handleFailedBatches(){
  Collection<EventBatch> failed=tracker.getAndRemoveFailedRecords();
  for (  final EventBatch batch : failed) {
    send(batch);
  }
  if (!failed.isEmpty()) {
    log.info("String_Node_Str",failed.size());
    throw new RetriableException(new HecException("String_Node_Str"));
  }
}

Fixed version (ground truth):
private void handleFailedBatches(){
  Collection<EventBatch> failed=tracker.getAndRemoveFailedRecords();
  for (  final EventBatch batch : failed) {
    if (connectorConfig.maxRetries > 0 && batch.getFailureCount() > connectorConfig.maxRetries) {
      log.error("String_Node_Str",batch.size(),connectorConfig.maxRetries);
      continue;
    }
    send(batch);
  }
  if (!failed.isEmpty()) {
    log.info("String_Node_Str",failed.size());
    throw new RetriableException(new HecException("String_Node_Str"));
  }
}
Program: 40063
Project: 40063
Buggy source:
@Test(expected=ConfigException.class) public void createWithInvalidEnrichment(){
  UnitUtil uu=new UnitUtil();
  Map<String,String> config=uu.createTaskConfig();
  config.put(SplunkSinkConnectorConfig.ENRICHEMENT_CONF,"String_Node_Str");
  SplunkSinkConnectorConfig connectorConfig=new SplunkSinkConnectorConfig(config);
}

Fixed version (ground truth):
@Test(expected=ConfigException.class) public void createWithInvalidEnrichment(){
  UnitUtil uu=new UnitUtil();
  Map<String,String> config=uu.createTaskConfig();
  config.put(SplunkSinkConnectorConfig.ENRICHMENT_CONF,"String_Node_Str");
  SplunkSinkConnectorConfig connectorConfig=new SplunkSinkConnectorConfig(config);
}
Program: 40064
Project: 40064
Buggy source:
@Test public void create(){
  UnitUtil uu=new UnitUtil();
  uu.enrichementMap.put("String_Node_Str","String_Node_Str");
  Map<String,String> config=uu.createTaskConfig();
  SplunkSinkConnectorConfig connectorConfig=new SplunkSinkConnectorConfig(config);
  Assert.assertEquals(uu.enrichementMap,connectorConfig.enrichements);
  Assert.assertEquals(1,connectorConfig.topicMetas.size());
  Assert.assertEquals(0,connectorConfig.topicMetas.get("String_Node_Str").size());
  assertMeta(connectorConfig);
  commonAssert(connectorConfig);
}

Fixed version (ground truth):
@Test public void create(){
  UnitUtil uu=new UnitUtil();
  uu.enrichementMap.put("String_Node_Str","String_Node_Str");
  Map<String,String> config=uu.createTaskConfig();
  SplunkSinkConnectorConfig connectorConfig=new SplunkSinkConnectorConfig(config);
  Assert.assertEquals(uu.enrichementMap,connectorConfig.enrichments);
  Assert.assertEquals(1,connectorConfig.topicMetas.size());
  Assert.assertEquals(0,connectorConfig.topicMetas.get("String_Node_Str").size());
  assertMeta(connectorConfig);
  commonAssert(connectorConfig);
}
Program: 40065
Project: 40065
Buggy source:
@Test public void createWithoutEnrichment(){
  UnitUtil uu=new UnitUtil();
  Map<String,String> config=uu.createTaskConfig();
  config.put(SplunkSinkConnectorConfig.ENRICHEMENT_CONF,"String_Node_Str");
  SplunkSinkConnectorConfig connectorConfig=new SplunkSinkConnectorConfig(config);
  Assert.assertNull(connectorConfig.enrichements);
  assertMeta(connectorConfig);
  commonAssert(connectorConfig);
  config.put(SplunkSinkConnectorConfig.ENRICHEMENT_CONF,null);
  connectorConfig=new SplunkSinkConnectorConfig(config);
  Assert.assertNull(connectorConfig.enrichements);
  assertMeta(connectorConfig);
  commonAssert(connectorConfig);
}

Fixed version (ground truth):
@Test public void createWithoutEnrichment(){
  UnitUtil uu=new UnitUtil();
  Map<String,String> config=uu.createTaskConfig();
  config.put(SplunkSinkConnectorConfig.ENRICHMENT_CONF,"String_Node_Str");
  SplunkSinkConnectorConfig connectorConfig=new SplunkSinkConnectorConfig(config);
  Assert.assertNull(connectorConfig.enrichments);
  assertMeta(connectorConfig);
  commonAssert(connectorConfig);
  config.put(SplunkSinkConnectorConfig.ENRICHMENT_CONF,null);
  connectorConfig=new SplunkSinkConnectorConfig(config);
  Assert.assertNull(connectorConfig.enrichments);
  assertMeta(connectorConfig);
  commonAssert(connectorConfig);
}
Program: 40067
Project: 40067
Buggy source:
@Test public void putWithoutMaxBatchAligned(){
  UnitUtil uu=new UnitUtil();
  Map<String,String> config=uu.createTaskConfig();
  config.put(SplunkSinkConnectorConfig.RAW_CONF,String.valueOf(false));
  config.put(SplunkSinkConnectorConfig.ACK_CONF,String.valueOf(true));
  config.put(SplunkSinkConnectorConfig.MAX_BATCH_SIZE_CONF,String.valueOf(100));
  SplunkSinkTask task=new SplunkSinkTask();
  HecMock hec=new HecMock(task);
  hec.setSendReturnResult(HecMock.success);
  task.setHec(hec);
  task.start(config);
  task.put(createSinkRecords(120));
  Assert.assertEquals(2,hec.getBatches().size());
  Map<TopicPartition,OffsetAndMetadata> offsets=new HashMap<>();
  offsets.put(new TopicPartition(uu.topics,1),new OffsetAndMetadata(120));
  Assert.assertEquals(offsets,task.preCommit(null));
  Assert.assertTrue(task.getTracker().getAndRemoveFailedRecords().isEmpty());
  task.stop();
}

Fixed version (ground truth):
@Test public void putWithoutMaxBatchAligned(){
  UnitUtil uu=new UnitUtil();
  Map<String,String> config=uu.createTaskConfig();
  config.put(SplunkSinkConnectorConfig.RAW_CONF,String.valueOf(false));
  config.put(SplunkSinkConnectorConfig.ACK_CONF,String.valueOf(true));
  config.put(SplunkSinkConnectorConfig.MAX_BATCH_SIZE_CONF,String.valueOf(100));
  SplunkSinkTask task=new SplunkSinkTask();
  HecMock hec=new HecMock(task);
  hec.setSendReturnResult(HecMock.success);
  task.setHec(hec);
  task.start(config);
  task.put(createSinkRecords(120));
  Assert.assertEquals(2,hec.getBatches().size());
  Map<TopicPartition,OffsetAndMetadata> offsets=new HashMap<>();
  offsets.put(new TopicPartition(uu.topics,1),new OffsetAndMetadata(120));
  Assert.assertEquals(offsets,task.preCommit(new HashMap<>()));
  Assert.assertTrue(task.getTracker().getAndRemoveFailedRecords().isEmpty());
  task.stop();
}
Program: 40069
Project: 40069
Buggy source:
public final void addExtraFields(final Map<String,String> fields){
  for (  final Event event : events) {
    event.addFields(fields);
  }
}

Fixed version (ground truth):
public final void addExtraFields(final Map<String,String> fields){
  int newLength=0;
  for (  final Event event : events) {
    event.addFields(fields);
    newLength+=event.length();
  }
  len=newLength;
}
Program: 40070
Project: 40070
Buggy source:
public ConcurrentHec(int numberOfThreads,boolean useAck,HecClientConfig config,PollerCallback cb){
  batches=new LinkedBlockingQueue<>(100);
  executorService=Executors.newFixedThreadPool(numberOfThreads);
  initHec(numberOfThreads,useAck,config,cb);
  pollerCallback=cb;
  stopped=false;
  for (int i=0; i < numberOfThreads; i++) {
    final int id=i;
    Runnable r=() -> {
      run(id);
    }
;
    executorService.submit(r);
  }
}

Fixed version (ground truth):
public ConcurrentHec(int numberOfThreads,boolean useAck,HecClientConfig config,PollerCallback cb){
  batches=new LinkedBlockingQueue<>(100);
  ThreadFactory e=(  Runnable r) -> new Thread(r,"String_Node_Str");
  executorService=Executors.newFixedThreadPool(numberOfThreads,e);
  initHec(numberOfThreads,useAck,config,cb);
  pollerCallback=cb;
  stopped=false;
  for (int i=0; i < numberOfThreads; i++) {
    final int id=i;
    Runnable r=() -> {
      run(id);
    }
;
    executorService.submit(r);
  }
}
Program: 40071
Project: 40071
Buggy source:
private void run(int id){
  final Hec hec=hecs.get(id);
  while (!stopped) {
    EventBatch batch;
    try {
      batch=batches.poll(1,TimeUnit.SECONDS);
    }
 catch (    InterruptedException ex) {
      continue;
    }
    send(hec,batch);
  }
  hec.close();
}

Fixed version (ground truth):
private void run(int id){
  final Hec hec=hecs.get(id);
  while (!stopped) {
    EventBatch batch;
    try {
      batch=batches.poll(1,TimeUnit.SECONDS);
    }
 catch (    InterruptedException ex) {
      continue;
    }
    if (batch != null) {
      send(hec,batch);
    }
  }
  hec.close();
}
Program: 40072
Project: 40072
Buggy source:
public void setRepeatingAlarm(Context context,String type,String time,String message){
  AlarmManager alarmManager=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
  Intent intent=new Intent(context,AlarmReceiver.class);
  intent.putExtra(EXTRA_MESSAGE,message);
  intent.putExtra(EXTRA_TYPE,type);
  String timeArray[]=time.split("String_Node_Str");
  Calendar calendar=Calendar.getInstance();
  calendar.set(Calendar.HOUR_OF_DAY,Integer.parseInt(timeArray[0]));
  calendar.set(Calendar.MINUTE,Integer.parseInt(timeArray[1]));
  calendar.set(Calendar.SECOND,0);
  int requestCode=NOTIF_ID_REPEATING;
  PendingIntent pendingIntent=PendingIntent.getBroadcast(context,requestCode,intent,0);
  alarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP,calendar.getTimeInMillis(),AlarmManager.INTERVAL_DAY,pendingIntent);
}

Fixed version (ground truth):
public void setRepeatingAlarm(Context context,String type,String time,String message){
  AlarmManager alarmManager=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
  Intent intent=new Intent(context,AlarmReceiver.class);
  intent.putExtra(EXTRA_MESSAGE,message);
  intent.putExtra(EXTRA_TYPE,type);
  String timeArray[]=time.split("String_Node_Str");
  Calendar calendar=Calendar.getInstance();
  calendar.set(Calendar.HOUR_OF_DAY,Integer.parseInt(timeArray[0]));
  calendar.set(Calendar.MINUTE,Integer.parseInt(timeArray[1]));
  calendar.set(Calendar.SECOND,0);
  if (calendar.before(Calendar.getInstance()))   calendar.add(Calendar.DATE,1);
  int requestCode=NOTIF_ID_REPEATING;
  PendingIntent pendingIntent=PendingIntent.getBroadcast(context,requestCode,intent,PendingIntent.FLAG_UPDATE_CURRENT);
  alarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP,calendar.getTimeInMillis(),AlarmManager.INTERVAL_DAY,pendingIntent);
}
Program: 40073
Project: 40073
Buggy source:
@Override public void onResponse(Call<UpcomingModel> call,Response<UpcomingModel> response){
  if (response.isSuccessful()) {
    List<ResultsItem> items=response.body().getResults();
    int index=new Random().nextInt(items.size());
    String title=items.get(index).getTitle();
    String message=items.get(index).getOverview();
    int notifId=200;
    showNotification(getApplicationContext(),title,message,notifId);
  }
 else   loadFailed();
}

Fixed version (ground truth):
@Override public void onResponse(Call<UpcomingModel> call,Response<UpcomingModel> response){
  if (response.isSuccessful()) {
    List<ResultsItem> items=response.body().getResults();
    int index=new Random().nextInt(items.size());
    ResultsItem item=items.get(index);
    String title=items.get(index).getTitle();
    String message=items.get(index).getOverview();
    int notifId=200;
    showNotification(getApplicationContext(),title,message,notifId,item);
  }
 else   loadFailed();
}
Program: 40074
Project: 40074
Buggy source:
private void loadData(){
  apiCall=apiClient.getService().getUpcomingMovie();
  apiCall.enqueue(new Callback<UpcomingModel>(){
    @Override public void onResponse(    Call<UpcomingModel> call,    Response<UpcomingModel> response){
      if (response.isSuccessful()) {
        List<ResultsItem> items=response.body().getResults();
        int index=new Random().nextInt(items.size());
        String title=items.get(index).getTitle();
        String message=items.get(index).getOverview();
        int notifId=200;
        showNotification(getApplicationContext(),title,message,notifId);
      }
 else       loadFailed();
    }
    @Override public void onFailure(    Call<UpcomingModel> call,    Throwable t){
      loadFailed();
    }
  }
);
}

Fixed version (ground truth):
private void loadData(){
  apiCall=apiClient.getService().getUpcomingMovie();
  apiCall.enqueue(new Callback<UpcomingModel>(){
    @Override public void onResponse(    Call<UpcomingModel> call,    Response<UpcomingModel> response){
      if (response.isSuccessful()) {
        List<ResultsItem> items=response.body().getResults();
        int index=new Random().nextInt(items.size());
        ResultsItem item=items.get(index);
        String title=items.get(index).getTitle();
        String message=items.get(index).getOverview();
        int notifId=200;
        showNotification(getApplicationContext(),title,message,notifId,item);
      }
 else       loadFailed();
    }
    @Override public void onFailure(    Call<UpcomingModel> call,    Throwable t){
      loadFailed();
    }
  }
);
}
Program: 40075
Project: 40075
Buggy source:
private void showNotification(Context context,String title,String message,int notifId){
  NotificationManager notificationManagerCompat=(NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
  Uri alarmSound=RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
  NotificationCompat.Builder builder=new NotificationCompat.Builder(context).setSmallIcon(R.mipmap.ic_launcher_round).setContentTitle(title).setContentText(message).setColor(ContextCompat.getColor(context,android.R.color.black)).setVibrate(new long[]{1000,1000,1000,1000,1000}).setSound(alarmSound);
  notificationManagerCompat.notify(notifId,builder.build());
}

Fixed version (ground truth):
private void showNotification(Context context,String title,String message,int notifId,ResultsItem item){
  NotificationManager notificationManagerCompat=(NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
  Uri alarmSound=RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
  Intent intent=new Intent(context,DetailActivity.class);
  intent.putExtra(DetailActivity.MOVIE_ITEM,new Gson().toJson(item));
  PendingIntent pendingIntent=PendingIntent.getActivity(context,notifId,intent,PendingIntent.FLAG_UPDATE_CURRENT);
  NotificationCompat.Builder builder=new NotificationCompat.Builder(context).setSmallIcon(R.mipmap.ic_launcher_round).setContentTitle(title).setContentText(message).setColor(ContextCompat.getColor(context,android.R.color.transparent)).setContentIntent(pendingIntent).setAutoCancel(true).setVibrate(new long[]{1000,1000,1000,1000,1000}).setSound(alarmSound);
  notificationManagerCompat.notify(notifId,builder.build());
}
Program: 40076
Project: 40076
Buggy source:
public void createPeriodicTask(){
  Task periodicTask=new PeriodicTask.Builder().setService(SchedulerService.class).setPeriod(60).setFlex(10).setTag(SchedulerService.TAG_TASK_UPCOMING).setPersisted(true).build();
  mGcmNetworkManager.schedule(periodicTask);
}

Fixed version (ground truth):
public void createPeriodicTask(){
  Task periodicTask=new PeriodicTask.Builder().setService(SchedulerService.class).setPeriod(3 * 60 * 1000).setFlex(10).setTag(SchedulerService.TAG_TASK_UPCOMING).setPersisted(true).build();
  mGcmNetworkManager.schedule(periodicTask);
}
Program: 40077
Project: 40077
Buggy source:
private void loadDummyData(){
  list.clear();
  for (int i=0; i <= 10; i++) {
    ResultsItem item=new ResultsItem();
    item.setTitle("String_Node_Str" + i);
    item.setOverview("String_Node_Str" + i);
    item.setReleaseDate("String_Node_Str");
    list.add(item);
  }
  adapter.replaceAll(list);
}

Fixed version (ground truth):
private void loadDummyData(){
  list.clear();
  for (int i=0; i <= 10; i++) {
    ResultsItem item=new ResultsItem();
    item.setTitle("String_Node_Str" + i);
    item.setOverview("String_Node_Str" + i);
    item.setReleaseDate(DateTime.getLongDate("String_Node_Str" + i));
    list.add(item);
  }
  adapter.replaceAll(list);
}
Program: 40080
Project: 40080
Buggy source:
/** 
 * Creates a new embedded instance of GraphDB in the provided directory.
 * @param baseDir a directory where to store repositories
 * @throws RepositoryException
 */
public EmbeddedGraphDB(String baseDir) throws RepositoryException {
  repositoryManager=new LocalRepositoryManager(new File(baseDir));
  repositoryManager.initialize();
}

Fixed version (ground truth):
/** 
 * Creates a new embedded instance of GraphDB in the provided directory.
 * @param baseDir a directory where to store repositories
 * @throws RepositoryException
 */
private EmbeddedGraphDB(String baseDir) throws RepositoryException {
  repositoryManager=new LocalRepositoryManager(new File(baseDir));
  repositoryManager.initialize();
}
Program: 40081
Project: 40081
Buggy source:
@Override public void close() throws RepositoryException {
  super.close();
  try {
    embeddedGraphDB.close();
  }
 catch (  IOException e) {
    throw new RepositoryException(e);
  }
}

Fixed version (ground truth):
@Override public void close() throws RepositoryException {
  super.close();
  try {
    if (singleton != null) {
      singleton.close();
    }
  }
 catch (  IOException e) {
    throw new RepositoryException(e);
  }
}
Program: 40082
Project: 40082
Buggy source:
protected String generateItemID(){
  String id=UUID.randomUUID().toString();
  return id.substring(0,id.indexOf('-'));
}

Fixed version (ground truth):
protected abstract String generateItemID();
Program: 40083
Project: 40083
Buggy source:
protected String getItemID(HttpServletRequest req){
  String uri=req.getRequestURI();
  return uri.substring(uri.lastIndexOf("String_Node_Str") + 1,uri.length());
}

Fixed version (ground truth):
protected abstract String getItemID(HttpServletRequest req);
Program: 40084
Project: 40084
Buggy source:
private boolean hasExpired(String uri){
  Resource res=ResourceFactory.createResource(uri);
  try (RDFConnection conn=Connector.getConnection()){
    return Txn.calculateRead(conn,() -> {
      Query q=Queries.hasExpired(res);
      return conn.queryAsk(q);
    }
);
  }
 }

Fixed version (ground truth):
boolean hasExpired(){
  Resource res=ResourceFactory.createResource(uri);
  try (RDFConnection conn=Connector.getConnection()){
    return Txn.calculateRead(conn,() -> {
      Query q=Queries.hasExpired(res);
      return conn.queryAsk(q);
    }
);
  }
 }
Program: 40085
Project: 40085
Buggy source:
@Override public void get(Map<String,String> parameters,OutputStream out) throws RESTException {
  if (hasExpired(uri)) {
    delete(parameters);
    throw new NotFoundException();
  }
  super.get(parameters,out);
}

Fixed version (ground truth):
@Override public void get(Map<String,String> parameters,OutputStream out) throws RESTException {
  if (hasExpired()) {
    delete(parameters);
    throw new NotFoundException();
  }
  super.get(parameters,out);
}
Program: 40086
Project: 40086
Buggy source:
@Override public void delete(Map<String,String> parameters) throws RESTException {
  super.delete(parameters);
  try (RDFConnection conn=Connector.getConnection()){
    Txn.executeWrite(conn,() -> {
      removeDocument(uri,conn);
    }
);
  }
 }

Fixed version (ground truth):
@Override public void delete(Map<String,String> parameters) throws RESTException {
  super.delete(parameters);
  try (RDFConnection conn=Connector.getConnection()){
    Txn.executeWrite(conn,() -> {
      removeDocument(uri,conn);
    }
);
  }
   ThingDirectory.LOG.info("String_Node_Str" + path);
}
Program: 40087
Project: 40087
Buggy source:
@Override public RESTResource post(Map<String,String> parameters,InputStream payload) throws RESTException {
  String id=idQueue.poll();
  String childPath=path + "String_Node_Str" + (id != null ? id : generateChildID());
  RESTResource child=factory.create(childPath,parameters,payload);
  children.add(child);
  for (  RESTResourceListener l : listeners) {
    l.onCreate(child);
  }
  return child;
}

Fixed version (ground truth):
@Override public RESTResource post(Map<String,String> parameters,InputStream payload) throws RESTException {
  String id=idQueue.poll();
  String childPath=path + "String_Node_Str" + (id != null ? id : generateChildID());
  RESTResource child=factory.create(childPath,parameters,payload);
  children.add(child);
  for (  RESTResourceListener l : listeners) {
    l.onCreate(child);
  }
  child.addListener(new RESTResourceListener(){
    @Override public void onDelete(    RESTResource resource){
      children.remove(resource);
    }
    @Override public void onCreate(    RESTResource resource){
    }
  }
);
  return child;
}
Program: 40088
Project: 40088
Buggy source:
@Override protected void doPut(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  try {
    resource.put(params(req),req.getInputStream());
  }
 catch (  BadRequestException e) {
    resp.sendError(400);
  }
catch (  RESTException e) {
    resp.sendError(500);
  }
}

Fixed version (ground truth):
@Override protected void doPut(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  try {
    RESTResource res=select(req);
    res.put(params(req),req.getInputStream());
  }
 catch (  BadRequestException e) {
    resp.sendError(400);
  }
catch (  NotFoundException e) {
    resp.sendError(404);
  }
catch (  RESTException e) {
    resp.sendError(500);
  }
}
Program: 40089
Project: 40089
Buggy source:
@Override protected void doDelete(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  try {
    resource.delete(params(req));
  }
 catch (  BadRequestException e) {
    resp.sendError(400);
  }
catch (  RESTException e) {
    resp.sendError(500);
  }
}

Fixed version (ground truth):
@Override protected void doDelete(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  try {
    RESTResource res=select(req);
    res.delete(params(req));
  }
 catch (  BadRequestException e) {
    resp.sendError(400);
  }
catch (  NotFoundException e) {
    resp.sendError(404);
  }
catch (  RESTException e) {
    resp.sendError(500);
  }
}
Program: 40090
Project: 40090
Buggy source:
@Override protected void doPost(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  try {
    RESTResource child=resource.post(params(req),req.getInputStream());
    resp.setStatus(201);
    resp.setHeader("String_Node_Str",child.getPath());
  }
 catch (  BadRequestException e) {
    resp.sendError(400);
  }
catch (  RESTException e) {
    resp.sendError(500);
  }
}

Fixed version (ground truth):
@Override protected void doPost(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  try {
    RESTResource res=select(req);
    RESTResource child=res.post(params(req),req.getInputStream());
    resp.setStatus(201);
    resp.setHeader("String_Node_Str",child.getPath());
  }
 catch (  BadRequestException e) {
    resp.sendError(400);
  }
catch (  NotFoundException e) {
    resp.sendError(404);
  }
catch (  RESTException e) {
    resp.sendError(500);
  }
}
Program: 40091
Project: 40091
Buggy source:
@Override protected void doGet(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  try {
    resource.get(params(req),resp.getOutputStream());
    resp.setContentType(resource.getContentType());
  }
 catch (  BadRequestException e) {
    resp.sendError(400);
  }
catch (  RESTException e) {
    resp.sendError(500);
  }
}

Fixed version (ground truth):
@Override protected void doGet(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  try {
    RESTResource res=select(req);
    res.get(params(req),resp.getOutputStream());
    resp.setContentType(res.getContentType());
  }
 catch (  BadRequestException e) {
    resp.sendError(400);
  }
catch (  NotFoundException e) {
    resp.sendError(404);
  }
catch (  RESTException e) {
    resp.sendError(500);
  }
}
Program: 40092
Project: 40092
Buggy source:
@Override public void onCreate(RESTResource resource){
  ServletHolder holder=new ServletHolder(new HTTPResourceContainer(resource));
  handler.addServletWithMapping(holder,resource.getPath());
  resource.addListener(this);
}

Fixed version (ground truth):
@Override public void onCreate(RESTResource resource){
  if (!isMapped(resource)) {
    ServletHolder holder=new ServletHolder(new HTTPResourceContainer(resource));
    handler.addServletWithMapping(holder,resource.getPath());
    resource.addListener(this);
    if (resource instanceof CollectionResource && !(resource instanceof IndexResource)) {
      HttpServlet collectionContainer=new HTTPCollectionContainer((CollectionResource)resource);
      ServletHolder collectionHolder=new ServletHolder(collectionContainer);
      handler.addServletWithMapping(collectionHolder,resource.getPath() + "String_Node_Str");
    }
  }
}
Program: 40093
Project: 40093
Buggy source:
public static void main(String[] args) throws Exception {
  int portCoAP=5683;
  int portHTTP=8080;
  String loc="String_Node_Str";
  String lucene="String_Node_Str";
  if (args.length >= 1) {
    loc=args[0];
  }
  if (args.length >= 2) {
    portCoAP=Integer.parseInt(args[1]);
  }
  if (args.length >= 3) {
    portHTTP=Integer.parseInt(args[2]);
  }
  if (args.length >= 4) {
    lucene=args[3];
  }
  Repository.get().init(loc,"String_Node_Str",lucene);
  RESTHandler root=new WelcomePageHandler(servers);
  servers.add(new CoAPServer(portCoAP,root));
  servers.add(new HTTPServer(portHTTP,root));
  for (  RESTServerInstance i : servers) {
    i.add("String_Node_Str",new TDLookUpHandler(servers));
    i.add("String_Node_Str",new TDLookUpEPHandler(servers));
    i.add("String_Node_Str",new TDLookUpSEMHandler(servers));
    i.add("String_Node_Str",new ThingDescriptionCollectionHandler(servers));
    for (    String td : listThingDescriptions()) {
      i.add("String_Node_Str" + td,new ThingDescriptionHandler(td,servers));
    }
    i.start();
  }
  String fileName="String_Node_Str";
  for (  RESTServerInstance i : servers) {
    i.join();
  }
  Repository.get().terminate();
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  int portCoAP=5683;
  int portHTTP=8080;
  String loc="String_Node_Str";
  String lucene="String_Node_Str";
  if (args.length >= 1) {
    loc=args[0];
  }
  if (args.length >= 2) {
    portCoAP=Integer.parseInt(args[1]);
  }
  if (args.length >= 3) {
    portHTTP=Integer.parseInt(args[2]);
  }
  if (args.length >= 4) {
    lucene=args[3];
  }
  Repository.get().init(loc,"String_Node_Str",lucene);
  RESTHandler root=new WelcomePageHandler(servers);
  servers.add(new CoAPServer(portCoAP,root));
  servers.add(new HTTPServer(portHTTP,root));
  for (  RESTServerInstance i : servers) {
    i.add("String_Node_Str",new TDLookUpHandler(servers));
    i.add("String_Node_Str",new TDLookUpEPHandler(servers));
    i.add("String_Node_Str",new TDLookUpSEMHandler(servers));
    i.add("String_Node_Str",new ThingDescriptionCollectionHandler(servers));
    for (    String td : listThingDescriptions()) {
      i.add("String_Node_Str" + td,new ThingDescriptionHandler(td,servers));
    }
    i.start();
  }
  String fileName="String_Node_Str";
  InputStream in=Repository.get().getClass().getClassLoader().getResourceAsStream(fileName);
  ThingDescriptionUtils.loadOntology(in);
  for (  RESTServerInstance i : servers) {
    i.join();
  }
  Repository.get().terminate();
}
Program: 40094
Project: 40094
Buggy source:
/** 
 * Loads an ontology to the triple store, in the default graph.
 * @param fileName File name with the ontology context.
 */
public static void loadOntology(String fileName){
  List<String> ont=new ArrayList<>();
  Dataset dataset=Repository.get().dataset;
  dataset.begin(ReadWrite.READ);
  try {
    String prefix=StrUtils.strjoinNL("String_Node_Str","String_Node_Str");
    String query=prefix + "String_Node_Str";
    try (QueryExecution qexec=QueryExecutionFactory.create(query,dataset)){
      ResultSet result=qexec.execSelect();
      while (result.hasNext()) {
        ont.add(result.next().get("String_Node_Str").toString());
      }
    }
   }
  finally {
    dataset.end();
  }
  if (ont.isEmpty()) {
    dataset=Repository.get().dataset;
    dataset.begin(ReadWrite.WRITE);
    try {
      Model m=dataset.getDefaultModel();
      RDFDataMgr.read(m,fileName);
      dataset.commit();
    }
  finally {
      dataset.end();
    }
  }
}

Fixed version (ground truth):
/** 
 * Loads an ontology to the triple store, in the default graph.
 * @param fileName File name with the ontology context.
 */
public static void loadOntology(InputStream fileName){
  List<String> ont=new ArrayList<>();
  Dataset dataset=Repository.get().dataset;
  dataset.begin(ReadWrite.READ);
  try {
    String prefix=StrUtils.strjoinNL("String_Node_Str","String_Node_Str");
    String query=prefix + "String_Node_Str";
    try (QueryExecution qexec=QueryExecutionFactory.create(query,dataset)){
      ResultSet result=qexec.execSelect();
      while (result.hasNext()) {
        ont.add(result.next().get("String_Node_Str").toString());
      }
    }
   }
  finally {
    dataset.end();
  }
  if (ont.isEmpty()) {
    dataset=Repository.get().dataset;
    dataset.begin(ReadWrite.WRITE);
    try {
      Model m=dataset.getDefaultModel();
      RDFDataMgr.read(m,fileName,Lang.TURTLE);
      dataset.commit();
    }
  finally {
      dataset.end();
    }
  }
}
Program: 40099
Project: 40099
Buggy source:
/** 
 * Process the PIV 'SELECT' command
 * @param apdu The incoming APDU object
 */
private void processPIV_SELECT(APDU apdu){
  byte[] buffer=apdu.getBuffer();
  short length=(short)(buffer[ISO7816.OFFSET_LC] & 0xFF);
  length=piv.select(buffer,ISO7816.OFFSET_CDATA,length);
  apdu.setOutgoingAndSend(ISO7816.OFFSET_CDATA,length);
}

Fixed version (ground truth):
/** 
 * Process the PIV 'SELECT' command
 * @param apdu The incoming APDU object
 */
private void processPIV_SELECT(APDU apdu){
  byte[] buffer=apdu.getBuffer();
  short length=(short)(buffer[ISO7816.OFFSET_LC] & 0xFF);
  if (!selectingApplet()) {
    ISOException.throwIt(ISO7816.SW_FILE_NOT_FOUND);
  }
  length=piv.select(buffer,ISO7816.OFFSET_CDATA,length);
  apdu.setOutgoingAndSend(ISO7816.OFFSET_CDATA,length);
}
Program: 40100
Project: 40100
Buggy source:
/** 
 * 组装ProductDetailVo对象
 * @param product
 * @return
 */
private ProductDetailVo assembleProductDetailVo(Product product){
  ProductDetailVo productDetailVo=new ProductDetailVo();
  productDetailVo.setId(product.getId());
  productDetailVo.setSubtitle(product.getSubtitle());
  productDetailVo.setPrice(product.getPrice());
  productDetailVo.setMainImage(product.getMainImage());
  productDetailVo.setSubImages(product.getSubImages());
  productDetailVo.setCategoryId(product.getCategoryId());
  productDetailVo.setDetail(product.getDetail());
  productDetailVo.setName(product.getName());
  productDetailVo.setRate(product.getRate());
  productDetailVo.setStatus(product.getStatus());
  productDetailVo.setStock(product.getStock());
  productDetailVo.setImageHost(PropertiesUtil.getProperty(Const.FTPSERVERHTTPPREFIX,"String_Node_Str"));
  productDetailVo.setParentCategoryId(new Integer(0));
  productDetailVo.setCreateTime(DateTimeUtil.dateToStr(product.getCreateTime()));
  productDetailVo.setUpdateTime(DateTimeUtil.dateToStr(product.getUpdateTime()));
  return productDetailVo;
}

Fixed version (ground truth):
/** 
 * 组装ProductDetailVo对象
 * @param product
 * @return
 */
private ProductDetailVo assembleProductDetailVo(Product product){
  ProductDetailVo productDetailVo=new ProductDetailVo();
  productDetailVo.setId(product.getId());
  productDetailVo.setSubtitle(product.getSubtitle());
  productDetailVo.setPrice(product.getPrice());
  productDetailVo.setMainImage(product.getMainImage());
  productDetailVo.setSubImages(Lists.newArrayList(product.getSubImages().split("String_Node_Str")));
  productDetailVo.setCategoryId(product.getCategoryId());
  productDetailVo.setDetail(product.getDetail());
  productDetailVo.setName(product.getName());
  productDetailVo.setRate(product.getRate());
  productDetailVo.setStatus(product.getStatus());
  productDetailVo.setStock(product.getStock());
  productDetailVo.setImageHost(PropertiesUtil.getProperty(Const.FTPSERVERHTTPPREFIX,"String_Node_Str"));
  productDetailVo.setParentCategoryId(new Integer(0));
  productDetailVo.setCreateTime(DateTimeUtil.dateToStr(product.getCreateTime()));
  productDetailVo.setUpdateTime(DateTimeUtil.dateToStr(product.getUpdateTime()));
  return productDetailVo;
}
Program: 40101
Project: 40101
Buggy source:
public String getSubImages(){
  return subImages;
}

Fixed version (ground truth):
public List<String> getSubImages(){
  return subImages;
}
Program: 40102
Project: 40102
Buggy source:
public void setSubImages(String subImages){
  this.subImages=subImages;
}

Fixed version (ground truth):
public void setSubImages(List<String> subImages){
  this.subImages=subImages;
}
Program: 40103
Project: 40103
Buggy source:
public static UniqueId generateId(SharedStreetsReference ssr){
  String hashString=new String();
  hashString="String_Node_Str" + ssr.formOfWay.value;
  for (  SharedStreetsLocationReference lr : ssr.locationReferences) {
    hashString+=String.format("String_Node_Str",lr.point.getX(),lr.point.getY());
    if (lr.outboundBearing != null) {
      hashString+=String.format("String_Node_Str",Math.round(lr.outboundBearing));
      hashString+=String.format("String_Node_Str",Math.round(lr.distanceToNextRef * 100));
    }
    if (lr.inboundBearing != null) {
      hashString+=String.format("String_Node_Str",Math.round(lr.inboundBearing));
    }
  }
  UniqueId id=UniqueId.generateHash(hashString);
  return id;
}

Fixed version (ground truth):
public static UniqueId generateId(SharedStreetsReference ssr){
  String hashString=new String();
  hashString="String_Node_Str" + ssr.formOfWay.value;
  for (  SharedStreetsLocationReference lr : ssr.locationReferences) {
    hashString+=String.format("String_Node_Str",lr.point.getX(),lr.point.getY());
    if (lr.outboundBearing != null) {
      hashString+=String.format("String_Node_Str",Math.round(lr.outboundBearing));
      hashString+=String.format("String_Node_Str",Math.round(lr.distanceToNextRef * 100));
    }
    if (lr.inboundBearing != null) {
      hashString+=String.format("String_Node_Str",Math.round(lr.inboundBearing));
    }
  }
  return UniqueId.generateHash(hashString);
}
Program: 40104
Project: 40104
Buggy source:
public byte[] toBinary() throws IOException {
  SharedStreetsProto.SharedStreetsGeometry.Builder geometryBuilder=SharedStreetsProto.SharedStreetsGeometry.newBuilder();
  geometryBuilder.setId(this.id.toString());
  geometryBuilder.setFromIntersectionId(this.startIntersectionId.toString());
  geometryBuilder.setToIntersectionId(this.endIntersectionId.toString());
  geometryBuilder.setForwardReferenceId(this.forwardReferenceId.toString());
  if (this.backReferenceId != null)   geometryBuilder.setBackReferenceId(this.backReferenceId.toString());
  geometryBuilder.setRoadClass(SharedStreetsProto.RoadClass.forNumber(this.metadata.getRoadClass().getValue()));
  for (int i=0; i < ((Polyline)geometry).getPointCount(); i++) {
    geometryBuilder.addLatlons((float)((Polyline)geometry).getPoint(i).getY());
    geometryBuilder.addLatlons((float)((Polyline)geometry).getPoint(i).getX());
  }
  ByteArrayOutputStream bytes=new ByteArrayOutputStream();
  geometryBuilder.build().writeDelimitedTo(bytes);
  return bytes.toByteArray();
}

Fixed version (ground truth):
public byte[] toBinary() throws IOException {
  SharedStreetsProto.SharedStreetsGeometry.Builder geometryBuilder=SharedStreetsProto.SharedStreetsGeometry.newBuilder();
  geometryBuilder.setId(this.id.toString());
  geometryBuilder.setFromIntersectionId(this.startIntersectionId.toString());
  geometryBuilder.setToIntersectionId(this.endIntersectionId.toString());
  geometryBuilder.setForwardReferenceId(this.forwardReferenceId.toString());
  if (this.backReferenceId != null)   geometryBuilder.setBackReferenceId(this.backReferenceId.toString());
  geometryBuilder.setRoadClass(SharedStreetsProto.RoadClass.forNumber(this.metadata.getRoadClass().getValue()));
  for (int i=0; i < ((Polyline)geometry).getPointCount(); i++) {
    geometryBuilder.addLonlats(((Polyline)geometry).getPoint(i).getX());
    geometryBuilder.addLonlats(((Polyline)geometry).getPoint(i).getY());
  }
  ByteArrayOutputStream bytes=new ByteArrayOutputStream();
  geometryBuilder.build().writeDelimitedTo(bytes);
  return bytes.toByteArray();
}
Program: 40105
Project: 40105
Buggy source:
@Override @JsonIgnore public String getId(){
  return this.id.toString();
}

Fixed version (ground truth):
@Override @JsonIgnore public String getId(){
  if (id == null)   this.id=generateId(this);
  return this.id.toString();
}
Program: 40106
Project: 40106
Buggy source:
@Override @JsonIgnore public String getId(){
  return this.id.toString();
}

Fixed version (ground truth):
@Override @JsonIgnore public String getId(){
  if (id == null)   this.id=generateId(this);
  return this.id.toString();
}
Program: 40107
Project: 40107
Buggy source:
public byte[] toBinary() throws IOException {
  SharedStreetsProto.SharedStreetsIntersection.Builder intersection=SharedStreetsProto.SharedStreetsIntersection.newBuilder();
  intersection.setId(this.id.toString());
  intersection.setNodeId(this.osmNodeId);
  intersection.setLon((float)this.point.getX());
  intersection.setLat((float)this.point.getY());
  for (  UniqueId inboundId : this.inboundSegmentIds) {
    intersection.addInboundReferenceIds(inboundId.toString());
  }
  for (  UniqueId outboundId : this.outboundSegmentIds) {
    intersection.addOutboundReferenceIds(outboundId.toString());
  }
  ByteArrayOutputStream bytes=new ByteArrayOutputStream();
  intersection.build().writeDelimitedTo(bytes);
  return bytes.toByteArray();
}

Fixed version (ground truth):
public byte[] toBinary() throws IOException {
  SharedStreetsProto.SharedStreetsIntersection.Builder intersection=SharedStreetsProto.SharedStreetsIntersection.newBuilder();
  intersection.setId(this.getId());
  intersection.setNodeId(this.osmNodeId);
  intersection.setLon(this.point.getX());
  intersection.setLat(this.point.getY());
  for (  UniqueId inboundId : this.inboundSegmentIds) {
    intersection.addInboundReferenceIds(inboundId.toString());
  }
  for (  UniqueId outboundId : this.outboundSegmentIds) {
    intersection.addOutboundReferenceIds(outboundId.toString());
  }
  ByteArrayOutputStream bytes=new ByteArrayOutputStream();
  intersection.build().writeDelimitedTo(bytes);
  return bytes.toByteArray();
}
Program: 40108
Project: 40108
Buggy source:
public static UniqueId generateId(SharedStreetsReference ssr){
  String hashString=new String();
  hashString="String_Node_Str" + ssr.formOfWay.value;
  for (  SharedStreetsLocationReference lr : ssr.locationReferences) {
    hashString+=String.format("String_Node_Str",lr.point.getX(),lr.point.getY());
    if (lr.outboundBearing != null) {
      hashString+=String.format("String_Node_Str",Math.round(lr.outboundBearing));
      hashString+=String.format("String_Node_Str",Math.round(lr.distanceToNextRef * 100));
    }
    if (lr.inboundBearing != null) {
      hashString+=String.format("String_Node_Str",lr.inboundBearing);
    }
  }
  return UniqueId.generateHash(hashString);
}

Fixed version (ground truth):
public static UniqueId generateId(SharedStreetsReference ssr){
  String hashString=new String();
  hashString="String_Node_Str" + ssr.formOfWay.value;
  for (  SharedStreetsLocationReference lr : ssr.locationReferences) {
    hashString+=String.format("String_Node_Str",lr.point.getX(),lr.point.getY());
    if (lr.outboundBearing != null) {
      hashString+=String.format("String_Node_Str",Math.round(lr.outboundBearing));
      hashString+=String.format("String_Node_Str",Math.round(lr.distanceToNextRef * 100));
    }
    if (lr.inboundBearing != null) {
      hashString+=String.format("String_Node_Str",Math.round(lr.inboundBearing));
    }
  }
  UniqueId id=UniqueId.generateHash(hashString);
  return id;
}
Program: 40109
Project: 40109
Buggy source:
public byte[] toBinary() throws IOException {
  SharedStreetsProto.SharedStreetsReference.Builder reference=SharedStreetsProto.SharedStreetsReference.newBuilder();
  reference.setId(this.id.toString());
  reference.setFormOfWay(SharedStreetsProto.SharedStreetsReference.FormOfWay.forNumber(this.formOfWay.getValue()));
  reference.setGeometryId(this.geometry.id.toString());
  for (  SharedStreetsLocationReference locationReference : this.locationReferences) {
    SharedStreetsProto.LocationReference.Builder lr=SharedStreetsProto.LocationReference.newBuilder();
    lr.setIntersectionId(locationReference.intersection.id.toString());
    if (locationReference.distanceToNextRef != null)     lr.setDistanceToNextRef((int)Math.round(locationReference.distanceToNextRef * 100));
    if (locationReference.inboundBearing != null)     lr.setInboundBearing((int)Math.round(locationReference.inboundBearing));
    if (locationReference.outboundBearing != null)     lr.setOutboundBearing((int)Math.round(locationReference.outboundBearing));
    lr.setLat((float)locationReference.point.getY());
    lr.setLon((float)locationReference.point.getX());
    reference.addLocationReferences(lr);
  }
  ByteArrayOutputStream bytes=new ByteArrayOutputStream();
  reference.build().writeDelimitedTo(bytes);
  return bytes.toByteArray();
}

Fixed version (ground truth):
public byte[] toBinary() throws IOException {
  SharedStreetsProto.SharedStreetsReference.Builder reference=SharedStreetsProto.SharedStreetsReference.newBuilder();
  reference.setId(this.id.toString());
  reference.setFormOfWay(SharedStreetsProto.SharedStreetsReference.FormOfWay.forNumber(this.formOfWay.getValue()));
  reference.setGeometryId(this.geometry.id.toString());
  for (  SharedStreetsLocationReference locationReference : this.locationReferences) {
    SharedStreetsProto.LocationReference.Builder lr=SharedStreetsProto.LocationReference.newBuilder();
    lr.setIntersectionId(locationReference.intersection.id.toString());
    if (locationReference.distanceToNextRef != null)     lr.setDistanceToNextRef((int)Math.round(locationReference.distanceToNextRef * 100));
    if (locationReference.inboundBearing != null)     lr.setInboundBearing((int)Math.round(locationReference.inboundBearing));
    if (locationReference.outboundBearing != null)     lr.setOutboundBearing((int)Math.round(locationReference.outboundBearing));
    lr.setLon(locationReference.point.getX());
    lr.setLat(locationReference.point.getY());
    reference.addLocationReferences(lr);
  }
  ByteArrayOutputStream bytes=new ByteArrayOutputStream();
  reference.build().writeDelimitedTo(bytes);
  return bytes.toByteArray();
}
Program: 40110
Project: 40110
Buggy source:
@Override @JsonIgnore public String getId(){
  return this.id.toString();
}

Fixed version (ground truth):
@Override @JsonIgnore public String getId(){
  if (id == null)   this.id=generateId(this);
  return this.id.toString();
}
Program: 40111
Project: 40111
Buggy source:
public static void main(String[] args){
  GameMap gameMap=new GameMap(MapDriver.readMap("String_Node_Str"));
  ConsolePrinter.printMap(gameMap);
  Score score=new Score();
  score.init(gameMap,Color.BLACK);
  Analyzer analyzer=new Analyzer(gameMap,Color.WHITE,gameMap.getNeighbor(),score,false);
  System.out.println("String_Node_Str");
  System.out.println(analyzer.getFiveAttack());
  System.out.println("String_Node_Str");
  System.out.println(analyzer.getFourAttack());
  System.out.println("String_Node_Str");
  System.out.println(analyzer.getFourDefence());
  System.out.println("String_Node_Str");
  System.out.println(analyzer.getThreeOpenAttack());
  System.out.println("String_Node_Str");
  System.out.println(analyzer.getThreeDefence());
  System.out.println("String_Node_Str");
  System.out.println(analyzer.getTwoAttack());
  System.out.println("String_Node_Str");
  System.out.println(analyzer.getNotKey());
  System.out.println("String_Node_Str");
  System.out.println(analyzer.getFourCloseDefence());
  System.out.println("String_Node_Str");
  System.out.println(analyzer.getDoubleFourCloseDefence());
  System.out.println("String_Node_Str");
  System.out.println(analyzer.getThreeOpenDefence());
  System.out.println("String_Node_Str");
  System.out.println(analyzer.getDoubleThreeOpenDefense());
  System.out.println("String_Node_Str");
  System.out.println(analyzer.getFourCloseAndOpenThreeDefense());
}

Fixed version (ground truth):
public static void main(String[] args){
  GameMap gameMap=new GameMap(MapDriver.readMap());
  ConsolePrinter.printMap(gameMap);
  Score score=new Score();
  score.init(gameMap,Color.BLACK);
  Analyzer analyzer=new Analyzer(gameMap,Color.BLACK,gameMap.getNeighbor(),score,false);
  ConsolePrinter.printMapWithPoints(gameMap,analyzer.getFourCloseAndOpenThreeDefense());
  System.out.println("String_Node_Str");
  System.out.println(analyzer.getFiveAttack());
  System.out.println("String_Node_Str");
  System.out.println(analyzer.getFourAttack());
  System.out.println("String_Node_Str");
  System.out.println(analyzer.getFourDefence());
  System.out.println("String_Node_Str");
  System.out.println(analyzer.getThreeOpenAttack());
  System.out.println("String_Node_Str");
  System.out.println(analyzer.getThreeDefence());
  System.out.println("String_Node_Str");
  System.out.println(analyzer.getTwoAttack());
  System.out.println("String_Node_Str");
  System.out.println(analyzer.getNotKey());
  System.out.println("String_Node_Str");
  System.out.println(analyzer.getFourCloseDefence());
  System.out.println("String_Node_Str");
  System.out.println(analyzer.getDoubleFourCloseDefence());
  System.out.println("String_Node_Str");
  System.out.println(analyzer.getThreeOpenDefence());
  System.out.println("String_Node_Str");
  System.out.println(analyzer.getDoubleThreeOpenDefense());
  System.out.println("String_Node_Str");
  System.out.println(analyzer.getFourCloseAndOpenThreeDefense());
}
Program: 40113
Project: 40113
Buggy source:
ComboResult canKill(Color targetColor,int level,long startTime,long limitTime){
  if (level % 2 == 1) {
    level--;
  }
  this.startTime=startTime;
  this.limitTime=limitTime;
  currentLevel=level;
  result=new ComboResult();
  result.point=null;
  cache.clear();
  dfsKill(gameMap,targetColor,targetColor,level,score,ComboTye.FOUR,null,null,null);
  if (result.point != null)   return result;
  result.point=null;
  cache.clear();
  dfsKill(gameMap,targetColor.getOtherColor(),targetColor.getOtherColor(),level,score,ComboTye.FOUR,null,null,null);
  if (result.point != null) {
    result.point=null;
    return result;
  }
  result.point=null;
  cache.clear();
  dfsKill(gameMap,targetColor,targetColor,level,score,ComboTye.THREE,null,null,null);
  return result;
}

Fixed version (ground truth):
ComboResult canKill(Color targetColor,int level,long startTime,long limitTime){
  if (level % 2 == 1) {
    level--;
  }
  this.startTime=startTime;
  this.limitTime=limitTime;
  currentLevel=level;
  result=new ComboResult();
  result.point=null;
  cache.clear();
  dfsKill(gameMap,targetColor,targetColor,level,score,ComboTye.FOUR,null,null,null);
  if (result.point != null) {
    result.fourWin=true;
    return result;
  }
  result.point=null;
  cache.clear();
  dfsKill(gameMap,targetColor.getOtherColor(),targetColor.getOtherColor(),level,score,ComboTye.FOUR,null,null,null);
  if (result.point != null) {
    result.point=null;
    result.fourWin=true;
    return result;
  }
  result.point=null;
  cache.clear();
  dfsKill(gameMap,targetColor,targetColor,level,score,ComboTye.THREE,null,null,null);
  result.fourWin=false;
  return result;
}