nus-yam/ex-repair huggingface dataset:
Program: 2105
Project: 2105
Buggy source:
@Override public void endElement(String uri,String localName,String qName) throws SAXException {
  if (qName.compareTo(SUB_LOG_TAG) == 0) {
    try {
      outputStream.close();
      outputStream=null;
      ChangeLogParser parser=scmLogParsers.get(scmClass);
      if (parser != null) {
        ChangeLogSet<? extends ChangeLogSet.Entry> cls=parser.parse(build,tempFile);
        changeLogs.add(scmClass,scmDisplayNames.get(scmClass),cls);
      }
    }
 catch (    IOException e) {
      throw new SAXException("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
@Override public void endElement(String uri,String localName,String qName) throws SAXException {
  if (qName.compareTo(SUB_LOG_TAG) == 0) {
    try {
      OutputStreamWriter outputStream=new OutputStreamWriter(new FileOutputStream(tempFile));
      String data=StringEscapeUtils.unescapeXml(buffer.toString());
      outputStream.write(data);
      outputStream.close();
      buffer=null;
      ChangeLogParser parser=scmLogParsers.get(scmClass);
      if (parser != null) {
        ChangeLogSet<? extends ChangeLogSet.Entry> cls=parser.parse(build,tempFile);
        changeLogs.add(scmClass,scmDisplayNames.get(scmClass),cls);
      }
    }
 catch (    FileNotFoundException e) {
      throw new SAXException("String_Node_Str",e);
    }
catch (    IOException e) {
      throw new SAXException("String_Node_Str",e);
    }
  }
}
Program: 2106
Project: 2106
Buggy source:
@Override public void startElement(String uri,String localName,String qName,Attributes attrs) throws SAXException {
  if (qName.compareTo(SUB_LOG_TAG) == 0) {
    FileOutputStream fos;
    try {
      scmClass=attrs.getValue("String_Node_Str");
      newStream=true;
      fos=new FileOutputStream(tempFile);
    }
 catch (    FileNotFoundException e) {
      throw new SAXException("String_Node_Str",e);
    }
    outputStream=new OutputStreamWriter(fos);
  }
}

Fixed version (ground truth):
@Override public void startElement(String uri,String localName,String qName,Attributes attrs) throws SAXException {
  if (qName.compareTo(SUB_LOG_TAG) == 0) {
    scmClass=attrs.getValue("String_Node_Str");
    buffer=new StringBuffer();
  }
}
Program: 2107
Project: 2107
Buggy source:
public JNDIAndSaltAwareJdbcRealm(){
  setPermissionsLookupEnabled(true);
}

Fixed version (ground truth):
public JNDIAndSaltAwareJdbcRealm(){
}
Program: 2108
Project: 2108
Buggy source:
@Override public void run(){
  NoteListTopComponent.this.refresh();
}

Fixed version (ground truth):
@Override public void run(){
  allNotes.getReadWriteLock().writeLock().lock();
  try {
    allNotes.clear();
    allNotes.addAll(getAllNotesInDb());
  }
  finally {
    allNotes.getReadWriteLock().writeLock().unlock();
  }
  NoteListTopComponent.this.refresh();
}
Program: 2109
Project: 2109
Buggy source:
@Override public void propertyChange(PropertyChangeEvent evt){
  LOG.fine("String_Node_Str");
  if (null != currentRefreshTask) {
    currentRefreshTask.cancel();
  }
  Runnable runnable=new Runnable(){
    @Override public void run(){
      NoteListTopComponent.this.refresh();
    }
  }
;
  currentRefreshTask=RP.post(runnable);
}

Fixed version (ground truth):
@Override public void propertyChange(PropertyChangeEvent evt){
  LOG.fine("String_Node_Str");
  if (null != currentRefreshTask) {
    currentRefreshTask.cancel();
  }
  Runnable runnable=new Runnable(){
    @Override public void run(){
      allNotes.getReadWriteLock().writeLock().lock();
      try {
        allNotes.clear();
        allNotes.addAll(getAllNotesInDb());
      }
  finally {
        allNotes.getReadWriteLock().writeLock().unlock();
      }
      NoteListTopComponent.this.refresh();
    }
  }
;
  currentRefreshTask=RP.post(runnable);
}
Program: 2110
Project: 2110
Buggy source:
public Reader getContentAsReader(){
  ResultSet rs=null;
  try {
synchronized (Installer.selectContentById) {
      Installer.selectContentById.setInt(1,id);
      rs=Installer.selectContentById.executeQuery();
    }
    if (rs.next()) {
      final Reader characterStream=rs.getCharacterStream("String_Node_Str");
      return characterStream;
    }
  }
 catch (  SQLException sQLException) {
    Exceptions.printStackTrace(sQLException);
  }
 finally {
    if (rs != null) {
      try {
        rs.close();
      }
 catch (      SQLException e) {
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public Reader getContentAsReader(){
  ResultSet rs=null;
  try {
synchronized (Installer.selectContentById) {
      Installer.selectContentById.setInt(1,id);
      rs=Installer.selectContentById.executeQuery();
      if (rs.next()) {
        final Reader characterStream=rs.getCharacterStream("String_Node_Str");
        return characterStream;
      }
    }
  }
 catch (  SQLException sQLException) {
    Exceptions.printStackTrace(sQLException);
  }
 finally {
    if (rs != null) {
      try {
        rs.close();
      }
 catch (      SQLException e) {
      }
    }
  }
  return null;
}
Program: 2112
Project: 2112
Buggy source:
private IndexWriter getIndexWriter() throws IOException {
  File file=new File(System.getProperty("String_Node_Str") + "String_Node_Str");
  final CustomAnalyzer analyzer=new CustomAnalyzer();
  IndexWriter writer=new IndexWriter(FSDirectory.open(file),analyzer,true,IndexWriter.MaxFieldLength.LIMITED);
  writer.setUseCompoundFile(true);
  return writer;
}

Fixed version (ground truth):
private IndexWriter getIndexWriter() throws IOException {
  File file=new File(System.getProperty("String_Node_Str") + "String_Node_Str");
  final CustomAnalyzer analyzer=new CustomAnalyzer();
  IndexWriter writer=new IndexWriter(FSDirectory.open(file),analyzer,IndexWriter.MaxFieldLength.LIMITED);
  writer.setUseCompoundFile(true);
  return writer;
}
Program: 2114
Project: 2114
Buggy source:
private AuthenticationResult getValidAuthenticationResult() throws TTransportException, EDAMUserException, EDAMSystemException, TException {
  if (null == currentAuthResult) {
    LOG.info("String_Node_Str");
    final String c=a;
    final String d=b;
    final String password=NbPreferences.forModule(SynchronizationServiceImpl.class).get("String_Node_Str","String_Node_Str");
    final String username=NbPreferences.forModule(SynchronizationServiceImpl.class).get("String_Node_Str","String_Node_Str");
    currentAuthResult=getUserStore().authenticate(username,password,c,d);
    setExpirationTime(currentAuthResult);
  }
  if (isExpired()) {
    LOG.info("String_Node_Str");
    currentAuthResult=getUserStore().refreshAuthentication(currentAuthToken);
  }
  currentAuthToken=currentAuthResult.getAuthenticationToken();
  LOG.info("String_Node_Str" + currentAuthResult.getAuthenticationToken());
  return currentAuthResult;
}

Fixed version (ground truth):
private AuthenticationResult getValidAuthenticationResult() throws TTransportException, EDAMUserException, EDAMSystemException, TException {
  if (null == currentAuthResult) {
    LOG.info("String_Node_Str");
    final String c=a;
    final String d=b;
    final String password=NbPreferences.forModule(SynchronizationServiceImpl.class).get("String_Node_Str","String_Node_Str");
    final String username=NbPreferences.forModule(SynchronizationServiceImpl.class).get("String_Node_Str","String_Node_Str");
    currentAuthResult=getUserStore().authenticate(username,password,c,d);
    setExpirationTime(currentAuthResult);
  }
  if (isExpired()) {
    LOG.info("String_Node_Str");
    currentAuthResult=getUserStore().refreshAuthentication(currentAuthToken);
    setExpirationTime(currentAuthResult);
  }
  currentAuthToken=currentAuthResult.getAuthenticationToken();
  LOG.info("String_Node_Str" + currentAuthResult.getAuthenticationToken());
  return currentAuthResult;
}
Program: 2115
Project: 2115
Buggy source:
private boolean isExpired(){
  final long msToExpiration=expirationTime - System.currentTimeMillis();
  LOG.info("String_Node_Str" + msToExpiration / 1000.0 + "String_Node_Str" + (msToExpiration / (1000.0 * 60)) + "String_Node_Str");
  boolean isExpired=msToExpiration < (10 * 60 * 1000L);
  return isExpired;
}

Fixed version (ground truth):
private boolean isExpired(){
  final long msToExpiration=expirationTime - System.currentTimeMillis();
  LOG.info("String_Node_Str" + msToExpiration / 1000.0 + "String_Node_Str" + (msToExpiration / (1000.0 * 60)) + "String_Node_Str");
  boolean isExpired=msToExpiration < (5 * 60 * 1000L);
  return isExpired;
}
Program: 2117
Project: 2117
Buggy source:
public boolean cancel(){
  return link.get(0).cancel();
}

Fixed version (ground truth):
public boolean cancel(){
  if (link.isEmpty()) {
    return false;
  }
  final boolean cancel=link.get(0).cancel();
  return cancel;
}
Program: 2118
Project: 2118
Buggy source:
public void actionPerformed(ActionEvent e){
  LOG.info("String_Node_Str");
  final NoteFinder noteFinder=Lookup.getDefault().lookup(NoteFinder.class);
  final List<Cancellable> link=new ArrayList<Cancellable>();
  final ProgressHandle myProgressHandle=ProgressHandleFactory.createHandle("String_Node_Str",new Cancellable(){
    public boolean cancel(){
      return link.get(0).cancel();
    }
  }
);
  RequestProcessor.Task theTask=RP.create(new Runnable(){
    public void run(){
      myProgressHandle.start();
      noteFinder.rebuildIndex();
      myProgressHandle.finish();
    }
  }
);
  link.add(theTask);
  RP.post(theTask);
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  LOG.info("String_Node_Str");
  final NoteFinder noteFinder=Lookup.getDefault().lookup(NoteFinder.class);
  final List<Cancellable> link=new ArrayList<Cancellable>();
  final ProgressHandle myProgressHandle=ProgressHandleFactory.createHandle("String_Node_Str",new Cancellable(){
    public boolean cancel(){
      if (link.isEmpty()) {
        return false;
      }
      final boolean cancel=link.get(0).cancel();
      return cancel;
    }
  }
);
  RequestProcessor.Task theTask=RP.post(new Runnable(){
    public void run(){
      myProgressHandle.start();
      noteFinder.rebuildIndex();
      myProgressHandle.finish();
    }
  }
);
  link.add(theTask);
}
Program: 2119
Project: 2119
Buggy source:
@SqlQuery @Mapper(DefaultMapper.class) StartTimes getLastStartTimes();

Fixed version (ground truth):
@SqlQuery StartTimes getLastStartTimes();
Program: 2122
Project: 2122
Buggy source:
private static void writeTime(final int lastTime,final int newTime,final DataOutputStream dataStream) throws IOException {
  if (newTime > lastTime) {
    final int delta=(newTime - lastTime);
    if (delta <= TimelineOpcode.MAX_DELTA_TIME) {
      dataStream.writeByte(delta);
    }
 else {
      dataStream.writeByte(TimelineOpcode.FULL_TIME.getOpcodeIndex());
      dataStream.writeInt(newTime);
    }
  }
}

Fixed version (ground truth):
private static void writeTime(final int lastTime,final int newTime,final DataOutputStream dataStream) throws IOException {
  if (newTime > lastTime) {
    final int delta=(newTime - lastTime);
    if (delta <= TimelineOpcode.MAX_DELTA_TIME) {
      dataStream.writeByte(delta);
    }
 else {
      dataStream.writeByte(TimelineOpcode.FULL_TIME.getOpcodeIndex());
      dataStream.writeInt(newTime);
    }
  }
 else   if (newTime == lastTime) {
    dataStream.writeByte(0);
  }
}
Program: 2125
Project: 2125
Buggy source:
protected void configureBackgroundDBChunkWriter(){
  final LifecycledProvider<BackgroundDBChunkWriter> lifecycledProvider=new LifecycledProvider<BackgroundDBChunkWriter>(binder(),BackgroundDBChunkWriter.class);
  lifecycledProvider.addListener(LifecycleEvent.START,new LifecycleAction<BackgroundDBChunkWriter>(){
    public void doAction(    final BackgroundDBChunkWriter backgroundWriter){
      log.info("String_Node_Str");
      backgroundWriter.runBackgroundWriteThread();
    }
  }
);
  lifecycledProvider.addListener(LifecycleEvent.STOP,new LifecycleAction<BackgroundDBChunkWriter>(){
    public void doAction(    final BackgroundDBChunkWriter backgroundWriter){
      log.info("String_Node_Str");
      backgroundWriter.stopBackgroundWriteThread();
    }
  }
);
  bind(BackgroundDBChunkWriter.class).toProvider(lifecycledProvider).asEagerSingleton();
  final ExportBuilder builder=MBeanModule.newExporter(binder());
  builder.export(BackgroundDBChunkWriter.class).withGeneratedName();
}

Fixed version (ground truth):
protected void configureBackgroundDBChunkWriter(){
  final LifecycledProvider<BackgroundDBChunkWriter> lifecycledProvider=new LifecycledProvider<BackgroundDBChunkWriter>(binder(),BackgroundDBChunkWriter.class);
  lifecycledProvider.addListener(LifecycleEvent.START,new LifecycleAction<BackgroundDBChunkWriter>(){
    public void doAction(    final BackgroundDBChunkWriter backgroundWriter){
      log.info("String_Node_Str");
      backgroundWriter.runBackgroundWriteThread();
    }
  }
);
  bind(BackgroundDBChunkWriter.class).toProvider(lifecycledProvider).asEagerSingleton();
  final ExportBuilder builder=MBeanModule.newExporter(binder());
  builder.export(BackgroundDBChunkWriter.class).withGeneratedName();
}
Program: 2126
Project: 2126
Buggy source:
public void stopBackgroundWriteThread(){
  if (!performForegroundWrites) {
    finishBackgroundWritingAndExit.set(true);
    backgroundWriteThread.shutdown();
  }
}

Fixed version (ground truth):
public void stopBackgroundWriteThread(){
  if (!performForegroundWrites) {
    backgroundWriteThread.shutdown();
  }
}
Program: 2127
Project: 2127
Buggy source:
public synchronized void addPendingChunkMap(final PendingChunkMap chunkMap){
  if (finishBackgroundWritingAndExit.get()) {
    log.error("String_Node_Str");
  }
 else {
    if (performForegroundWrites) {
      foregroundChunkMapsWritten.inc();
      final List<TimelineChunk> chunksToWrite=new ArrayList<TimelineChunk>(chunkMap.getChunkMap().values());
      foregroundChunksWritten.inc(chunksToWrite.size());
      timelineDAO.bulkInsertTimelineChunks(chunksToWrite);
      chunkMap.getAccumulator().markPendingChunkMapConsumed(chunkMap.getPendingChunkMapId());
    }
 else {
      pendingChunkMapsAdded.inc();
      final int chunkCount=chunkMap.getChunkCount();
      pendingChunksAdded.inc(chunkCount);
      pendingChunks.add(chunkMap);
      pendingChunkCount.addAndGet(chunkCount);
    }
  }
}

Fixed version (ground truth):
public synchronized void addPendingChunkMap(final PendingChunkMap chunkMap){
  if (shuttingDown.get()) {
    log.error("String_Node_Str");
  }
 else {
    if (performForegroundWrites) {
      foregroundChunkMapsWritten.inc();
      final List<TimelineChunk> chunksToWrite=new ArrayList<TimelineChunk>(chunkMap.getChunkMap().values());
      foregroundChunksWritten.inc(chunksToWrite.size());
      timelineDAO.bulkInsertTimelineChunks(chunksToWrite);
      chunkMap.getAccumulator().markPendingChunkMapConsumed(chunkMap.getPendingChunkMapId());
    }
 else {
      pendingChunkMapsAdded.inc();
      final int chunkCount=chunkMap.getChunkCount();
      pendingChunksAdded.inc(chunkCount);
      pendingChunks.add(chunkMap);
      pendingChunkCount.addAndGet(chunkCount);
    }
  }
}
Program: 2128
Project: 2128
Buggy source:
private CounterMetric makeCounter(final String counterName){
  final CounterMetric counter=Metrics.newCounter(TimelineAggregator.class,counterName);
  backgroundWriteCounters.put(counterName,counter);
  return counter;
}

Fixed version (ground truth):
private CounterMetric makeCounter(final String counterName){
  final CounterMetric counter=Metrics.newCounter(BackgroundDBChunkWriter.class,counterName);
  backgroundWriteCounters.put(counterName,counter);
  return counter;
}
Program: 2129
Project: 2129
Buggy source:
private void maybePerformBackgroundWrites(){
  maybePerformBackgroundWritesCount.inc();
  if (!doingWritesNow.compareAndSet(false,true)) {
    return;
  }
 else {
    try {
      if (finishBackgroundWritingAndExit.get()) {
        performBackgroundWrites();
      }
      final int pendingCount=pendingChunkCount.get();
      if (pendingCount > 0) {
        if (pendingCount >= config.getBackgroundWriteBatchSize() || new DateTime().isBefore(lastWriteTime.plusMillis((int)config.getBackgroundWriteMaxDelay().getMillis()))) {
          performBackgroundWrites();
          lastWriteTime=new DateTime();
        }
      }
    }
  finally {
      doingWritesNow.set(false);
    }
  }
}

Fixed version (ground truth):
private void maybePerformBackgroundWrites(){
  maybePerformBackgroundWritesCount.inc();
  if (!doingWritesNow.compareAndSet(false,true)) {
    return;
  }
 else {
    try {
      if (shuttingDown.get()) {
        performBackgroundWrites();
      }
      final int pendingCount=pendingChunkCount.get();
      if (pendingCount > 0) {
        if (pendingCount >= config.getBackgroundWriteBatchSize() || new DateTime().isBefore(lastWriteTime.plusMillis((int)config.getBackgroundWriteMaxDelay().getMillis()))) {
          performBackgroundWrites();
          lastWriteTime=new DateTime();
        }
      }
    }
  finally {
      doingWritesNow.set(false);
    }
  }
}
Program: 2132
Project: 2132
Buggy source:
@Override public void handle(final Event event){
  try {
    handledEventCount.inc();
    final String hostName=EventsUtils.getHostNameFromEvent(event);
    final Integer hostId=timelineDAO.getOrAddHost(hostName);
    final Map<String,Object> samples=EventsUtils.getSamplesFromEvent(event);
    final Map<Integer,ScalarSample> scalarSamples=new LinkedHashMap<Integer,ScalarSample>();
    convertSamplesToScalarSamples(hostId,event.getEventType(),samples,scalarSamples);
    if (scalarSamples.isEmpty()) {
      eventsDiscarded.incrementAndGet();
      log.warn("String_Node_Str" + event);
      return;
    }
    final HostSamplesForTimestamp hostSamples=new HostSamplesForTimestamp(hostId,event.getEventType(),new DateTime(event.getTimestamp(),DateTimeZone.UTC),scalarSamples);
    backingBuffer.append(hostSamples);
    processSamples(hostSamples);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@Override public void handle(final Event event){
  if (shuttingDown.get()) {
    eventsReceivedAfterShuttingDown.inc();
    return;
  }
  try {
    handledEventCount.inc();
    final String hostName=EventsUtils.getHostNameFromEvent(event);
    final Integer hostId=timelineDAO.getOrAddHost(hostName);
    final Map<String,Object> samples=EventsUtils.getSamplesFromEvent(event);
    final Map<Integer,ScalarSample> scalarSamples=new LinkedHashMap<Integer,ScalarSample>();
    convertSamplesToScalarSamples(hostId,event.getEventType(),samples,scalarSamples);
    if (scalarSamples.isEmpty()) {
      eventsDiscarded.incrementAndGet();
      log.warn("String_Node_Str" + event);
      return;
    }
    final HostSamplesForTimestamp hostSamples=new HostSamplesForTimestamp(hostId,event.getEventType(),new DateTime(event.getTimestamp(),DateTimeZone.UTC),scalarSamples);
    backingBuffer.append(hostSamples);
    processSamples(hostSamples);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 2133
Project: 2133
Buggy source:
@Inject public TimelineEventHandler(final CollectorConfig config,final TimelineDAO timelineDAO,final BackgroundDBChunkWriter backgroundWriter,final FileBackedBuffer fileBackedBuffer){
  this.config=config;
  this.timelineDAO=timelineDAO;
  this.backgroundWriter=backgroundWriter;
  this.backingBuffer=fileBackedBuffer;
  this.shutdownSaveMode=ShutdownSaveMode.fromString(config.getShutdownSaveMode());
  this.fastShutdown=new AtomicBoolean(false);
}

Fixed version (ground truth):
@Inject public TimelineEventHandler(final CollectorConfig config,final TimelineDAO timelineDAO,final BackgroundDBChunkWriter backgroundWriter,final FileBackedBuffer fileBackedBuffer){
  this.config=config;
  this.timelineDAO=timelineDAO;
  this.backgroundWriter=backgroundWriter;
  this.backingBuffer=fileBackedBuffer;
  this.shutdownSaveMode=ShutdownSaveMode.fromString(config.getShutdownSaveMode());
}
Program: 2134
Project: 2134
Buggy source:
private void saveAccumulatorsOrStartTimes(){
  for (  Map.Entry<Integer,Map<Integer,TimelineHostEventAccumulator>> entry : accumulators.entrySet()) {
    final int hostId=entry.getKey();
    final Map<Integer,TimelineHostEventAccumulator> hostAccumulators=entry.getValue();
    for (    Map.Entry<Integer,TimelineHostEventAccumulator> accumulatorEntry : hostAccumulators.entrySet()) {
      final int categoryId=accumulatorEntry.getKey();
      final TimelineHostEventAccumulator accumulator=accumulatorEntry.getValue();
      if (fastShutdown.get()) {
        log.debug("String_Node_Str",hostId,categoryId);
        startTimesReference.get().addTime(hostId,categoryId,accumulator.getStartTime());
      }
 else {
        log.debug("String_Node_Str",hostId,categoryId);
        accumulator.extractAndQueueTimelineChunks();
      }
    }
  }
}

Fixed version (ground truth):
private void saveAccumulatorsOrStartTimes(){
  for (  Map.Entry<Integer,Map<Integer,TimelineHostEventAccumulator>> entry : accumulators.entrySet()) {
    final int hostId=entry.getKey();
    final Map<Integer,TimelineHostEventAccumulator> hostAccumulators=entry.getValue();
    for (    Map.Entry<Integer,TimelineHostEventAccumulator> accumulatorEntry : hostAccumulators.entrySet()) {
      final int categoryId=accumulatorEntry.getKey();
      final TimelineHostEventAccumulator accumulator=accumulatorEntry.getValue();
      if (fastShutdown.get()) {
        log.debug("String_Node_Str",hostId,categoryId);
        startTimes.addTime(hostId,categoryId,accumulator.getStartTime());
      }
 else {
        log.debug("String_Node_Str",hostId,categoryId);
        accumulator.extractAndQueueTimelineChunks();
      }
    }
  }
}
Program: 2135
Project: 2135
Buggy source:
@Managed public void forceCommit(final boolean shutdown){
  forceCommitCallCount.inc();
  final boolean doingFastShutdown=shutdown && shutdownSaveMode == ShutdownSaveMode.SAVE_START_TIMES;
  fastShutdown.set(doingFastShutdown);
  StartTimes startTimes=null;
  if (doingFastShutdown) {
    startTimes=shutdownSaveMode == ShutdownSaveMode.SAVE_START_TIMES ? new StartTimes() : null;
    startTimesReference.set(startTimes);
    saveAccumulatorsOrStartTimes();
    timelineDAO.insertLastStartTimes(startTimes);
  }
 else {
    startTimesReference.set(null);
    saveAccumulatorsOrStartTimes();
  }
  backingBuffer.discard();
  log.info(doingFastShutdown ? "String_Node_Str" : "String_Node_Str");
}

Fixed version (ground truth):
@Managed public void forceCommit(final boolean shutdown){
  if (shutdown) {
    shuttingDown.set(true);
  }
  forceCommitCallCount.inc();
  final boolean doingFastShutdown=shutdown && shutdownSaveMode == ShutdownSaveMode.SAVE_START_TIMES;
  fastShutdown.set(doingFastShutdown);
  if (doingFastShutdown) {
    startTimes=shutdownSaveMode == ShutdownSaveMode.SAVE_START_TIMES ? new StartTimes() : null;
    saveAccumulatorsOrStartTimes();
    timelineDAO.insertLastStartTimes(startTimes);
  }
 else {
    startTimes=null;
    saveAccumulatorsOrStartTimes();
  }
  if (shutdown) {
    backgroundWriter.initiateShutdown();
    while (!backgroundWriter.getShutdownFinished()) {
      try {
        Thread.currentThread().sleep(100);
      }
 catch (      InterruptedException e) {
        Thread.currentThread().interrupt();
      }
    }
  }
  backingBuffer.discard();
  log.info(doingFastShutdown ? "String_Node_Str" : "String_Node_Str");
}
Program: 2137
Project: 2137
Buggy source:
public static void scan(final byte[] samples,final byte[] times,final int sampleCount,final SampleProcessor processor) throws IOException {
  final ByteArrayInputStream byteStream=new ByteArrayInputStream(samples);
  final DataInputStream inputStream=new DataInputStream(byteStream);
  final TimeCursor timeCursor=new TimeCursor(times,sampleCount);
  while (true) {
    final int opcodeByte;
    opcodeByte=inputStream.read();
    if (opcodeByte == -1) {
      return;
    }
    final SampleOpcode opcode=SampleOpcode.getOpcodeFromIndex(opcodeByte);
switch (opcode) {
case REPEAT_BYTE:
case REPEAT_SHORT:
      final int repeatCount=opcode == SampleOpcode.REPEAT_BYTE ? inputStream.readUnsignedByte() : inputStream.readUnsignedShort();
    final SampleOpcode repeatedOpcode=SampleOpcode.getOpcodeFromIndex(inputStream.read());
  final Object value=decodeScalarValue(inputStream,repeatedOpcode);
final SampleOpcode replacementOpcode=repeatedOpcode.getReplacement();
processor.processSamples(timeCursor,repeatCount,replacementOpcode,value);
timeCursor.consumeRepeat(repeatCount);
break;
default :
processor.processSamples(timeCursor,1,opcode.getReplacement(),decodeScalarValue(inputStream,opcode));
break;
}
}
}

Fixed version (ground truth):
public static void scan(final byte[] samples,final byte[] times,final int sampleCount,final SampleProcessor processor) throws IOException {
  final ByteArrayInputStream byteStream=new ByteArrayInputStream(samples);
  final DataInputStream inputStream=new DataInputStream(byteStream);
  final TimeCursor timeCursor=new TimeCursor(times,sampleCount);
  int sampleNumber=0;
  while (true) {
    final int opcodeByte;
    opcodeByte=inputStream.read();
    if (opcodeByte == -1) {
      return;
    }
    final SampleOpcode opcode=SampleOpcode.getOpcodeFromIndex(opcodeByte);
switch (opcode) {
case REPEAT_BYTE:
case REPEAT_SHORT:
      final int repeatCount=opcode == SampleOpcode.REPEAT_BYTE ? inputStream.readUnsignedByte() : inputStream.readUnsignedShort();
    final SampleOpcode repeatedOpcode=SampleOpcode.getOpcodeFromIndex(inputStream.read());
  final Object value=decodeScalarValue(inputStream,repeatedOpcode);
final SampleOpcode replacementOpcode=repeatedOpcode.getReplacement();
processor.processSamples(timeCursor,repeatCount,replacementOpcode,value);
sampleNumber+=repeatCount;
timeCursor.skipToSampleNumber(sampleNumber);
break;
default :
processor.processSamples(timeCursor,1,opcode.getReplacement(),decodeScalarValue(inputStream,opcode));
break;
}
}
}
Program: 2138
Project: 2138
Buggy source:
private int getNextTimeInternal(){
  try {
    if (repeatCount > 0) {
      repeatCount--;
      lastValue+=delta;
    }
 else {
      final int nextOpcode=timelineDataStream.read();
      byteCursor++;
      if (nextOpcode == -1) {
        return nextOpcode;
      }
      if (nextOpcode == TimelineOpcode.FULL_TIME.getOpcodeIndex()) {
        lastValue=timelineDataStream.readInt();
        byteCursor+=4;
      }
 else       if (nextOpcode == TimelineOpcode.REPEATED_DELTA_TIME_BYTE.getOpcodeIndex()) {
        repeatCount=timelineDataStream.readUnsignedByte() - 1;
        delta=timelineDataStream.read();
        byteCursor+=2;
        lastValue+=delta;
      }
 else       if (nextOpcode == TimelineOpcode.REPEATED_DELTA_TIME_SHORT.getOpcodeIndex()) {
        repeatCount=timelineDataStream.readUnsignedShort() - 1;
        delta=timelineDataStream.read();
        byteCursor+=3;
        lastValue+=delta;
      }
 else       if (nextOpcode <= TimelineOpcode.MAX_DELTA_TIME) {
        byteCursor++;
        lastValue+=nextOpcode;
      }
 else {
        throw new IllegalStateException(String.format("String_Node_Str",nextOpcode,byteCursor));
      }
    }
    return lastValue;
  }
 catch (  IOException e) {
    log.error(e,"String_Node_Str");
    return -1;
  }
}

Fixed version (ground truth):
private int getNextTimeInternal(){
  try {
    if (repeatCount > 0) {
      repeatCount--;
      lastValue+=delta;
    }
 else {
      final int nextOpcode=timelineDataStream.read();
      byteCursor++;
      if (nextOpcode == -1) {
        return nextOpcode;
      }
      if (nextOpcode == TimelineOpcode.FULL_TIME.getOpcodeIndex()) {
        lastValue=timelineDataStream.readInt();
        byteCursor+=4;
      }
 else       if (nextOpcode == TimelineOpcode.REPEATED_DELTA_TIME_BYTE.getOpcodeIndex()) {
        repeatCount=timelineDataStream.readUnsignedByte() - 1;
        delta=timelineDataStream.read();
        byteCursor+=2;
        lastValue+=delta;
      }
 else       if (nextOpcode == TimelineOpcode.REPEATED_DELTA_TIME_SHORT.getOpcodeIndex()) {
        repeatCount=timelineDataStream.readUnsignedShort() - 1;
        delta=timelineDataStream.read();
        byteCursor+=3;
        lastValue+=delta;
      }
 else       if (nextOpcode <= TimelineOpcode.MAX_DELTA_TIME) {
        lastValue+=nextOpcode;
      }
 else {
        throw new IllegalStateException(String.format("String_Node_Str",nextOpcode,byteCursor));
      }
    }
    sampleNumber++;
    if (sampleNumber > sampleCount) {
      log.error("String_Node_Str",sampleNumber,sampleCount);
    }
    return lastValue;
  }
 catch (  IOException e) {
    log.error(e,"String_Node_Str");
    return -1;
  }
}
Program: 2139
Project: 2139
Buggy source:
public TimeCursor(final byte[] times,final int sampleCount){
  this.timelineDataStream=new DataInputStream(new ByteArrayInputStream(times));
  this.sampleCount=sampleCount;
  this.byteCursor=0;
  this.lastValue=0;
  this.delta=0;
  this.repeatCount=0;
}

Fixed version (ground truth):
public TimeCursor(final byte[] times,final int sampleCount){
  this.timelineDataStream=new DataInputStream(new ByteArrayInputStream(times));
  this.sampleCount=sampleCount;
  this.sampleNumber=0;
  this.byteCursor=0;
  this.lastValue=0;
  this.delta=0;
  this.repeatCount=0;
}
Program: 2140
Project: 2140
Buggy source:
@Override public void processSamples(TimeCursor timeCursor,int sampleCount,SampleOpcode opcode,Object value){
  if (builder.length() > 0) {
    builder.append("String_Node_Str");
  }
  final int nextTime=timeCursor.getNextTime();
  if (sampleCount > 1) {
    timeCursor.consumeRepeat(sampleCount);
  }
  final DateTime timestamp=DateTimeUtils.dateTimeFromUnixSeconds(nextTime);
  builder.append("String_Node_Str").append(timestamp.toString("String_Node_Str")).append("String_Node_Str");
  if (sampleCount > 1) {
    builder.append(sampleCount).append("String_Node_Str");
  }
  builder.append(opcode.name().toLowerCase());
switch (opcode) {
case NULL:
case DOUBLE_ZERO:
case INT_ZERO:
    break;
default :
  builder.append("String_Node_Str").append(String.valueOf(value)).append("String_Node_Str");
break;
}
}

Fixed version (ground truth):
@Override public void processSamples(TimeCursor timeCursor,int sampleCount,SampleOpcode opcode,Object value){
  if (builder.length() > 0) {
    builder.append("String_Node_Str");
  }
  final int nextTime=timeCursor.getNextTime();
  final DateTime timestamp=DateTimeUtils.dateTimeFromUnixSeconds(nextTime);
  builder.append("String_Node_Str").append(timestamp.toString("String_Node_Str")).append("String_Node_Str");
  if (sampleCount > 1) {
    builder.append(sampleCount).append("String_Node_Str");
  }
  builder.append(opcode.name().toLowerCase());
switch (opcode) {
case NULL:
case DOUBLE_ZERO:
case INT_ZERO:
    break;
default :
  builder.append("String_Node_Str").append(String.valueOf(value)).append("String_Node_Str");
break;
}
}
Program: 2142
Project: 2142
Buggy source:
private void writeJsonForAllChunks(final JsonGenerator generator,final ObjectWriter writer,final Map<Integer,Map<Integer,DecimatingSampleFilter>> filters,final List<Integer> hostIds,final List<Integer> sampleKindIds,final DateTime startTime,final DateTime endTime,final boolean decodeSamples) throws IOException, ExecutionException {
  writeJsonForInMemoryChunks(generator,writer,filters,hostIds,sampleKindIds,startTime,endTime,decodeSamples);
  writeJsonForStoredChunks(generator,writer,filters,hostIds,sampleKindIds,startTime,endTime,decodeSamples);
}

Fixed version (ground truth):
private void writeJsonForAllChunks(final JsonGenerator generator,final ObjectWriter writer,final Map<Integer,Map<Integer,DecimatingSampleFilter>> filters,final List<Integer> hostIds,final List<Integer> sampleKindIds,final DateTime startTime,final DateTime endTime,final boolean decodeSamples) throws IOException, ExecutionException {
  writeJsonForStoredChunks(generator,writer,filters,hostIds,sampleKindIds,startTime,endTime,decodeSamples);
  writeJsonForInMemoryChunks(generator,writer,filters,hostIds,sampleKindIds,startTime,endTime,decodeSamples);
}
Program: 2146
Project: 2146
Buggy source:
/** 
 * Process sampleCount sequential samples with identical values.  sampleCount will usually be 1, but may be larger than 1.  Implementors may just loop processing identical values, but some implementations may optimize adding a bunch of repeated values
 * @param timeCursor   a TimeCursor instance, which supplies successive int UNIX times
 * @param sampleCount  the count of sequential, identical values
 * @param opcode       the opcode of the sample value, which may not be a REPEAT opcode
 * @param value        the value of this kind of sample over the count of samples starting at the timegiven by the sampleNumber indexing the TimelineTimestamps.
 */
@Override public void processSamples(final TimeCursor timeCursor,final int sampleCount,final SampleOpcode opcode,final Object value){
  for (int i=0; i < sampleCount; i++) {
    final DateTime sampleTimestamp=TimelineTimes.dateTimeFromUnixSeconds(timeCursor.getNextTime());
    final long sampleMillis=sampleTimestamp.getMillis();
    if ((startTime == null || (sampleMillis >= startTime.getMillis())) && (endTime == null || (sampleMillis <= endTime.getMillis()))) {
      processOneSample(sampleTimestamp,opcode,value);
    }
  }
}

Fixed version (ground truth):
/** 
 * Process sampleCount sequential samples with identical values.  sampleCount will usually be 1, but may be larger than 1.  Implementors may just loop processing identical values, but some implementations may optimize adding a bunch of repeated values
 * @param timeCursor   a TimeCursor instance, which supplies successive int UNIX times
 * @param sampleCount  the count of sequential, identical values
 * @param opcode       the opcode of the sample value, which may not be a REPEAT opcode
 * @param value        the value of this kind of sample over the count of samples starting at the timegiven by the sampleNumber indexing the TimelineTimestamps.
 */
@Override public void processSamples(final TimeCursor timeCursor,final int sampleCount,final SampleOpcode opcode,final Object value){
  final int unixStartTime=startTime == null ? Integer.MIN_VALUE : TimelineTimes.unixSeconds(startTime);
  final int unixEndTime=endTime == null ? Integer.MAX_VALUE : TimelineTimes.unixSeconds(endTime);
  for (int i=0; i < sampleCount; i++) {
    final int unixSampleTime=timeCursor.getNextTime();
    if (unixSampleTime >= unixStartTime && unixSampleTime <= unixEndTime) {
      processOneSample(TimelineTimes.dateTimeFromUnixSeconds(unixSampleTime),opcode,value);
    }
  }
}
Program: 2147
Project: 2147
Buggy source:
private TimelineChunkAccumulator(final int hostId,final int sampleKindId,final ByteArrayOutputStream stream,final SampleBase lastSample,final int sampleCount) throws IOException {
  this.hostId=hostId;
  this.sampleKindId=sampleKindId;
  this.byteStream=stream;
  byteStream.write(byteStream.toByteArray());
  outputStream=new DataOutputStream(byteStream);
  this.lastSample=lastSample;
  this.sampleCount=sampleCount;
}

Fixed version (ground truth):
private TimelineChunkAccumulator(final int hostId,final int sampleKindId,final byte[] bytes,final SampleBase lastSample,final int sampleCount) throws IOException {
  this.hostId=hostId;
  this.sampleKindId=sampleKindId;
  reset();
  this.byteStream.write(bytes);
  this.lastSample=lastSample;
  this.sampleCount=sampleCount;
}
Program: 2148
Project: 2148
Buggy source:
public TimelineChunkAccumulator deepCopy() throws IOException {
  return new TimelineChunkAccumulator(hostId,sampleKindId,byteStream,lastSample,sampleCount);
}

Fixed version (ground truth):
public TimelineChunkAccumulator deepCopy() throws IOException {
  return new TimelineChunkAccumulator(hostId,sampleKindId,byteStream.toByteArray(),lastSample,sampleCount);
}
Program: 2149
Project: 2149
Buggy source:
private static void writeRepeatedDelta(final int delta,final int repeatCount,final DataOutputStream dataStream) throws IOException {
  if (repeatCount > 1) {
    dataStream.writeByte(TimelineOpcode.REPEATED_DELTA_TIME.getOpcodeIndex());
    dataStream.writeByte(repeatCount);
  }
  dataStream.writeByte(delta);
}

Fixed version (ground truth):
private static void writeRepeatedDelta(final int delta,final int repeatCount,final DataOutputStream dataStream) throws IOException {
  dataStream.writeByte(TimelineOpcode.REPEATED_DELTA_TIME.getOpcodeIndex());
  dataStream.writeByte(repeatCount);
  dataStream.writeByte(delta);
}
Program: 2151
Project: 2151
Buggy source:
@Test(groups="String_Node_Str") public void testBasicEncodeDecode() throws Exception {
  final byte[] compressedTimes=TimelineCoder.compressTimes(unencodedTimes);
  System.out.printf("String_Node_Str",new String(Hex.encodeHex(compressedTimes)));
  final int[] decompressedTimes=TimelineCoder.decompressTimes(compressedTimes);
  Assert.assertEquals(decompressedTimes.length,unencodedTimes.length);
  for (int i=0; i < unencodedTimes.length; i++) {
    Assert.assertEquals(decompressedTimes[i],unencodedTimes[i]);
  }
}

Fixed version (ground truth):
@Test(groups="String_Node_Str") public void testBasicEncodeDecode() throws Exception {
  final int firstTime=1000000;
  final int[] unencodedTimes=new int[]{firstTime,firstTime + 30,firstTime + 60,firstTime + 90,firstTime + 1000,firstTime + 2000,firstTime + 2030,firstTime + 2060};
  final byte[] compressedTimes=TimelineCoder.compressTimes(unencodedTimes);
  final int[] decompressedTimes=TimelineCoder.decompressTimes(compressedTimes);
  Assert.assertEquals(decompressedTimes.length,unencodedTimes.length);
  for (int i=0; i < unencodedTimes.length; i++) {
    Assert.assertEquals(decompressedTimes[i],unencodedTimes[i]);
  }
}
Program: 2152
Project: 2152
Buggy source:
private void aggregateSampleChunks(final List<Long> timelineTimesId,final int newTimelineTimesId,final int totalSampleCount){
  final List<List<TimelineChunk>> orderedHostSampleChunks=getHostSampleTimelineChunks(timelineTimesId);
  for (  final List<TimelineChunk> chunkList : orderedHostSampleChunks) {
    final TimelineChunk firstSampleChunk=chunkList.get(0);
    int totalChunkSize=0;
    for (    final TimelineChunk chunk : chunkList) {
      totalChunkSize+=chunk.getSamples().length;
    }
    final byte[] samples=new byte[totalChunkSize];
    int sampleChunkIndex=0;
    for (    final TimelineChunk chunk : chunkList) {
      final int chunkSampleLength=chunk.getSamples().length;
      System.arraycopy(chunk.getSamples(),0,samples,sampleChunkIndex,chunkSampleLength);
      sampleChunkIndex+=chunkSampleLength;
    }
    final TimelineChunk aggregatedChunk=new TimelineChunk(0,firstSampleChunk.getHostId(),firstSampleChunk.getSampleKindId(),newTimelineTimesId,firstSampleChunk.getStartTime(),samples,totalSampleCount);
    timelineDao.insertTimelineChunk(aggregatedChunk);
  }
}

Fixed version (ground truth):
private void aggregateSampleChunks(final List<Long> timelineTimesIds,final int newTimelineTimesId,final int totalSampleCount){
  final List<List<TimelineChunk>> orderedHostSampleChunks=getHostSampleTimelineChunks(timelineTimesIds);
  for (  final List<TimelineChunk> chunkList : orderedHostSampleChunks) {
    final TimelineChunk firstSampleChunk=chunkList.get(0);
    int totalChunkSize=0;
    for (    final TimelineChunk chunk : chunkList) {
      totalChunkSize+=chunk.getSamples().length;
    }
    final byte[] samples=new byte[totalChunkSize];
    int sampleChunkIndex=0;
    for (    final TimelineChunk chunk : chunkList) {
      final int chunkSampleLength=chunk.getSamples().length;
      System.arraycopy(chunk.getSamples(),0,samples,sampleChunkIndex,chunkSampleLength);
      sampleChunkIndex+=chunkSampleLength;
    }
    final TimelineChunk aggregatedChunk=new TimelineChunk(0,firstSampleChunk.getHostId(),firstSampleChunk.getSampleKindId(),newTimelineTimesId,firstSampleChunk.getStartTime(),samples,totalSampleCount);
    timelineDao.insertTimelineChunk(aggregatedChunk);
  }
}
Program: 2153
Project: 2153
Buggy source:
private int aggregateTimelineCandidates(final List<TimelineTimes> timelineTimesCandidates,final int aggregationLevel){
  log.info("String_Node_Str",timelineTimesCandidates.size(),config.getChunksToAggregate());
  int aggregatesCreated=0;
  final int chunksToAggregate=config.getChunksToAggregate();
  while (timelineTimesCandidates.size() >= chunksToAggregate) {
    final List<TimelineTimes> chunkCandidates=timelineTimesCandidates.subList(0,chunksToAggregate);
    aggregateHostSampleChunks(chunkCandidates,aggregationLevel);
    aggregatesCreated++;
    chunkCandidates.clear();
  }
  return aggregatesCreated;
}

Fixed version (ground truth):
private int aggregateTimelineCandidates(final List<TimelineTimes> timelineTimesCandidates,final int aggregationLevel){
  final TimelineTimes firstCandidate=timelineTimesCandidates.get(0);
  log.info("String_Node_Str",new Object[]{firstCandidate.getHostId(),firstCandidate.getEventCategory(),timelineTimesCandidates.size(),config.getChunksToAggregate()});
  int aggregatesCreated=0;
  final int chunksToAggregate=config.getChunksToAggregate();
  while (timelineTimesCandidates.size() >= chunksToAggregate) {
    final List<TimelineTimes> chunkCandidates=timelineTimesCandidates.subList(0,chunksToAggregate);
    aggregateHostSampleChunks(chunkCandidates,aggregationLevel);
    aggregatesCreated++;
    chunkCandidates.clear();
  }
  return aggregatesCreated;
}
Program: 2154
Project: 2154
Buggy source:
/** 
 * This method aggregates candidate timelines
 */
@Managed(description="String_Node_Str") public void getAndProcessTimelineAggregationCandidates(){
  if (!isAggregating.compareAndSet(false,true)) {
    log.info("String_Node_Str");
    return;
  }
 else {
    log.info("String_Node_Str");
  }
  for (int aggregationLevel=0; aggregationLevel < config.getMaxAggregationLevel() - 1; aggregationLevel++) {
    final List<TimelineTimes> timelineTimesCandidates=aggregatorDao.getTimelineTimesAggregationCandidates(aggregationLevel);
    int lastHostId=0;
    String lastEventCategory="String_Node_Str";
    final List<TimelineTimes> hostTimelineCandidates=new ArrayList<TimelineTimes>();
    for (    final TimelineTimes candidate : timelineTimesCandidates) {
      final int hostId=candidate.getHostId();
      final String eventCategory=candidate.getEventCategory();
      if (lastHostId == 0) {
        lastHostId=hostId;
        lastEventCategory=eventCategory;
      }
      if (lastHostId != hostId || !lastEventCategory.equals(eventCategory)) {
        aggregatesCreated.inc(aggregateTimelineCandidates(hostTimelineCandidates,aggregationLevel));
        hostTimelineCandidates.clear();
        lastHostId=hostId;
      }
      hostTimelineCandidates.add(candidate);
    }
    aggregatesCreated.inc(aggregateTimelineCandidates(hostTimelineCandidates,aggregationLevel));
  }
  log.info("String_Node_Str");
  isAggregating.set(false);
}

Fixed version (ground truth):
/** 
 * This method aggregates candidate timelines
 */
@Managed(description="String_Node_Str") public void getAndProcessTimelineAggregationCandidates(){
  if (!isAggregating.compareAndSet(false,true)) {
    log.info("String_Node_Str");
    return;
  }
 else {
    log.info("String_Node_Str");
  }
  for (int aggregationLevel=0; aggregationLevel < config.getMaxAggregationLevel() - 1; aggregationLevel++) {
    final List<TimelineTimes> timelineTimesCandidates=aggregatorDao.getTimelineTimesAggregationCandidates(aggregationLevel);
    int lastHostId=0;
    String lastEventCategory="String_Node_Str";
    final List<TimelineTimes> hostTimelineCandidates=new ArrayList<TimelineTimes>();
    for (    final TimelineTimes candidate : timelineTimesCandidates) {
      final int hostId=candidate.getHostId();
      final String eventCategory=candidate.getEventCategory();
      if (lastHostId == 0) {
        lastHostId=hostId;
        lastEventCategory=eventCategory;
      }
      if (lastHostId != hostId || !lastEventCategory.equals(eventCategory)) {
        aggregatesCreated.inc(aggregateTimelineCandidates(hostTimelineCandidates,aggregationLevel));
        hostTimelineCandidates.clear();
        lastHostId=hostId;
        lastEventCategory=eventCategory;
      }
      hostTimelineCandidates.add(candidate);
    }
    aggregatesCreated.inc(aggregateTimelineCandidates(hostTimelineCandidates,aggregationLevel));
  }
  log.info("String_Node_Str");
  isAggregating.set(false);
}
Program: 2156
Project: 2156
Buggy source:
private void recycle() throws IOException {
synchronized (recyclingMonitor) {
    out.close();
    out=new StreamyBytesPersistentOutputStream(basePath,prefix,inputBuffer);
    smileGenerator=smileFactory.createJsonGenerator(out,JsonEncoding.UTF8);
    smileGenerator.flush();
    out.reset();
    samplesforTimestampWritten.set(0);
  }
}

Fixed version (ground truth):
private void recycle() throws IOException {
synchronized (recyclingMonitor) {
    if (out != null && !out.isEmpty()) {
      out.close();
    }
    out=new StreamyBytesPersistentOutputStream(basePath,prefix,inputBuffer);
    smileGenerator=smileFactory.createJsonGenerator(out,JsonEncoding.UTF8);
    smileGenerator.flush();
    out.reset();
    samplesforTimestampWritten.set(0);
  }
}
Program: 2157
Project: 2157
Buggy source:
@Override public void close() throws IOException {
  inputBuffer.close();
  for (  final String path : createdFiles) {
    log.info("String_Node_Str",path);
    if (!new File(path).delete()) {
      log.warn("String_Node_Str",path);
    }
  }
}

Fixed version (ground truth):
@Override public void close() throws IOException {
  inputBuffer.clear();
  for (  final String path : createdFiles) {
    log.info("String_Node_Str",path);
    if (!new File(path).delete()) {
      log.warn("String_Node_Str",path);
    }
  }
}
Program: 2158
Project: 2158
Buggy source:
public RepeatedSample(byte repeatCount,ScalarSample<T> sample){
  super(SampleOpcode.REPEAT);
  this.repeatCount=0;
  this.sample=sample;
}

Fixed version (ground truth):
public RepeatedSample(byte repeatCount,ScalarSample<T> sample){
  super(SampleOpcode.REPEAT);
  this.repeatCount=repeatCount;
  this.sample=sample;
}
Program: 2159
Project: 2159
Buggy source:
/** 
 * This invokes the processor on the values in the timeline bytes.
 * @param bytes the byte representation of a timeline
 * @param processor the callback to which values value counts are passed to be processed.
 * @throws IOException
 */
public static void scan(final byte[] bytes,final TimelineTimes timestamps,final SampleProcessor processor) throws IOException {
  final ByteArrayInputStream byteStream=new ByteArrayInputStream(bytes);
  final DataInputStream inputStream=new DataInputStream(byteStream);
  int sampleCount=0;
  while (true) {
    byte opcodeByte;
    try {
      opcodeByte=inputStream.readByte();
    }
 catch (    EOFException e) {
      return;
    }
    final SampleOpcode opcode=SampleOpcode.getOpcodeFromIndex(opcodeByte);
switch (opcode) {
case REPEAT:
      final byte repeatCount=inputStream.readByte();
    final SampleOpcode repeatedOpcode=SampleOpcode.getOpcodeFromIndex(inputStream.readByte());
  final Object value=decodeScalarValue(inputStream,repeatedOpcode);
processor.processSamples(timestamps,sampleCount,repeatCount,opcode,value);
sampleCount+=repeatCount;
break;
default :
processor.processSamples(timestamps,sampleCount,1,opcode,decodeScalarValue(inputStream,opcode));
sampleCount+=1;
break;
}
}
}

Fixed version (ground truth):
/** 
 * This invokes the processor on the values in the timeline bytes.
 * @param bytes the byte representation of a timeline
 * @param processor the callback to which values value counts are passed to be processed.
 * @throws IOException
 */
public static void scan(final byte[] bytes,final TimelineTimes timestamps,final SampleProcessor processor) throws IOException {
  final ByteArrayInputStream byteStream=new ByteArrayInputStream(bytes);
  final DataInputStream inputStream=new DataInputStream(byteStream);
  int sampleCount=0;
  while (true) {
    byte opcodeByte;
    try {
      opcodeByte=inputStream.readByte();
    }
 catch (    EOFException e) {
      return;
    }
    final SampleOpcode opcode=SampleOpcode.getOpcodeFromIndex(opcodeByte);
switch (opcode) {
case REPEAT:
      final byte repeatCount=inputStream.readByte();
    final SampleOpcode repeatedOpcode=SampleOpcode.getOpcodeFromIndex(inputStream.readByte());
  final Object value=decodeScalarValue(inputStream,repeatedOpcode);
processor.processSamples(timestamps,sampleCount,repeatCount,repeatedOpcode,value);
sampleCount+=repeatCount;
break;
default :
processor.processSamples(timestamps,sampleCount,1,opcode,decodeScalarValue(inputStream,opcode));
sampleCount+=1;
break;
}
}
}
Program: 2160
Project: 2160
Buggy source:
public int createSmsNotificationForPersonOrGroup(final int id,final String address);

Fixed version (ground truth):
public Integer createSmsNotificationForPersonOrGroup(final int id,final String address);