nus-yam/ex-repair huggingface dataset:
Program: 58223
Project: 58223
Buggy source:
private void reshareStatus(Status status){
  String from=status.from;
  if (from.length() > 6)   from=GilgaService.mapToNickname(from);
  String msgRT="String_Node_Str" + from + ' '+ status.body;
  Intent intent=new Intent(this,GilgaService.class);
  intent.putExtra("String_Node_Str",msgRT);
  startService(intent);
  Status statusMe=new Status();
  statusMe.from=getString(R.string.me_);
  statusMe.ts=new java.util.Date().getTime();
  statusMe.trusted=status.trusted;
  statusMe.body=msgRT;
  StatusAdapter.getInstance(GilgaMeshActivity.this).add(statusMe);
  setStatus(getString(R.string.broadcast_mode_public_) + "String_Node_Str" + mLocalAddress);
}

Fixed version (ground truth):
private void reshareStatus(Status status){
  String from=status.from;
  if (from.length() > 6)   from=GilgaService.mapToNickname(from);
  String msgRT="String_Node_Str" + from + ' '+ status.body;
  Intent intent=new Intent(this,GilgaService.class);
  intent.putExtra("String_Node_Str",msgRT);
  startService(intent);
  setStatus(getString(R.string.broadcast_mode_public_) + "String_Node_Str" + mLocalAddress);
}
Program: 58224
Project: 58224
Buggy source:
@Override public void onServicesDiscovered(BluetoothGatt gatt,int status){
  if (status == BluetoothGatt.GATT_SUCCESS)   logEvent("String_Node_Str");
 else   logEvent("String_Node_Str" + status);
  boolean foundService=false;
  try {
    List<BluetoothGattService> serviceList=gatt.getServices();
    for (    BluetoothGattService service : serviceList) {
      if (service.getUuid().equals(GATT.SERVICE_UUID)) {
        logEvent("String_Node_Str");
        foundService=true;
        List<BluetoothGattCharacteristic> characteristics=service.getCharacteristics();
        for (        BluetoothGattCharacteristic characteristic : characteristics) {
          if (mCharacteristicUUIDToRequest.containsKey(characteristic.getUuid())) {
            mCharacteristicUUIDToRequest.get(characteristic.getUuid()).mCharacteristic=characteristic;
          }
        }
      }
    }
  }
 catch (  Exception e) {
    logEvent("String_Node_Str" + e.getLocalizedMessage());
    e.printStackTrace();
  }
  if (!foundService)   logEvent("String_Node_Str");
 else   beginRequestFlowWithPeripheral(gatt);
  super.onServicesDiscovered(gatt,status);
}

Fixed version (ground truth):
@Override public void onServicesDiscovered(BluetoothGatt gatt,int status){
  if (status == BluetoothGatt.GATT_SUCCESS)   logEvent("String_Node_Str");
 else   logEvent("String_Node_Str" + status);
  boolean foundService=false;
  try {
    List<BluetoothGattService> serviceList=gatt.getServices();
    for (    BluetoothGattService service : serviceList) {
      if (service.getUuid().equals(GATT.SERVICE_UUID)) {
        logEvent("String_Node_Str");
        foundService=true;
        List<BluetoothGattCharacteristic> characteristics=service.getCharacteristics();
        for (        BluetoothGattCharacteristic characteristic : characteristics) {
          Pair<UUID,BLECentralRequest.RequestType> readKey=new Pair<>(characteristic.getUuid(),BLECentralRequest.RequestType.READ);
          Pair<UUID,BLECentralRequest.RequestType> writeKey=new Pair<>(characteristic.getUuid(),BLECentralRequest.RequestType.WRITE);
          if (mCharacteristicUUIDToRequest.containsKey(readKey)) {
            mCharacteristicUUIDToRequest.get(readKey).mCharacteristic=characteristic;
          }
 else           if (mCharacteristicUUIDToRequest.containsKey(writeKey)) {
            mCharacteristicUUIDToRequest.get(writeKey).mCharacteristic=characteristic;
          }
        }
      }
    }
  }
 catch (  Exception e) {
    logEvent("String_Node_Str" + e.getLocalizedMessage());
    e.printStackTrace();
  }
  if (!foundService)   logEvent("String_Node_Str");
 else   beginRequestFlowWithPeripheral(gatt);
  super.onServicesDiscovered(gatt,status);
}
Program: 58227
Project: 58227
Buggy source:
/** 
 * Add a   {@link pro.dbro.ble.transport.ble.BLECentralRequest} to be performedon each peripheral discovered
 */
public void addDefaultBLECentralRequest(BLECentralRequest request){
  mDefaultRequests.add(request);
  mCharacteristicUUIDToRequest.put(request.mCharacteristic.getUuid(),request);
}

Fixed version (ground truth):
/** 
 * Add a   {@link pro.dbro.ble.transport.ble.BLECentralRequest} to be performedon each peripheral discovered
 */
public void addDefaultBLECentralRequest(BLECentralRequest request){
  mDefaultRequests.add(request);
  mCharacteristicUUIDToRequest.put(new Pair<>(request.mCharacteristic.getUuid(),request.mRequestType),request);
}
Program: 58228
Project: 58228
Buggy source:
private void stopBleServices(){
  if (mState == BLEConnectionState.DISABLED) {
    throw new IllegalStateException("String_Node_Str");
  }
  mCentral.stop();
  mPeripheral.stop();
  changeState(BLEConnectionState.DISABLED);
}

Fixed version (ground truth):
private void stopBleServices(){
  if (mState == BLEConnectionState.DISABLED) {
    return;
  }
  mCentral.stop();
  mPeripheral.stop();
  changeState(BLEConnectionState.DISABLED);
}
Program: 58229
Project: 58229
Buggy source:
private void logEvent(String event){
  if (mLogger != null) {
    mLogger.onLogEvent(event);
  }
}

Fixed version (ground truth):
private void logEvent(String event){
  if (mLogger != null) {
    mLogger.onLogEvent(event);
  }
 else {
    Log.i(TAG,event);
  }
}
Program: 58230
Project: 58230
Buggy source:
@Override public void sentMessage(MessagePacket messagePacket,IdentityPacket recipientIdentity){
  Log.i(TAG,String.format("String_Node_Str",messagePacket.body));
  mDataStore.markMessageDeliveredToPeer(messagePacket,recipientIdentity);
}

Fixed version (ground truth):
@Override public void sentMessage(@NonNull MessagePacket messagePacket,IdentityPacket recipientIdentity){
  Log.i(TAG,String.format("String_Node_Str",messagePacket.body));
  if (recipientIdentity != null)   mDataStore.markMessageDeliveredToPeer(messagePacket,recipientIdentity);
}
Program: 58231
Project: 58231
Buggy source:
/** 
 * TransportDataProvider 
 */
@Override public ArrayDeque<MessagePacket> getMessagesForIdentity(byte[] recipientPublicKey,int maxMessages){
  Peer recipient=mDataStore.getPeerByPubKey(recipientPublicKey);
  List<MessagePacket> messages=mDataStore.getOutgoingMessagesForPeer(recipient,maxMessages);
  ArrayDeque<MessagePacket> messagePacketQueue=new ArrayDeque<>();
  if (messages == null || messages.size() == 0) {
    Log.i(TAG,"String_Node_Str" + DataUtil.bytesToHex(recipientPublicKey));
  }
 else {
    messagePacketQueue.addAll(messages);
  }
  return messagePacketQueue;
}

Fixed version (ground truth):
/** 
 * TransportDataProvider 
 */
@Override public ArrayDeque<MessagePacket> getMessagesForIdentity(@Nullable byte[] recipientPublicKey,int maxMessages){
  ArrayDeque<MessagePacket> messagePacketQueue=new ArrayDeque<>();
  if (recipientPublicKey != null) {
    Peer recipient=mDataStore.getPeerByPubKey(recipientPublicKey);
    List<MessagePacket> messages=mDataStore.getOutgoingMessagesForPeer(recipient,maxMessages);
    recipient.close();
    if (messages == null || messages.size() == 0) {
      Log.i(TAG,"String_Node_Str" + DataUtil.bytesToHex(recipientPublicKey));
    }
 else {
      messagePacketQueue.addAll(messages);
    }
  }
 else {
    MessageCollection recentMessages=getRecentMessagesFeed();
    for (int x=0; x < Math.min(maxMessages,recentMessages.getCursor().getCount()); x++) {
      Message currentMessage=recentMessages.getMessageAtPosition(x);
      if (currentMessage != null)       messagePacketQueue.add(currentMessage.getProtocolMessage(mDataStore));
    }
    recentMessages.close();
  }
  return messagePacketQueue;
}
Program: 58232
Project: 58232
Buggy source:
@Override public void markMessageDeliveredToPeer(@NonNull MessagePacket messagePacket,@NonNull IdentityPacket recipientPacket){
  Message message=getMessageBySignature(messagePacket.signature);
  Peer recipient=getPeerByPubKey(recipientPacket.publicKey);
  if (message == null || recipient == null) {
    Log.w(TAG,"String_Node_Str");
    return;
  }
  ContentValues delivery=new ContentValues();
  delivery.put(MessageDeliveryTable.messageId,message.getId());
  delivery.put(MessageDeliveryTable.peerId,recipient.getId());
  mContext.getContentResolver().insert(ChatContentProvider.MessageDeliveries.MESSAGE_DELIVERIES,delivery);
  Log.i(TAG,"String_Node_Str");
  try {
    message.close();
    recipient.close();
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
@Override public void markMessageDeliveredToPeer(@NonNull MessagePacket messagePacket,@NonNull IdentityPacket recipientPacket){
  Message message=getMessageBySignature(messagePacket.signature);
  Peer recipient=getPeerByPubKey(recipientPacket.publicKey);
  if (message == null || recipient == null) {
    Log.w(TAG,"String_Node_Str");
    return;
  }
  ContentValues delivery=new ContentValues();
  delivery.put(MessageDeliveryTable.messageId,message.getId());
  delivery.put(MessageDeliveryTable.peerId,recipient.getId());
  mContext.getContentResolver().insert(ChatContentProvider.MessageDeliveries.MESSAGE_DELIVERIES,delivery);
  Log.i(TAG,"String_Node_Str");
  message.close();
  recipient.close();
}
Program: 58233
Project: 58233
Buggy source:
@Override public void close() throws IOException {
  if (mCursor != null) {
    mCursor.close();
  }
}

Fixed version (ground truth):
@Override public void close(){
  if (mCursor != null) {
    mCursor.close();
  }
}
Program: 58236
Project: 58236
Buggy source:
@Override public void onConnectionStateChange(BluetoothGatt gatt,int status,int newState){
  if (status == BluetoothGatt.GATT_SUCCESS) {
    logEvent("String_Node_Str");
  }
 else {
  }
switch (newState) {
case BluetoothProfile.STATE_DISCONNECTED:
    logEvent("String_Node_Str" + gatt.getDevice().getAddress());
  mConnectedDevices.remove(gatt.getDevice().getAddress());
mConnectingDevices.remove(gatt.getDevice().getAddress());
if (mConnectionListener != null) mConnectionListener.disconnectedFrom(gatt.getDevice().getAddress());
gatt.close();
startScanning();
break;
case BluetoothProfile.STATE_CONNECTED:
logEvent("String_Node_Str" + gatt.getDevice().getAddress());
mConnectedDevices.add(gatt.getDevice().getAddress());
mConnectingDevices.remove(gatt.getDevice().getAddress());
if (mConnectionListener != null) mConnectionListener.connectedTo(gatt.getDevice().getAddress());
stopScanning();
boolean discovering=gatt.discoverServices();
logEvent("String_Node_Str" + discovering);
break;
}
super.onConnectionStateChange(gatt,status,newState);
}

Fixed version (ground truth):
@Override public void onConnectionStateChange(BluetoothGatt gatt,int status,int newState){
  if (status == BluetoothGatt.GATT_SUCCESS) {
    logEvent("String_Node_Str");
  }
 else {
  }
switch (newState) {
case BluetoothProfile.STATE_DISCONNECTED:
    logEvent("String_Node_Str" + gatt.getDevice().getAddress());
  mConnectedDevices.remove(gatt.getDevice().getAddress());
mConnectingDevices.remove(gatt.getDevice().getAddress());
if (mConnectionListener != null) mConnectionListener.disconnectedFrom(gatt.getDevice().getAddress());
gatt.close();
break;
case BluetoothProfile.STATE_CONNECTED:
logEvent("String_Node_Str" + gatt.getDevice().getAddress());
mConnectedDevices.add(gatt.getDevice().getAddress());
mConnectingDevices.remove(gatt.getDevice().getAddress());
if (mConnectionListener != null) mConnectionListener.connectedTo(gatt.getDevice().getAddress());
boolean discovering=gatt.discoverServices();
logEvent("String_Node_Str" + discovering);
break;
}
super.onConnectionStateChange(gatt,status,newState);
}
Program: 58237
Project: 58237
Buggy source:
@Override public void makeAvailable(){
  mPeripheral.start();
}

Fixed version (ground truth):
@Override public void makeAvailable(){
  mCentral.start();
}
Program: 58238
Project: 58238
Buggy source:
@Override public void makeUnavailable(){
  mPeripheral.stop();
}

Fixed version (ground truth):
@Override public void makeUnavailable(){
  mCentral.stop();
}
Program: 58242
Project: 58242
Buggy source:
public int getCurrentCaretPosition(){
  int position=-1;
  if (openedInEditor) {
    Caret caret=cookie.getOpenedPanes()[0].getCaret();
    position=caret.getDot();
  }
  return position;
}

Fixed version (ground truth):
public int getCurrentCaretPosition(){
  int position=-1;
  if (openedInEditor) {
    position=getCaret().getDot();
  }
  return position;
}
Program: 58243
Project: 58243
Buggy source:
public Caret getCaret(){
  return cookie.getOpenedPanes()[0].getCaret();
}

Fixed version (ground truth):
public Caret getCaret(){
  Runnable runner=() -> {
    NbDocument.runAtomic(cookie.getDocument(),() -> {
      currentCaret=cookie.getOpenedPanes()[0].getCaret();
    }
);
  }
;
  if (SwingUtilities.isEventDispatchThread()) {
    runner.run();
  }
 else {
    try {
      SwingUtilities.invokeAndWait(runner);
    }
 catch (    InterruptedException|InvocationTargetException ex) {
      LOG.log(Level.SEVERE,"String_Node_Str",ex);
    }
  }
  return currentCaret;
}
Program: 58244
Project: 58244
Buggy source:
@Override public void fileChanged(FileEvent event){
  super.fileChanged(event);
  LOG.log(Level.INFO,"String_Node_Str",event.getFile().getPath());
  for (  FileObject fo : Collections.list(editorConfigFileObject.getParent().getChildren(true))) {
    LOG.log(Level.INFO,"String_Node_Str",fo.getPath());
    subsequentFilesListener.fileChanged(new FileEvent(fo));
  }
}

Fixed version (ground truth):
@Override public void fileChanged(FileEvent event){
  super.fileChanged(event);
  LOG.log(Level.INFO,"String_Node_Str",event.getFile().getPath());
  propagateChanges();
}
Program: 58245
Project: 58245
Buggy source:
@Override public void fileRenamed(FileRenameEvent event){
  super.fileRenamed(event);
  LOG.log(Level.INFO,"String_Node_Str",event.getFile().getPath());
}

Fixed version (ground truth):
@Override public void fileRenamed(FileRenameEvent event){
  super.fileRenamed(event);
  LOG.log(Level.FINE,"String_Node_Str",event.getFile().getPath());
}
Program: 58246
Project: 58246
Buggy source:
@Override public void fileAttributeChanged(FileAttributeEvent event){
  super.fileAttributeChanged(event);
  LOG.log(Level.INFO,"String_Node_Str",event.getFile().getPath());
}

Fixed version (ground truth):
@Override public void fileAttributeChanged(FileAttributeEvent event){
  super.fileAttributeChanged(event);
  LOG.log(Level.FINE,"String_Node_Str",event.getFile().getPath());
}
Program: 58247
Project: 58247
Buggy source:
@Override public void fileFolderCreated(FileEvent event){
  super.fileFolderCreated(event);
  LOG.log(Level.INFO,"String_Node_Str",event.getFile().getPath());
}

Fixed version (ground truth):
@Override public void fileFolderCreated(FileEvent event){
  super.fileFolderCreated(event);
  LOG.log(Level.FINE,"String_Node_Str",event.getFile().getPath());
}
Program: 58248
Project: 58248
Buggy source:
public EditorConfigChangeListener(Project project,FileObject editorConfigFileObject){
  this.project=project;
  this.editorConfigFileObject=editorConfigFileObject;
  LOG.log(Level.INFO,"String_Node_Str",editorConfigFileObject.getPath());
  this.subsequentFilesListener=new FileChangeListener(project,editorConfigFileObject);
  editorConfigFileObject.getParent().addRecursiveListener(subsequentFilesListener);
}

Fixed version (ground truth):
public EditorConfigChangeListener(Project project,FileObject editorConfigFileObject){
  this.project=project;
  this.editorConfigFileObject=editorConfigFileObject;
  LOG.log(Level.INFO,"String_Node_Str",editorConfigFileObject.getPath());
  this.subsequentFilesListener=new FileChangeListener(project,editorConfigFileObject);
  editorConfigFileObject.getParent().addRecursiveListener(subsequentFilesListener);
  propagateChanges();
}
Program: 58249
Project: 58249
Buggy source:
@Override public void fileDeleted(FileEvent event){
  super.fileDeleted(event);
  LOG.log(Level.INFO,"String_Node_Str",event.getFile().getPath());
}

Fixed version (ground truth):
@Override public void fileDeleted(FileEvent event){
  super.fileDeleted(event);
  LOG.log(Level.INFO,"String_Node_Str",event.getFile().getPath());
  event.getFile().getParent().removeRecursiveListener(subsequentFilesListener);
  event.getFile().removeFileChangeListener(this);
}
Program: 58250
Project: 58250
Buggy source:
/** 
 * Method is triggered when content has changed and it's possible to display content in NetBeans. Method is also triggered when project will be opened.
 * @param event Event for listening on filesystem changes
 */
@Override public void fileDataCreated(FileEvent event){
  super.fileDataCreated(event);
  LOG.log(Level.INFO,"String_Node_Str",event.getFile().getPath());
}

Fixed version (ground truth):
/** 
 * Method is triggered when content has changed and it's possible to display content in NetBeans. Method is also triggered when project will be opened.
 * @param event Event for listening on filesystem changes
 */
@Override public void fileDataCreated(FileEvent event){
  super.fileDataCreated(event);
  LOG.log(Level.FINE,"String_Node_Str",event.getFile().getPath());
}
Program: 58251
Project: 58251
Buggy source:
@Override public void fileChanged(FileEvent event){
  super.fileChanged(event);
  String path=event.getFile().getPath();
  LOG.log(Level.INFO,"String_Node_Str",path);
  if (applyRulesToFile(event)) {
    try {
      new EditorConfigProcessor().applyRulesToFile(DataObject.find(event.getFile()));
    }
 catch (    DataObjectNotFoundException ex) {
      Exceptions.printStackTrace(ex);
    }
catch (    Exception ex) {
      Exceptions.printStackTrace(ex);
    }
  }
 else {
    LOG.log(Level.INFO,"String_Node_Str",path);
  }
}

Fixed version (ground truth):
@Override public void fileChanged(FileEvent event){
  super.fileChanged(event);
  String path=event.getFile().getPath();
  LOG.log(Level.INFO,"String_Node_Str",new Object[]{editorConfigFileObject.getPath(),path});
  if (applyRulesToFile(event)) {
    try {
      new EditorConfigProcessor().applyRulesToFile(DataObject.find(event.getFile()));
    }
 catch (    DataObjectNotFoundException ex) {
      Exceptions.printStackTrace(ex);
    }
catch (    Exception ex) {
      Exceptions.printStackTrace(ex);
    }
  }
 else {
    LOG.log(Level.INFO,"String_Node_Str",new Object[]{editorConfigFileObject.getPath(),path});
  }
}
Program: 58252
Project: 58252
Buggy source:
@Override public void fileRenamed(FileRenameEvent event){
  super.fileRenamed(event);
  LOG.log(Level.INFO,"String_Node_Str",event.getFile().getPath());
}

Fixed version (ground truth):
@Override public void fileRenamed(FileRenameEvent event){
  super.fileRenamed(event);
  LOG.log(Level.FINE,"String_Node_Str",new Object[]{editorConfigFileObject.getPath(),event.getFile().getPath()});
}
Program: 58253
Project: 58253
Buggy source:
@Override public void fileAttributeChanged(FileAttributeEvent event){
  super.fileAttributeChanged(event);
  LOG.log(Level.INFO,"String_Node_Str",event.getFile().getPath());
}

Fixed version (ground truth):
@Override public void fileAttributeChanged(FileAttributeEvent event){
  super.fileAttributeChanged(event);
  LOG.log(Level.FINE,"String_Node_Str",new Object[]{editorConfigFileObject.getPath(),event.getFile().getPath()});
}
Program: 58254
Project: 58254
Buggy source:
public FileChangeListener(Project project,FileObject editorConfigFileObject){
  this.project=project;
  LOG.log(Level.INFO,"String_Node_Str",editorConfigFileObject.getParent().getPath());
}

Fixed version (ground truth):
public FileChangeListener(Project project,FileObject editorConfigFileObject){
  this.project=project;
  this.editorConfigFileObject=editorConfigFileObject;
  LOG.log(Level.INFO,"String_Node_Str",new Object[]{editorConfigFileObject.getPath(),editorConfigFileObject.getParent().getPath()});
}
Program: 58255
Project: 58255
Buggy source:
@Override public void fileFolderCreated(FileEvent event){
  super.fileFolderCreated(event);
  LOG.log(Level.INFO,"String_Node_Str",event.getFile().getPath());
}

Fixed version (ground truth):
@Override public void fileFolderCreated(FileEvent event){
  super.fileFolderCreated(event);
  LOG.log(Level.FINE,"String_Node_Str",new Object[]{editorConfigFileObject.getPath(),event.getFile().getPath()});
}
Program: 58256
Project: 58256
Buggy source:
@Override public void fileDeleted(FileEvent event){
  super.fileDeleted(event);
  LOG.log(Level.INFO,"String_Node_Str",event.getFile().getPath());
}

Fixed version (ground truth):
@Override public void fileDeleted(FileEvent event){
  super.fileDeleted(event);
  LOG.log(Level.INFO,"String_Node_Str",new Object[]{editorConfigFileObject.getPath(),event.getFile().getPath()});
  event.getFile().removeRecursiveListener(this);
}
Program: 58257
Project: 58257
Buggy source:
/** 
 * Method is triggered when content has changed and it's possible to display content in NetBeans. Method is also triggered when project will be opened.
 * @param event Event for listening on filesystem changes
 */
@Override public void fileDataCreated(FileEvent event){
  super.fileDataCreated(event);
  FileObject primaryFile=event.getFile();
  LOG.log(Level.INFO,"String_Node_Str",new Object[]{primaryFile.getPath(),primaryFile.getMIMEType()});
}

Fixed version (ground truth):
/** 
 * Method is triggered when content has changed and it's possible to display content in NetBeans. Method is also triggered when project will be opened.
 * @param event Event for listening on filesystem changes
 */
@Override public void fileDataCreated(FileEvent event){
  super.fileDataCreated(event);
  FileObject primaryFile=event.getFile();
  LOG.log(Level.FINE,"String_Node_Str",new Object[]{editorConfigFileObject.getPath(),primaryFile.getPath(),primaryFile.getMIMEType()});
}
Program: 58258
Project: 58258
Buggy source:
@Override public void fileChanged(FileEvent event){
  super.fileChanged(event);
  LOG.log(Level.INFO,"String_Node_Str",event.getFile().getPath());
}

Fixed version (ground truth):
@Override public void fileChanged(FileEvent event){
  super.fileChanged(event);
  LOG.log(Level.FINE,"String_Node_Str",event.getFile().getPath());
}
Program: 58259
Project: 58259
Buggy source:
@Override public void fileRenamed(FileRenameEvent event){
  super.fileRenamed(event);
  LOG.log(Level.INFO,"String_Node_Str",event.getFile().getPath());
}

Fixed version (ground truth):
@Override public void fileRenamed(FileRenameEvent event){
  super.fileRenamed(event);
  LOG.log(Level.FINE,"String_Node_Str",event.getFile().getPath());
}
Program: 58260
Project: 58260
Buggy source:
@Override public void fileAttributeChanged(FileAttributeEvent event){
  super.fileAttributeChanged(event);
  LOG.log(Level.INFO,"String_Node_Str",event.getFile().getPath());
}

Fixed version (ground truth):
@Override public void fileAttributeChanged(FileAttributeEvent event){
  super.fileAttributeChanged(event);
  LOG.log(Level.FINE,"String_Node_Str",event.getFile().getPath());
}
Program: 58261
Project: 58261
Buggy source:
@Override public void fileFolderCreated(FileEvent event){
  super.fileFolderCreated(event);
  LOG.log(Level.INFO,"String_Node_Str",event.getFile().getPath());
}

Fixed version (ground truth):
@Override public void fileFolderCreated(FileEvent event){
  super.fileFolderCreated(event);
  LOG.log(Level.INFO,"String_Node_Str",event.getFile().getPath());
  ListenerAttacher.attachListeners(event.getFile(),project);
}
Program: 58262
Project: 58262
Buggy source:
@Override public void fileDeleted(FileEvent event){
  super.fileDeleted(event);
  LOG.log(Level.INFO,"String_Node_Str",event.getFile().getPath());
}

Fixed version (ground truth):
@Override public void fileDeleted(FileEvent event){
  super.fileDeleted(event);
  LOG.log(Level.FINE,"String_Node_Str",event.getFile().getPath());
}
Program: 58263
Project: 58263
Buggy source:
/** 
 * Method is triggered when content has changed and it's possible to display content in NetBeans. Method is also triggered when project will be opened.
 * @param event Event for listening on filesystem changes
 */
@Override public void fileDataCreated(FileEvent event){
  super.fileDataCreated(event);
  LOG.log(Level.INFO,"String_Node_Str",event.getFile().getPath());
}

Fixed version (ground truth):
/** 
 * Method is triggered when content has changed and it's possible to display content in NetBeans. Method is also triggered when project will be opened.
 * @param event Event for listening on filesystem changes
 */
@Override public void fileDataCreated(FileEvent event){
  super.fileDataCreated(event);
  LOG.log(Level.INFO,"String_Node_Str",event.getFile().getPath());
  ListenerAttacher.attachListeners(event.getFile(),project);
}
Program: 58265
Project: 58265
Buggy source:
private void updateChangesInEditorWindow(FileInfo info){
  LOG.log(Level.INFO,"String_Node_Str",info.getPath());
  EditorCookie cookie=info.getCookie();
  NbDocument.runAtomic(cookie.getDocument(),() -> {
    try {
      StyledDocumentWriter.writeWithEditorKit(info);
    }
 catch (    FileAccessException ex) {
      LOG.log(Level.SEVERE,ex.getMessage());
    }
  }
);
}

Fixed version (ground truth):
private void updateChangesInEditorWindow(final FileInfo info){
  LOG.log(Level.INFO,"String_Node_Str",info.getPath());
  final EditorCookie cookie=info.getCookie();
  Runnable runner=new Runnable(){
    public void run(){
      NbDocument.runAtomic(cookie.getDocument(),() -> {
        try {
          StyledDocumentWriter.writeWithEditorKit(info);
        }
 catch (        FileAccessException ex) {
          LOG.log(Level.SEVERE,ex.getMessage());
        }
      }
);
    }
  }
;
  if (SwingUtilities.isEventDispatchThread()) {
    runner.run();
  }
 else {
    SwingUtilities.invokeLater(runner);
  }
}
Program: 58268
Project: 58268
Buggy source:
private EditorCookie getEditorCookie(FileObject fileObject){
  try {
    return (EditorCookie)DataObject.find(fileObject).getLookup().lookup(EditorCookie.class);
  }
 catch (  DataObjectNotFoundException ex) {
    Exceptions.printStackTrace(ex);
    return null;
  }
}

Fixed version (ground truth):
private EditorCookie getEditorCookie(DataObject dataObject){
  return dataObject.getLookup().lookup(EditorCookie.class);
}
Program: 58269
Project: 58269
Buggy source:
private StringBuilder replaceLineEndings(StringBuilder content,String lineEnding){
  BufferedReader reader=new BufferedReader(new StringReader(content.toString()));
  String tempContent=reader.lines().collect(Collectors.joining(lineEnding));
  if (content.toString().endsWith("String_Node_Str") || content.toString().endsWith("String_Node_Str")) {
    content=new StringBuilder(tempContent).append(lineEnding);
  }
  return content;
}

Fixed version (ground truth):
private StringBuilder replaceLineEndings(StringBuilder content,String lineEnding){
  BufferedReader reader=new BufferedReader(new StringReader(content.toString()));
  String tempContent=reader.lines().collect(Collectors.joining(lineEnding));
  if (content.toString().endsWith("String_Node_Str") || content.toString().endsWith("String_Node_Str")) {
    content.delete(0,content.length());
    content.append(tempContent).append(lineEnding);
  }
 else {
    content.delete(0,content.length());
    content.append(tempContent);
  }
  return content;
}
Program: 58271
Project: 58271
Buggy source:
@Override public void run(){
  try {
    LOG.log(Level.INFO,"String_Node_Str",cookie);
    if (cookie != null) {
      LOG.log(Level.INFO,"String_Node_Str");
      final StyledDocument document=cookie.openDocument();
      LOG.log(Level.INFO,"String_Node_Str",document);
      if (cookie.getOpenedPanes() != null) {
        NbDocument.runAtomicAsUser(document,() -> {
          try {
            String end=document.getText(document.getEndPosition().getOffset() - 2,1);
            LOG.log(Level.INFO,"String_Node_Str",end);
            if (!end.endsWith("String_Node_Str") && !end.endsWith("String_Node_Str")) {
              LOG.log(Level.INFO,"String_Node_Str",lineEnding);
              document.insertString(document.getEndPosition().getOffset() - 1,lineEnding,null);
              String result=document.getText(document.getEndPosition().getOffset() - 10,10);
              System.out.println("String_Node_Str" + result);
              LOG.log(Level.INFO,"String_Node_Str");
              cookie.saveDocument();
            }
          }
 catch (          BadLocationException|IOException ex) {
            Exceptions.printStackTrace(ex);
          }
        }
);
      }
    }
  }
 catch (  BadLocationException ex) {
    Exceptions.printStackTrace(ex);
  }
catch (  DataObjectNotFoundException ex) {
    Exceptions.printStackTrace(ex);
  }
catch (  IOException ex) {
    Exceptions.printStackTrace(ex);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    LOG.log(Level.INFO,"String_Node_Str",cookie);
    if (cookie != null) {
      LOG.log(Level.INFO,"String_Node_Str");
      final StyledDocument document=cookie.getDocument();
      LOG.log(Level.INFO,"String_Node_Str",document);
      NbDocument.runAtomicAsUser(document,() -> {
        try {
          String end=document.getText(document.getEndPosition().getOffset() - 2,1);
          LOG.log(Level.INFO,"String_Node_Str",end);
          if (!end.endsWith("String_Node_Str") && !end.endsWith("String_Node_Str")) {
            LOG.log(Level.INFO,"String_Node_Str",lineEnding);
            document.insertString(document.getEndPosition().getOffset() - 1,lineEnding,null);
            String result=document.getText(document.getEndPosition().getOffset() - 10,10);
            System.out.println("String_Node_Str" + result);
            LOG.log(Level.INFO,"String_Node_Str");
            cookie.saveDocument();
          }
        }
 catch (        BadLocationException|IOException ex) {
          Exceptions.printStackTrace(ex);
        }
      }
);
    }
  }
 catch (  BadLocationException ex) {
    Exceptions.printStackTrace(ex);
  }
}
Program: 58272
Project: 58272
Buggy source:
@Override public void fileChanged(FileEvent event){
  super.fileChanged(event);
  LOG.log(Level.INFO,"String_Node_Str",event.getFile().getPath());
  LOG.log(Level.INFO,"String_Node_Str",event.isExpected());
  if (!event.getFile().isFolder() && !event.isExpected()) {
    try {
      new EditorConfigProcessor().applyRulesToFile(DataObject.find(event.getFile()));
    }
 catch (    DataObjectNotFoundException ex) {
      Exceptions.printStackTrace(ex);
    }
catch (    Exception ex) {
      Exceptions.printStackTrace(ex);
    }
  }
}

Fixed version (ground truth):
@Override public void fileChanged(FileEvent event){
  super.fileChanged(event);
  LOG.log(Level.INFO,"String_Node_Str",event.getFile().getPath());
  if (!event.getFile().isFolder() && !event.isExpected()) {
    try {
      new EditorConfigProcessor().applyRulesToFile(DataObject.find(event.getFile()));
    }
 catch (    DataObjectNotFoundException ex) {
      Exceptions.printStackTrace(ex);
    }
catch (    Exception ex) {
      Exceptions.printStackTrace(ex);
    }
  }
}
Program: 58274
Project: 58274
Buggy source:
private String trimWhitespaces(String content,String lineEnding){
  return Arrays.stream(content.split("String_Node_Str")).map((  String t) -> {
    return t.replaceAll("String_Node_Str","String_Node_Str");
  }
).collect(Collectors.joining(lineEnding));
}

Fixed version (ground truth):
private String trimWhitespaces(String content,String lineEnding){
  BufferedReader reader=new BufferedReader(new StringReader(content));
  return reader.lines().map((  String t) -> {
    return t.replaceAll("String_Node_Str","String_Node_Str");
  }
).collect(Collectors.joining(lineEnding));
}
Program: 58275
Project: 58275
Buggy source:
private String finalNewline(String content,String lineEnding){
  if (!content.endsWith("String_Node_Str") && content.endsWith("String_Node_Str")) {
    LOG.log(Level.INFO,"String_Node_Str");
    return content + lineEnding;
  }
 else {
    LOG.log(Level.INFO,"String_Node_Str");
    return content;
  }
}

Fixed version (ground truth):
private String finalNewline(String content,String lineEnding){
  if (!content.endsWith("String_Node_Str") && !content.endsWith("String_Node_Str")) {
    LOG.log(Level.INFO,"String_Node_Str");
    return content + lineEnding;
  }
 else {
    LOG.log(Level.INFO,"String_Node_Str");
    return content;
  }
}
Program: 58276
Project: 58276
Buggy source:
@Override public void run(){
  FileLock lock=FileLock.NONE;
  try {
    try (OutputStream outputStream=fo.getOutputStream(lock);OutputStreamWriter writer=new OutputStreamWriter(outputStream,cs)){
      apply(writer);
      writer.flush();
      outputStream.flush();
      lock.releaseLock();
    }
   }
 catch (  IOException ex) {
    Exceptions.printStackTrace(ex);
  }
}

Fixed version (ground truth):
@Override public void run(){
  FileLock lock=FileLock.NONE;
  try {
    try (OutputStream outputStream=fo.getOutputStream(lock);OutputStreamWriter writer=new OutputStreamWriter(outputStream,cs)){
      apply(writer);
      writer.flush();
      outputStream.flush();
      lock.releaseLock();
      fo.refresh(true);
    }
   }
 catch (  IOException ex) {
    Exceptions.printStackTrace(ex);
  }
}
Program: 58277
Project: 58277
Buggy source:
@Override public Boolean call() throws Exception {
  Charset requestedCharset=EditorConfigPropertyMapper.mapCharset(ecCharset);
  boolean wasChanged=false;
  LOG.log(Level.INFO,"String_Node_Str",new Object[]{Tab.TWO,requestedCharset.name()});
  FileObject fo=dataObject.getPrimaryFile();
  Charset currentCharset=getCharset(fo);
  if (currentCharset.name().equals(requestedCharset.name())) {
    LOG.log(Level.INFO,"String_Node_Str",new Object[]{Tab.TWO,currentCharset.name()});
  }
 else {
    LOG.log(Level.INFO,"String_Node_Str",new Object[]{Tab.TWO,currentCharset.name(),requestedCharset.name()});
    final String content=new ReadFileTask(fo){
      @Override public String apply(      BufferedReader reader){
        return reader.lines().collect(Collectors.joining(lineEnding));
      }
    }
.call();
    boolean wasWritten=writeFile(new WriteFileTask(fo){
      @Override public void apply(      OutputStreamWriter writer){
        try {
          writer.write(content);
        }
 catch (        IOException ex) {
          Exceptions.printStackTrace(ex);
        }
      }
    }
);
    if (wasWritten) {
      LOG.log(Level.INFO,"String_Node_Str",new Object[]{Tab.TWO,requestedCharset.name()});
      setFileAttribute(fo,FileAttributeName.ENCODING,requestedCharset.name());
      wasChanged=true;
    }
  }
  return wasChanged;
}

Fixed version (ground truth):
@Override public Boolean call() throws Exception {
  Charset requestedCharset=EditorConfigPropertyMapper.mapCharset(ecCharset);
  boolean wasChanged=false;
  LOG.log(Level.INFO,"String_Node_Str",new Object[]{Tab.TWO,requestedCharset.name()});
  FileObject fo=dataObject.getPrimaryFile();
  Charset currentCharset=getCharset(fo);
  if (currentCharset.name().equals(requestedCharset.name())) {
    LOG.log(Level.INFO,"String_Node_Str",new Object[]{Tab.TWO,currentCharset.name()});
  }
 else {
    LOG.log(Level.INFO,"String_Node_Str",new Object[]{Tab.TWO,currentCharset.name(),requestedCharset.name()});
    final String content=new ReadFileTask(fo){
      @Override public String apply(      BufferedReader reader){
        return reader.lines().collect(Collectors.joining(lineEnding));
      }
    }
.call();
    boolean wasWritten=writeFile(new WriteFileTask(fo){
      @Override public void apply(      OutputStreamWriter writer){
        try {
          writer.write(content);
          setFileAttribute(fo,FileAttributeName.ENCODING,requestedCharset.name());
        }
 catch (        IOException ex) {
          Exceptions.printStackTrace(ex);
        }
      }
      private void setFileAttribute(      FileObject fo,      String key,      String value){
        try {
          fo.setAttribute(key,value);
        }
 catch (        IOException ex) {
          LOG.log(Level.SEVERE,"String_Node_Str",new Object[]{key,value,fo.getPath(),ex.getMessage()});
        }
      }
    }
);
    if (wasWritten) {
      LOG.log(Level.INFO,"String_Node_Str",new Object[]{Tab.TWO,requestedCharset.name()});
      wasChanged=true;
    }
  }
  return wasChanged;
}
Program: 58278
Project: 58278
Buggy source:
@Override public void apply(OutputStreamWriter writer){
  try {
    writer.write(content);
  }
 catch (  IOException ex) {
    Exceptions.printStackTrace(ex);
  }
}

Fixed version (ground truth):
@Override public void apply(OutputStreamWriter writer){
  try {
    writer.write(content);
    setFileAttribute(fo,FileAttributeName.ENCODING,requestedCharset.name());
  }
 catch (  IOException ex) {
    Exceptions.printStackTrace(ex);
  }
}
Program: 58279
Project: 58279
Buggy source:
/** 
 * TODO: It looks like "FileEncodingQuery.getEncoding" always returns "UTF-8". Even if the charset of that file is already UTF-16LE. Therefore we should change our charset lookup. After the charset has been changed by us, we add a file attribute which helps us to detect the charset in future. Maybe we should use a CharsetDetector: http://userguide.icu-project.org/conversion/detection
 * @param fo
 * @return
 */
private Charset getCharset(FileObject fo){
  Object fileEncoding=fo.getAttribute(FileAttributeName.ENCODING);
  if (fileEncoding == null) {
    Charset currentCharset=FileEncodingQuery.getEncoding(fo);
    fileEncoding=currentCharset.name();
  }
  return Charset.forName((String)fileEncoding);
}

Fixed version (ground truth):
/** 
 * TODO: It looks like "FileEncodingQuery.getEncoding" always returns "UTF-8". Even if the charset of that file is already UTF-16LE. Therefore we should change our charset lookup. After the charset has been changed by us, we add a file attribute which helps us to detect the charset in future. Maybe we should use a CharsetDetector: http://userguide.icu-project.org/conversion/detection
 * @param fo
 * @return
 */
private Charset getCharset(FileObject fo){
  Object fileEncoding=fo.getAttribute(FileAttributeName.ENCODING);
  if (fileEncoding == null) {
    LOG.log(Level.WARNING,"String_Node_Str");
    Charset currentCharset=FileEncodingQuery.getEncoding(fo);
    fileEncoding=currentCharset.name();
  }
  return Charset.forName((String)fileEncoding);
}
Program: 58281
Project: 58281
Buggy source:
@Override public void run(){
  try {
    LOG.log(Level.INFO,"String_Node_Str",cookie);
    if (cookie != null) {
      LOG.log(Level.INFO,"String_Node_Str");
      final StyledDocument document=cookie.openDocument();
      LOG.log(Level.INFO,"String_Node_Str",document);
      for (      JEditorPane pane : cookie.getOpenedPanes()) {
        NbDocument.runAtomicAsUser(document,() -> {
          try {
            String end=document.getText(document.getEndPosition().getOffset() - 2,1);
            LOG.log(Level.INFO,"String_Node_Str",end);
            if (!end.endsWith("String_Node_Str") && !end.endsWith("String_Node_Str")) {
              LOG.log(Level.INFO,"String_Node_Str",lineEnding);
              document.insertString(document.getEndPosition().getOffset() - 1,lineEnding,null);
              String result=document.getText(document.getEndPosition().getOffset() - 10,10);
              System.out.println("String_Node_Str" + result);
              LOG.log(Level.INFO,"String_Node_Str");
              cookie.saveDocument();
            }
          }
 catch (          BadLocationException|IOException ex) {
            Exceptions.printStackTrace(ex);
          }
        }
);
      }
    }
  }
 catch (  BadLocationException ex) {
    Exceptions.printStackTrace(ex);
  }
catch (  DataObjectNotFoundException ex) {
    Exceptions.printStackTrace(ex);
  }
catch (  IOException ex) {
    Exceptions.printStackTrace(ex);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    LOG.log(Level.INFO,"String_Node_Str",cookie);
    if (cookie != null) {
      LOG.log(Level.INFO,"String_Node_Str");
      final StyledDocument document=cookie.openDocument();
      LOG.log(Level.INFO,"String_Node_Str",document);
      if (cookie.getOpenedPanes() != null) {
        NbDocument.runAtomicAsUser(document,() -> {
          try {
            String end=document.getText(document.getEndPosition().getOffset() - 2,1);
            LOG.log(Level.INFO,"String_Node_Str",end);
            if (!end.endsWith("String_Node_Str") && !end.endsWith("String_Node_Str")) {
              LOG.log(Level.INFO,"String_Node_Str",lineEnding);
              document.insertString(document.getEndPosition().getOffset() - 1,lineEnding,null);
              String result=document.getText(document.getEndPosition().getOffset() - 10,10);
              System.out.println("String_Node_Str" + result);
              LOG.log(Level.INFO,"String_Node_Str");
              cookie.saveDocument();
            }
          }
 catch (          BadLocationException|IOException ex) {
            Exceptions.printStackTrace(ex);
          }
        }
);
      }
    }
  }
 catch (  BadLocationException ex) {
    Exceptions.printStackTrace(ex);
  }
catch (  DataObjectNotFoundException ex) {
    Exceptions.printStackTrace(ex);
  }
catch (  IOException ex) {
    Exceptions.printStackTrace(ex);
  }
}
Program: 58282
Project: 58282
Buggy source:
@Override public void run(){
  try {
    LOG.log(Level.INFO,"String_Node_Str",cookie);
    if (cookie != null) {
      LOG.log(Level.INFO,"String_Node_Str");
      final StyledDocument document=cookie.openDocument();
      LOG.log(Level.INFO,"String_Node_Str",document);
      for (      JEditorPane pane : cookie.getOpenedPanes()) {
        NbDocument.runAtomicAsUser(document,() -> {
          try {
            LOG.log(Level.INFO,"String_Node_Str",lineEnding);
            document.insertString(document.getEndPosition().getOffset() - 1,lineEnding,null);
            String result=document.getText(document.getEndPosition().getOffset() - 10,10);
            System.out.println("String_Node_Str" + result);
            LOG.log(Level.INFO,"String_Node_Str");
            cookie.saveDocument();
          }
 catch (          BadLocationException|IOException ex) {
            Exceptions.printStackTrace(ex);
          }
        }
);
      }
    }
  }
 catch (  BadLocationException ex) {
    Exceptions.printStackTrace(ex);
  }
catch (  DataObjectNotFoundException ex) {
    Exceptions.printStackTrace(ex);
  }
catch (  IOException ex) {
    Exceptions.printStackTrace(ex);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    LOG.log(Level.INFO,"String_Node_Str",cookie);
    if (cookie != null) {
      LOG.log(Level.INFO,"String_Node_Str");
      final StyledDocument document=cookie.openDocument();
      LOG.log(Level.INFO,"String_Node_Str",document);
      for (      JEditorPane pane : cookie.getOpenedPanes()) {
        NbDocument.runAtomicAsUser(document,() -> {
          try {
            String end=document.getText(document.getEndPosition().getOffset() - 2,1);
            LOG.log(Level.INFO,"String_Node_Str",end);
            if (!end.endsWith("String_Node_Str") && !end.endsWith("String_Node_Str")) {
              LOG.log(Level.INFO,"String_Node_Str",lineEnding);
              document.insertString(document.getEndPosition().getOffset() - 1,lineEnding,null);
              String result=document.getText(document.getEndPosition().getOffset() - 10,10);
              System.out.println("String_Node_Str" + result);
              LOG.log(Level.INFO,"String_Node_Str");
              cookie.saveDocument();
            }
          }
 catch (          BadLocationException|IOException ex) {
            Exceptions.printStackTrace(ex);
          }
        }
);
      }
    }
  }
 catch (  BadLocationException ex) {
    Exceptions.printStackTrace(ex);
  }
catch (  DataObjectNotFoundException ex) {
    Exceptions.printStackTrace(ex);
  }
catch (  IOException ex) {
    Exceptions.printStackTrace(ex);
  }
}
Program: 58284
Project: 58284
Buggy source:
public static boolean doLineEnding(final DataObject dataObject,final String lineEnding) throws Exception {
  return new FinalNewLineOperation().apply(dataObject,lineEnding).call();
}

Fixed version (ground truth):
public static boolean doLineEnding(final DataObject dataObject,final String lineEnding) throws Exception {
  return new LineEndingOperation().apply(dataObject,lineEnding).call();
}
Program: 58285
Project: 58285
Buggy source:
/** 
 * Changes   {@code CodeStylePreferences}.
 * @param dataObject
 * @param tabWidth
 * @return
 */
public static boolean doTabWidth(final DataObject dataObject,final String tabWidth) throws Exception {
  return new FinalNewLineOperation().apply(dataObject,tabWidth).call();
}

Fixed version (ground truth):
/** 
 * Changes   {@code CodeStylePreferences}.
 * @param dataObject
 * @param tabWidth
 * @return
 */
public static boolean doTabWidth(final DataObject dataObject,final String tabWidth) throws Exception {
  return new TabWidthOperation().apply(dataObject,tabWidth).call();
}
Program: 58287
Project: 58287
Buggy source:
public void resetLocalStats(int statType){
  if (statType == STAT_CURRENT) {
    mCurrentStats.clear();
    mRunningSince=System.currentTimeMillis();
  }
 else   if (statType == STAT_PUSH) {
    mSincePushStats.clear();
  }
}

Fixed version (ground truth):
public void resetLocalStats(int statType){
  if (statType == STAT_CURRENT) {
    if (mCurrentStats != null) {
      mCurrentStats.clear();
    }
    mRunningSince=System.currentTimeMillis();
  }
 else   if (statType == STAT_PUSH) {
    if (mSincePushStats != null) {
      mSincePushStats.clear();
    }
  }
}
Program: 58288
Project: 58288
Buggy source:
private void debugLog(String log){
  String curLevel=m_prefs.getString("String_Node_Str","String_Node_Str");
  if (curLevel.equals("String_Node_Str")) {
    XposedBridge.log(TAG + log);
    Log.d(TAG,log);
  }
}

Fixed version (ground truth):
private void debugLog(String log){
  String curLevel=m_prefs.getString("String_Node_Str","String_Node_Str");
  if (curLevel.equals("String_Node_Str")) {
    XposedBridge.log(TAG + log);
  }
}
Program: 58289
Project: 58289
Buggy source:
private void defaultLog(String log){
  String curLevel=m_prefs.getString("String_Node_Str","String_Node_Str");
  if (curLevel.equals("String_Node_Str") || curLevel.equals("String_Node_Str")) {
    XposedBridge.log(TAG + log);
    Log.d(TAG,log);
  }
}

Fixed version (ground truth):
private void defaultLog(String log){
  String curLevel=m_prefs.getString("String_Node_Str","String_Node_Str");
  if (curLevel.equals("String_Node_Str") || curLevel.equals("String_Node_Str")) {
    XposedBridge.log(TAG + log);
  }
}
Program: 58290
Project: 58290
Buggy source:
public void resetLocalStats(int statType){
  if (statType == STAT_CURRENT) {
    mCurrentStats.clear();
  }
 else   if (statType == STAT_PUSH) {
    mSincePushStats.clear();
  }
}

Fixed version (ground truth):
public void resetLocalStats(int statType){
  if (statType == STAT_CURRENT) {
    mCurrentStats.clear();
    mRunningSince=SystemClock.elapsedRealtime();
  }
 else   if (statType == STAT_PUSH) {
    mSincePushStats.clear();
  }
}