nus-yam/ex-repair huggingface dataset:
Program: 36842
Project: 36842
Buggy source:
private void hashInAccount(UploadItem uploadItem,CheckResponse checkResponse){
  MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
  boolean inFolder=checkResponse.isInFolder();
  InstantProcess process=new InstantProcess(mfTokenFarm,this,uploadItem);
  MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str" + uploadItem.getUploadOptions().getActionOnInAccount().toString());
switch (uploadItem.getUploadOptions().getActionOnInAccount()) {
case UPLOAD_ALWAYS:
    MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
  executor.execute(process);
break;
case UPLOAD_IF_NOT_IN_FOLDER:
MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
if (!inFolder) {
MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
executor.execute(process);
}
 else {
MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
notifyUploadListenerCompleted(uploadItem);
}
break;
case DO_NOT_UPLOAD:
default :
MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
notifyUploadListenerCompleted(uploadItem);
break;
}
}

Fixed version (ground truth):
private void hashInAccount(UploadItem uploadItem,CheckResponse checkResponse){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  boolean inFolder=checkResponse.isInFolder();
  InstantProcess process=new InstantProcess(mfTokenFarm,this,uploadItem);
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str" + uploadItem.getUploadOptions().getActionOnInAccount().toString());
switch (uploadItem.getUploadOptions().getActionOnInAccount()) {
case UPLOAD_ALWAYS:
    MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  executor.execute(process);
break;
case UPLOAD_IF_NOT_IN_FOLDER:
MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
if (!inFolder) {
MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
executor.execute(process);
}
 else {
MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
notifyUploadListenerCompleted(uploadItem);
}
break;
case DO_NOT_UPLOAD:
default :
MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
notifyUploadListenerCompleted(uploadItem);
break;
}
}
Program: 36843
Project: 36843
Buggy source:
@Override public void onCheckCompleted(UploadItem uploadItem,CheckResponse checkResponse){
  MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
  if (uploadItem.getUploadAttemptCount() > MAX_UPLOAD_ATTEMPTS || uploadItem.isCancelled()) {
    notifyUploadListenerCancelled(uploadItem);
    return;
  }
  if (checkResponse.getStorageLimitExceeded()) {
    MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
    storageLimitExceeded(uploadItem);
  }
 else   if (checkResponse.getResumableUpload().areAllUnitsReady() && !uploadItem.getPollUploadKey().isEmpty()) {
    PollProcess process=new PollProcess(mfTokenFarm,this,uploadItem);
    executor.execute(process);
  }
 else {
    if (checkResponse.doesHashExists()) {
      hashExists(uploadItem,checkResponse);
    }
 else {
      hashDoesNotExist(uploadItem,checkResponse);
    }
  }
}

Fixed version (ground truth):
@Override public void onCheckCompleted(UploadItem uploadItem,CheckResponse checkResponse){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  if (uploadItem.getUploadAttemptCount() > MAX_UPLOAD_ATTEMPTS || uploadItem.isCancelled()) {
    notifyUploadListenerCancelled(uploadItem);
    return;
  }
  if (checkResponse.getStorageLimitExceeded()) {
    MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
    storageLimitExceeded(uploadItem);
  }
 else   if (checkResponse.getResumableUpload().areAllUnitsReady() && !uploadItem.getPollUploadKey().isEmpty()) {
    PollProcess process=new PollProcess(mfTokenFarm,this,uploadItem);
    executor.execute(process);
  }
 else {
    if (checkResponse.doesHashExists()) {
      hashExists(uploadItem,checkResponse);
    }
 else {
      hashDoesNotExist(uploadItem,checkResponse);
    }
  }
}
Program: 36844
Project: 36844
Buggy source:
private void storageLimitExceeded(UploadItem uploadItem){
  MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
  notifyUploadListenerCancelled(uploadItem);
}

Fixed version (ground truth):
private void storageLimitExceeded(UploadItem uploadItem){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  notifyUploadListenerCancelled(uploadItem);
}
Program: 36845
Project: 36845
Buggy source:
@Override public void onStartedUploadProcess(UploadItem uploadItem){
  MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
  notifyUploadListenerStarted(uploadItem);
}

Fixed version (ground truth):
@Override public void onStartedUploadProcess(UploadItem uploadItem){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  notifyUploadListenerStarted(uploadItem);
}
Program: 36846
Project: 36846
Buggy source:
@Override public void onPollCompleted(UploadItem uploadItem,PollResponse pollResponse){
  MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
  PollResponse.DoUpload doUpload=pollResponse.getDoUpload();
  PollResponse.Status pollStatusCode=doUpload.getStatusCode();
  PollResponse.Result pollResultCode=doUpload.getResultCode();
  PollResponse.FileError pollFileErrorCode=doUpload.getFileErrorCode();
  if (pollStatusCode != PollResponse.Status.NO_MORE_REQUESTS_FOR_THIS_KEY && pollResultCode == PollResponse.Result.SUCCESS && pollFileErrorCode == PollResponse.FileError.NO_ERROR) {
    MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str" + pollResponse.getDoUpload().getStatusCode().toString() + "String_Node_Str");
    notifyUploadListenerCancelled(uploadItem);
    addUploadRequest(uploadItem);
  }
 else {
    notifyUploadListenerCompleted(uploadItem);
  }
}

Fixed version (ground truth):
@Override public void onPollCompleted(UploadItem uploadItem,PollResponse pollResponse){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  PollResponse.DoUpload doUpload=pollResponse.getDoUpload();
  PollResponse.Status pollStatusCode=doUpload.getStatusCode();
  PollResponse.Result pollResultCode=doUpload.getResultCode();
  PollResponse.FileError pollFileErrorCode=doUpload.getFileErrorCode();
  if (pollStatusCode != PollResponse.Status.NO_MORE_REQUESTS_FOR_THIS_KEY && pollResultCode == PollResponse.Result.SUCCESS && pollFileErrorCode == PollResponse.FileError.NO_ERROR) {
    MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str" + pollResponse.getDoUpload().getStatusCode().toString() + "String_Node_Str");
    notifyUploadListenerCancelled(uploadItem);
    addUploadRequest(uploadItem);
  }
 else {
    notifyUploadListenerCompleted(uploadItem);
  }
}
Program: 36847
Project: 36847
Buggy source:
public void sendHttpsPostRequest(HttpRequestCallback callback,HttpProcessor httpPreProcessor,HttpProcessor httpPostProcessor,ApiRequestObject apiRequestObject){
  HttpPostRequestRunnable httpsPostRequestRunnable=new HttpPostRequestRunnable(callback,httpPreProcessor,httpPostProcessor,apiRequestObject,this);
  executor.execute(httpsPostRequestRunnable);
}

Fixed version (ground truth):
public void sendHttpsPostRequest(HttpRequestCallback callback,HttpProcessor httpPreProcessor,HttpProcessor httpPostProcessor,ApiRequestObject apiRequestObject){
  logger.info("String_Node_Str");
  HttpPostRequestRunnable httpsPostRequestRunnable=new HttpPostRequestRunnable(callback,httpPreProcessor,httpPostProcessor,apiRequestObject,this);
  executor.execute(httpsPostRequestRunnable);
}
Program: 36848
Project: 36848
Buggy source:
public void sendHttpsGetRequest(HttpRequestCallback callback,HttpProcessor httpPreProcessor,HttpProcessor httpPostProcessor,ApiRequestObject apiRequestObject){
  HttpsGetRequestRunnable httpsGetRequestRunnable=new HttpsGetRequestRunnable(callback,httpPreProcessor,httpPostProcessor,apiRequestObject,this);
  executor.execute(httpsGetRequestRunnable);
}

Fixed version (ground truth):
public void sendHttpsGetRequest(HttpRequestCallback callback,HttpProcessor httpPreProcessor,HttpProcessor httpPostProcessor,ApiRequestObject apiRequestObject){
  logger.info("String_Node_Str");
  HttpsGetRequestRunnable httpsGetRequestRunnable=new HttpsGetRequestRunnable(callback,httpPreProcessor,httpPostProcessor,apiRequestObject,this);
  executor.execute(httpsGetRequestRunnable);
}
Program: 36849
Project: 36849
Buggy source:
@Override public final void run(){
  if (callback != null) {
    callback.httpRequestStarted(apiRequestObject);
  }
  connectionTimeout=httpPeriProcessor.getConnectionTimeout();
  readTimeout=httpPeriProcessor.getReadTimeout();
  doRequest();
  if (httpPreProcessor != null) {
    httpPreProcessor.processApiRequestObject(apiRequestObject);
  }
  sendApiErrorIfExists();
  if (httpPostProcessor != null) {
    httpPostProcessor.processApiRequestObject(apiRequestObject);
  }
  if (callback != null) {
    callback.httpRequestFinished(apiRequestObject);
  }
}

Fixed version (ground truth):
@Override public final void run(){
  notifyHttpRequestStarted();
  setTimeouts();
  doPreProcess();
  doRequest();
  sendApiErrorIfExists();
  doPostProcess();
  notifyHttpRequestFinished();
}
Program: 36850
Project: 36850
Buggy source:
private String getViewLink(){
  return view;
}

Fixed version (ground truth):
public String getViewLink(){
  return view;
}
Program: 36851
Project: 36851
Buggy source:
private String getNormalDownloadLink(){
  return normal_download;
}

Fixed version (ground truth):
public String getNormalDownloadLink(){
  return normal_download;
}
Program: 36852
Project: 36852
Buggy source:
public List<FileInfo> getFileInfos(){
  if (file_infos == null) {
    file_infos=new LinkedList<FileInfo>();
  }
  return file_infos;
}

Fixed version (ground truth):
public List<FileInfos> getFileInfos(){
  if (file_infos == null) {
    file_infos=new LinkedList<FileInfos>();
  }
  return file_infos;
}
Program: 36853
Project: 36853
Buggy source:
public List<Links> getLinks(){
  return links;
}

Fixed version (ground truth):
public Links getLinks(){
  return links;
}
Program: 36854
Project: 36854
Buggy source:
public List<FileInfos> getFileInfos(){
  if (file_infos == null) {
    file_infos=new LinkedList<FileInfos>();
  }
  return file_infos;
}

Fixed version (ground truth):
public List<FileInfo> getFileInfos(){
  if (file_infos == null) {
    file_infos=new LinkedList<FileInfo>();
  }
  return file_infos;
}
Program: 36855
Project: 36855
Buggy source:
@Override public void borrowUploadActionToken(ApiRequestObject apiRequestObject){
  System.out.println(TAG + "String_Node_Str");
  borrowUploadTokenLock.lock();
  if (uploadActionToken == null || uploadActionToken.isExpired()) {
    getNewImageActionToken();
  }
  try {
    while (uploadActionToken == null || uploadActionToken.isExpired() || uploadActionToken.getTokenString() == null) {
      uploadTokenNotExpired.await(45,TimeUnit.SECONDS);
    }
  }
 catch (  InterruptedException e) {
    apiRequestObject.addExceptionDuringRequest(e);
  }
 finally {
    borrowUploadTokenLock.unlock();
  }
  apiRequestObject.setActionToken(imageActionToken);
}

Fixed version (ground truth):
@Override public void borrowUploadActionToken(ApiRequestObject apiRequestObject){
  System.out.println(TAG + "String_Node_Str");
  borrowUploadTokenLock.lock();
  if (uploadActionToken == null || uploadActionToken.isExpired()) {
    getNewImageActionToken();
  }
  try {
    while (uploadActionToken == null || uploadActionToken.isExpired() || uploadActionToken.getTokenString() == null) {
      uploadTokenNotExpired.await(45,TimeUnit.SECONDS);
    }
  }
 catch (  InterruptedException e) {
    apiRequestObject.addExceptionDuringRequest(e);
  }
 finally {
    borrowUploadTokenLock.unlock();
  }
  apiRequestObject.setActionToken(uploadActionToken);
}
Program: 36856
Project: 36856
Buggy source:
/** 
 * creates an upload chunk array of bytes based on a position in a file.
 */
private byte[] createUploadChunk(long unitSize,int chunkNumber,BufferedInputStream fileStream) throws IOException {
  logger.info("String_Node_Str");
  byte[] readBytes=new byte[(int)unitSize];
  logger.info("String_Node_Str" + readBytes.length);
  int offset=(int)(unitSize * chunkNumber);
  int skipLength=offset;
  logger.info("String_Node_Str" + offset);
  logger.info("String_Node_Str" + unitSize);
  logger.info("String_Node_Str");
  fileStream.skip(skipLength);
  logger.info("String_Node_Str" + fileStream.available());
  int readSize=fileStream.read(readBytes,0,(int)unitSize);
  logger.info("String_Node_Str" + readSize);
  if (readSize != unitSize) {
    logger.info("String_Node_Str");
    byte[] temp=new byte[readSize];
    System.arraycopy(readBytes,0,temp,0,readSize);
    readBytes=temp;
  }
  StringBuilder sb=new StringBuilder();
  for (  Byte b : readBytes) {
    sb.append(b.toString());
  }
  logger.info("String_Node_Str" + sb.toString());
  return readBytes;
}

Fixed version (ground truth):
/** 
 * creates an upload chunk array of bytes based on a position in a file.
 */
private byte[] createUploadChunk(long unitSize,int chunkNumber,BufferedInputStream fileStream) throws IOException {
  logger.info("String_Node_Str");
  byte[] readBytes=new byte[(int)unitSize];
  logger.info("String_Node_Str" + readBytes.length);
  int offset=(int)(unitSize * chunkNumber);
  int skipLength=offset;
  logger.info("String_Node_Str" + offset);
  logger.info("String_Node_Str" + unitSize);
  logger.info("String_Node_Str" + skipLength + "String_Node_Str");
  fileStream.skip(skipLength);
  logger.info("String_Node_Str" + fileStream.available());
  int readSize=fileStream.read(readBytes,0,(int)unitSize);
  logger.info("String_Node_Str" + readSize);
  if (readSize != unitSize) {
    logger.info("String_Node_Str");
    byte[] temp=new byte[readSize];
    System.arraycopy(readBytes,0,temp,0,readSize);
    readBytes=temp;
  }
  StringBuilder sb=new StringBuilder();
  for (  Byte b : readBytes) {
    sb.append(b.toString());
  }
  logger.info("String_Node_Str" + sb.toString());
  return readBytes;
}
Program: 36857
Project: 36857
Buggy source:
/** 
 * Transform a string into a JsonElement.  All resposne strings returned from the web api are wrapped in response json element. This method strips the wrapper element, and converts the remaining element into a JsonElement via GSON.
 * @param response  A response string from a web API call.
 * @return  The JsonElement created from the response string.
 */
public static JsonElement getResponseElement(String response){
  if (response.length() == 0 || response.equalsIgnoreCase("String_Node_Str") || response == null) {
    response=FAIL_RES;
  }
  JsonElement returnJson=new JsonObject();
  JsonParser parser=new JsonParser();
  JsonElement rootElement=parser.parse(response);
  if (rootElement.isJsonObject()) {
    JsonElement jsonResult=rootElement.getAsJsonObject().get("String_Node_Str");
    if (jsonResult.isJsonObject()) {
      returnJson=jsonResult.getAsJsonObject();
    }
  }
  return returnJson;
}

Fixed version (ground truth):
/** 
 * Transform a string into a JsonElement.  All resposne strings returned from the web api are wrapped in response json element. This method strips the wrapper element, and converts the remaining element into a JsonElement via GSON.
 * @param response  A response string from a web API call.
 * @return  The JsonElement created from the response string.
 */
public static JsonElement getResponseElement(String response){
  if (response.length() == 0 || response.isEmpty() || response == null) {
    response=FAIL_RES;
  }
  JsonElement returnJson=new JsonObject();
  JsonParser parser=new JsonParser();
  JsonElement rootElement=parser.parse(response);
  if (rootElement.isJsonObject()) {
    JsonElement jsonResult=rootElement.getAsJsonObject().get("String_Node_Str");
    if (jsonResult.isJsonObject()) {
      returnJson=jsonResult.getAsJsonObject();
    }
  }
  return returnJson;
}
Program: 36858
Project: 36858
Buggy source:
/** 
 * converts a String received from JSON format into a response String.
 * @param response - the response received in JSON format
 * @return the response received which can then be parsed into a specific format as per Gson.fromJson()
 */
public static String getResponseString(String response){
  if (response.length() == 0 || response.equalsIgnoreCase("String_Node_Str") || response == null) {
    response=FAIL_RES;
  }
  JsonParser parser=new JsonParser();
  JsonElement element=parser.parse(response);
  if (element.isJsonObject()) {
    JsonObject jsonResponse=element.getAsJsonObject().get("String_Node_Str").getAsJsonObject();
    return jsonResponse.toString();
  }
 else {
    return FAIL_RES;
  }
}

Fixed version (ground truth):
/** 
 * converts a String received from JSON format into a response String.
 * @param response - the response received in JSON format
 * @return the response received which can then be parsed into a specific format as per Gson.fromJson()
 */
public static String getResponseString(String response){
  if (response.length() == 0 || response.isEmpty() || response == null) {
    response=FAIL_RES;
  }
  JsonParser parser=new JsonParser();
  JsonElement element=parser.parse(response);
  if (element.isJsonObject()) {
    JsonObject jsonResponse=element.getAsJsonObject().get("String_Node_Str").getAsJsonObject();
    return jsonResponse.toString();
  }
 else {
    return FAIL_RES;
  }
}
Program: 36859
Project: 36859
Buggy source:
public int getNumberOfUnits(){
  if (number_of_units == null || number_of_units.equals("String_Node_Str")) {
    return 0;
  }
  return Integer.parseInt(number_of_units);
}

Fixed version (ground truth):
public int getNumberOfUnits(){
  if (number_of_units == null || number_of_units.isEmpty()) {
    return 0;
  }
  return Integer.parseInt(number_of_units);
}
Program: 36860
Project: 36860
Buggy source:
public int getUnitSize(){
  if (unit_size == null || unit_size.equals("String_Node_Str")) {
    return 0;
  }
  return Integer.parseInt(unit_size);
}

Fixed version (ground truth):
public int getUnitSize(){
  if (unit_size == null || unit_size.isEmpty()) {
    return 0;
  }
  return Integer.parseInt(unit_size);
}
Program: 36861
Project: 36861
Buggy source:
public int getCount(){
  if (count == null || count.equals("String_Node_Str")) {
    return 0;
  }
  return Integer.parseInt(count);
}

Fixed version (ground truth):
public int getCount(){
  if (count == null || count.isEmpty()) {
    return 0;
  }
  return Integer.parseInt(count);
}
Program: 36862
Project: 36862
Buggy source:
public int getDeviceRevision(){
  if (device_revision == null || device_revision.equals("String_Node_Str")) {
    return 0;
  }
  return Integer.parseInt(device_revision);
}

Fixed version (ground truth):
public int getDeviceRevision(){
  if (device_revision == null || device_revision.isEmpty()) {
    return 0;
  }
  return Integer.parseInt(device_revision);
}
Program: 36863
Project: 36863
Buggy source:
public long getSize(){
  if (size == null || size.equals("String_Node_Str")) {
    return 0;
  }
  return Long.parseLong(size);
}

Fixed version (ground truth):
public long getSize(){
  if (size == null || size.isEmpty()) {
    return 0;
  }
  return Long.parseLong(size);
}
Program: 36864
Project: 36864
Buggy source:
public PollResultCode getResultCode(){
  if (result == null || result.equals("String_Node_Str")) {
    result="String_Node_Str";
  }
  return PollResultCode.fromInt(Integer.parseInt(result));
}

Fixed version (ground truth):
public PollResultCode getResultCode(){
  if (result == null || result.isEmpty()) {
    result="String_Node_Str";
  }
  return PollResultCode.fromInt(Integer.parseInt(result));
}
Program: 36865
Project: 36865
Buggy source:
public PollStatusCode getStatusCode(){
  if (status == null || status.equals("String_Node_Str")) {
    return PollStatusCode.fromInt(0);
  }
  return PollStatusCode.fromInt(Integer.parseInt(status));
}

Fixed version (ground truth):
public PollStatusCode getStatusCode(){
  if (status == null || status.isEmpty()) {
    return PollStatusCode.fromInt(0);
  }
  return PollStatusCode.fromInt(Integer.parseInt(status));
}
Program: 36866
Project: 36866
Buggy source:
public PollFileErrorCode getFileErrorCode(){
  if (fileerror == null || fileerror.equals("String_Node_Str")) {
    fileerror="String_Node_Str";
  }
  return PollFileErrorCode.fromInt(Integer.parseInt(fileerror));
}

Fixed version (ground truth):
public PollFileErrorCode getFileErrorCode(){
  if (fileerror == null || fileerror.isEmpty()) {
    fileerror="String_Node_Str";
  }
  return PollFileErrorCode.fromInt(Integer.parseInt(fileerror));
}
Program: 36867
Project: 36867
Buggy source:
@Override public void onPollCompleted(UploadItem uploadItem,PollResponse response){
  logger.info("String_Node_Str");
  if (response.getDoUpload().getStatusCode() != PollStatusCode.NO_MORE_REQUESTS_FOR_THIS_KEY) {
    addUploadRequest(uploadItem);
  }
 else {
    notifyListenersCompleted(uploadItem);
  }
}

Fixed version (ground truth):
@Override public void onPollCompleted(UploadItem uploadItem,PollResponse response){
  logger.info("String_Node_Str");
  if (response.getDoUpload().getStatusCode() != PollStatusCode.NO_MORE_REQUESTS_FOR_THIS_KEY) {
    logger.info("String_Node_Str" + response.getDoUpload().getStatusCode().toString() + "String_Node_Str");
    addUploadRequest(uploadItem);
  }
 else {
    notifyListenersCompleted(uploadItem);
  }
}
Program: 36868
Project: 36868
Buggy source:
private void notifyListenersStarted(UploadItem uploadItem){
  logger.info("String_Node_Str");
  if (uiListener != null) {
    uiListener.onCompleted(uploadItem);
  }
  if (dbListener != null) {
    dbListener.onCompleted(uploadItem);
  }
}

Fixed version (ground truth):
private void notifyListenersStarted(UploadItem uploadItem){
  logger.info("String_Node_Str");
  if (uiListener != null) {
    uiListener.onStarted(uploadItem);
  }
  if (dbListener != null) {
    dbListener.onStarted(uploadItem);
  }
}
Program: 36869
Project: 36869
Buggy source:
/** 
 * adds an UploadItem to the backlog queue. If the UploadItem already exists in the backlog queue then we do not add the item.
 * @param uploadItem The UploadItem to add to the backlog queue.
 */
public void addUploadRequest(UploadItem uploadItem){
  logger.info("String_Node_Str");
  if (uploadItem == null || uploadItem.getFileData() == null || uploadItem.getFileData().getFileHash() == null || uploadItem.getFileData().getFileHash().isEmpty() || uploadItem.getFileData().getFilePath() == null || uploadItem.getFileData().getFilePath().isEmpty() || uploadItem.getFileData().getFileSize() == 0) {
    logger.info("String_Node_Str");
    return;
  }
  CheckProcess process=new CheckProcess(sessionManager,this,uploadItem);
  executor.execute(process);
}

Fixed version (ground truth):
/** 
 * adds an UploadItem to the backlog queue. If the UploadItem already exists in the backlog queue then we do not add the item.
 * @param uploadItem The UploadItem to add to the backlog queue.
 */
public void addUploadRequest(UploadItem uploadItem){
  logger.info("String_Node_Str");
  if (uploadItem == null || uploadItem.getFileData() == null || uploadItem.getFileData().getFilePath() == null || uploadItem.getFileData().getFilePath().isEmpty()) {
    logger.info("String_Node_Str");
    return;
  }
  CheckProcess process=new CheckProcess(sessionManager,this,uploadItem);
  executor.execute(process);
}
Program: 36870
Project: 36870
Buggy source:
@Override public void run(){
  logger.info("String_Node_Str");
  check();
}

Fixed version (ground truth):
@Override public void run(){
  logger.info("String_Node_Str");
  uploadItem.getFileData().setFileSize();
  uploadItem.getFileData().setFileHash();
  check();
}
Program: 36871
Project: 36871
Buggy source:
/** 
 * lets listeners know that this process has been cancelled for this item. manager is informed of lost connection.
 */
private void notifyManagerLostConnection(){
  if (uploadManager != null) {
    uploadManager.onLostConnection(uploadItem);
  }
}

Fixed version (ground truth):
/** 
 * lets listeners know that this process has been cancelled for this item. manager is informed of lost connection.
 */
private void notifyManagerLostConnection(){
  logger.info("String_Node_Str");
  if (uploadManager != null) {
    uploadManager.onLostConnection(uploadItem);
  }
}
Program: 36873
Project: 36873
Buggy source:
public void notifyListenersException(UploadItem uploadItem,Exception exception){
  if (uploadManager != null) {
    uploadManager.onProcessException(uploadItem,exception);
  }
}

Fixed version (ground truth):
public void notifyListenersException(UploadItem uploadItem,Exception exception){
  logger.info("String_Node_Str");
  if (uploadManager != null) {
    uploadManager.onProcessException(uploadItem,exception);
  }
}
Program: 36874
Project: 36874
Buggy source:
/** 
 * notifies the upload manager that the process has been cancelled and then notifies other listeners.
 * @param response - poll response.
 */
private void notifyManagerCancelled(PollResponse response){
  if (uploadManager != null) {
    uploadManager.onCancelled(uploadItem,response);
  }
}

Fixed version (ground truth):
/** 
 * notifies the upload manager that the process has been cancelled and then notifies other listeners.
 * @param response - poll response.
 */
private void notifyManagerCancelled(PollResponse response){
  logger.info("String_Node_Str");
  if (uploadManager != null) {
    uploadManager.onCancelled(uploadItem,response);
  }
}
Program: 36875
Project: 36875
Buggy source:
/** 
 * notifies the listeners that this upload has successfully completed.
 * @param response - poll response.
 */
public void notifyManagerCompleted(PollResponse response){
  if (uploadManager != null) {
    uploadManager.onPollCompleted(uploadItem,response);
  }
}

Fixed version (ground truth):
/** 
 * notifies the listeners that this upload has successfully completed.
 * @param response - poll response.
 */
public void notifyManagerCompleted(PollResponse response){
  logger.info("String_Node_Str");
  if (uploadManager != null) {
    uploadManager.onPollCompleted(uploadItem,response);
  }
}
Program: 36876
Project: 36876
Buggy source:
/** 
 * generates a HashMap of the GET parameters.
 * @return - map of request parameters.
 */
private HashMap<String,String> generateGetParameters(){
  HashMap<String,String> keyValue=new HashMap<String,String>();
  keyValue.put("String_Node_Str",uploadItem.getPollUploadKey());
  keyValue.put("String_Node_Str","String_Node_Str");
  return keyValue;
}

Fixed version (ground truth):
/** 
 * generates a HashMap of the GET parameters.
 * @return - map of request parameters.
 */
private HashMap<String,String> generateGetParameters(){
  logger.info("String_Node_Str");
  HashMap<String,String> keyValue=new HashMap<String,String>();
  keyValue.put("String_Node_Str",uploadItem.getPollUploadKey());
  keyValue.put("String_Node_Str","String_Node_Str");
  return keyValue;
}
Program: 36878
Project: 36878
Buggy source:
/** 
 * calculates the chunk size.
 * @param chunkNumber The current chunk number.
 * @param numChunks   The total number of chunks.
 * @param fileSize    The file size in bytes.
 * @param unitSize    The size of a single chunk.
 * @return The actual chunk size.
 */
private int getChunkSize(int chunkNumber,int numChunks,long fileSize,int unitSize){
  logger.info("String_Node_Str");
  if (chunkNumber >= numChunks) {
    return 0;
  }
  if (fileSize % unitSize == 0) {
    return unitSize;
  }
 else   if (chunkNumber < numChunks - 1) {
    return unitSize;
  }
 else {
    return (int)(fileSize % unitSize);
  }
}

Fixed version (ground truth):
/** 
 * calculates the chunk size.
 * @param chunkNumber The current chunk number.
 * @param numChunks   The total number of chunks.
 * @param fileSize    The file size in bytes.
 * @param unitSize    The size of a single chunk.
 * @return The actual chunk size.
 */
private int getChunkSize(int chunkNumber,int numChunks,long fileSize,int unitSize){
  logger.info("String_Node_Str");
  int chunkSize;
  if (chunkNumber >= numChunks) {
    chunkSize=0;
  }
 else {
    if (fileSize % unitSize == 0) {
      logger.info("String_Node_Str" + unitSize);
      chunkSize=unitSize;
    }
 else     if (chunkNumber < numChunks - 1) {
      logger.info("String_Node_Str" + unitSize);
      chunkSize=unitSize;
    }
 else {
      logger.info("String_Node_Str" + unitSize);
      chunkSize=(int)(fileSize % unitSize);
    }
  }
  logger.info("String_Node_Str" + chunkSize);
  return chunkSize;
}
Program: 36879
Project: 36879
Buggy source:
/** 
 * converts an array of bytes into a SHA256 hash.
 * @param chunkData The chunk to hash.
 * @return The SHA-256 hash of an upload chunk.
 */
private String getSHA256(byte[] chunkData) throws NoSuchAlgorithmException {
  logger.info("String_Node_Str");
  MessageDigest md=MessageDigest.getInstance("String_Node_Str");
  byte[] hashBytes=md.digest(chunkData);
  StringBuilder sb=new StringBuilder();
  for (  byte hashByte : hashBytes) {
    String tempString=Integer.toHexString((hashByte & 0xFF) | 0x100).substring(1,3);
    sb.append(tempString);
  }
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * converts an array of bytes into a SHA256 hash.
 * @param chunkData The chunk to hash.
 * @return The SHA-256 hash of an upload chunk.
 */
private String getSHA256(byte[] chunkData) throws NoSuchAlgorithmException {
  logger.info("String_Node_Str");
  MessageDigest md=MessageDigest.getInstance("String_Node_Str");
  byte[] hashBytes=md.digest(chunkData);
  StringBuilder sb=new StringBuilder();
  for (  byte hashByte : hashBytes) {
    String tempString=Integer.toHexString((hashByte & 0xFF) | 0x100).substring(1,3);
    sb.append(tempString);
  }
  String hash=sb.toString();
  logger.info("String_Node_Str" + hash);
  return hash;
}
Program: 36880
Project: 36880
Buggy source:
/** 
 * creates an upload chunk array of bytes.
 * @param unitSize   The size of the chunk to create.
 * @param fileStream The BufferedInputStream containing the upload file.
 * @return an array of bytes with unitSize size, or 0 size if IOException is caught
 */
private byte[] createUploadChunk(long unitSize,BufferedInputStream fileStream) throws IOException {
  logger.info("String_Node_Str");
  byte[] readBytes=new byte[(int)unitSize];
  int readSize;
  readSize=fileStream.read(readBytes,0,(int)unitSize);
  if (readSize != unitSize) {
    byte[] temp=new byte[readSize];
    System.arraycopy(readBytes,0,temp,0,readSize);
    readBytes=temp;
  }
  return readBytes;
}

Fixed version (ground truth):
/** 
 * creates an upload chunk array of bytes based on a position in a file.
 */
private byte[] createUploadChunk(long unitSize,int chunkNumber,BufferedInputStream fileStream) throws IOException {
  logger.info("String_Node_Str");
  byte[] readBytes=new byte[(int)unitSize];
  logger.info("String_Node_Str" + readBytes.length);
  int offset=(int)(unitSize * chunkNumber);
  int skipLength=offset;
  logger.info("String_Node_Str" + offset);
  logger.info("String_Node_Str" + unitSize);
  logger.info("String_Node_Str" + skipLength + "String_Node_Str");
  fileStream.skip(skipLength);
  logger.info("String_Node_Str" + fileStream.available());
  int readSize=fileStream.read(readBytes,0,(int)unitSize);
  logger.info("String_Node_Str" + readSize);
  if (readSize != unitSize) {
    logger.info("String_Node_Str");
    byte[] temp=new byte[readSize];
    System.arraycopy(readBytes,0,temp,0,readSize);
    readBytes=temp;
  }
  StringBuilder sb=new StringBuilder();
  for (  Byte b : readBytes) {
    sb.append(b.toString());
  }
  logger.info("String_Node_Str" + sb.toString());
  return readBytes;
}
Program: 36881
Project: 36881
Buggy source:
/** 
 * go to TestComplete activity
 */
public void gotoComplete(){
  Intent intent=new Intent(this,TestComplete.class);
  startActivity(intent);
}

Fixed version (ground truth):
void gotoComplete();
Program: 36883
Project: 36883
Buggy source:
public static List<ConnectedComponent> splitStrategy(BigLong2ShortHashMap hm,int k,int b1,int b2,String statFP,Logger logger) throws FileNotFoundException {
  List<ConnectedComponent> ans=new ArrayList<ConnectedComponent>();
  BigLongHashSet processedKmers=new BigLongHashSet(hm.capacity());
  PrintWriter statPW=new PrintWriter(statFP);
  statPW.println("String_Node_Str");
  for (int freqThreshold=0; ; freqThreshold++) {
    List<ConnectedComponent> components=getComponents(hm,k,freqThreshold,processedKmers);
    if (components.size() == 0) {
      break;
    }
    int added=0;
    for (    ConnectedComponent comp : components) {
      if (comp.size() < b1) {
        banComponent(hm,comp);
      }
 else       if (comp.size() < b2) {
        ans.add(comp);
        added++;
        statPW.println(comp.size() + "String_Node_Str" + comp.getWeight()+ "String_Node_Str"+ freqThreshold);
        banComponent(hm,comp);
      }
    }
    logger.debug("String_Node_Str" + freqThreshold + "String_Node_Str"+ "String_Node_Str"+ added+ "String_Node_Str"+ ans.size());
  }
  statPW.close();
  return ans;
}

Fixed version (ground truth):
public static List<ConnectedComponent> splitStrategy(BigLong2ShortHashMap hm,int k,int b1,int b2,String statFP,Logger logger) throws FileNotFoundException {
  List<ConnectedComponent> ans=new ArrayList<ConnectedComponent>();
  BigLongHashSet processedKmers=new BigLongHashSet(hm.capacity());
  PrintWriter statPW=new PrintWriter(statFP);
  statPW.println("String_Node_Str");
  for (int freqThreshold=0; ; freqThreshold++) {
    List<ConnectedComponent> components=getComponents(hm,k,freqThreshold,b2,processedKmers);
    if (components.size() == 0) {
      break;
    }
    int added=0;
    for (    ConnectedComponent comp : components) {
      if (comp.size() < b1) {
        banComponent(hm,comp);
      }
 else       if (comp.size() < b2) {
        ans.add(comp);
        added++;
        statPW.println(comp.size() + "String_Node_Str" + comp.getWeight()+ "String_Node_Str"+ freqThreshold);
        banComponent(hm,comp);
      }
    }
    logger.debug("String_Node_Str" + freqThreshold + "String_Node_Str"+ "String_Node_Str"+ added+ "String_Node_Str"+ ans.size());
  }
  statPW.close();
  return ans;
}
Program: 36884
Project: 36884
Buggy source:
private static List<ConnectedComponent> getComponents(BigLong2ShortHashMap hm,int k,int freqThreshold,BigLongHashSet processedKmers){
  List<ConnectedComponent> ans=new ArrayList<ConnectedComponent>();
  processedKmers.reset();
  Iterator<MutableLongShortEntry> it=hm.entryIterator();
  while (it.hasNext()) {
    MutableLongShortEntry entry=it.next();
    long kmer=entry.getKey();
    short value=entry.getValue();
    if (value > freqThreshold && !processedKmers.contains(kmer)) {
      ConnectedComponent comp=getComponent(hm,k,kmer,freqThreshold,processedKmers);
      ans.add(comp);
    }
  }
  return ans;
}

Fixed version (ground truth):
private static List<ConnectedComponent> getComponents(BigLong2ShortHashMap hm,int k,int freqThreshold,int b2,BigLongHashSet processedKmers){
  List<ConnectedComponent> ans=new ArrayList<ConnectedComponent>();
  processedKmers.reset();
  Iterator<MutableLongShortEntry> it=hm.entryIterator();
  while (it.hasNext()) {
    MutableLongShortEntry entry=it.next();
    long kmer=entry.getKey();
    short value=entry.getValue();
    if (value > freqThreshold && !processedKmers.contains(kmer)) {
      ConnectedComponent comp=getComponent(hm,k,kmer,freqThreshold,b2,processedKmers);
      ans.add(comp);
    }
  }
  return ans;
}
Program: 36885
Project: 36885
Buggy source:
private static ConnectedComponent getComponent(BigLong2ShortHashMap hm,int k,long startKmer,int freqThreshold,BigLongHashSet processedKmers){
  ConnectedComponent ans=new ConnectedComponent();
  long weight=0;
  LongArrayFIFOQueue queue=new LongArrayFIFOQueue();
  queue.enqueue(startKmer);
  processedKmers.add(startKmer);
  ans.add(startKmer);
  weight+=hm.get(startKmer);
  while (queue.size() > 0) {
    long kmer=queue.dequeue();
    for (    long neighbour : KmerOperations.possibleNeighbours(kmer,k)) {
      short value=hm.get(neighbour);
      if (value > freqThreshold && !processedKmers.contains(neighbour)) {
        queue.enqueue(neighbour);
        processedKmers.add(neighbour);
        ans.add(neighbour);
        weight+=value;
      }
    }
  }
  ans.setWeight(weight);
  return ans;
}

Fixed version (ground truth):
private static ConnectedComponent getComponent(BigLong2ShortHashMap hm,int k,long startKmer,int freqThreshold,int b2,BigLongHashSet processedKmers){
  ConnectedComponent ans=new ConnectedComponent();
  long weight=0;
  LongArrayFIFOQueue queue=new LongArrayFIFOQueue();
  queue.enqueue(startKmer);
  processedKmers.add(startKmer);
  ans.add(startKmer);
  weight+=hm.get(startKmer);
  while (queue.size() > 0) {
    long kmer=queue.dequeue();
    for (    long neighbour : KmerOperations.possibleNeighbours(kmer,k)) {
      short value=hm.get(neighbour);
      if (value > freqThreshold && !processedKmers.contains(neighbour)) {
        queue.enqueue(neighbour);
        processedKmers.add(neighbour);
        if (ans.size() < b2) {
          ans.add(neighbour);
          weight+=value;
        }
      }
    }
  }
  ans.setWeight(weight);
  return ans;
}
Program: 36887
Project: 36887
Buggy source:
private void processSequence(ShortKmer startKmer){
  int value=hm.get(startKmer.toLong());
  StringBuilder sequenceSB=new StringBuilder(startKmer.toString());
  long seqWeight=value, minWeight=value, maxWeight=value;
  byte rightNuc=HashMapOperations.getRightNucleotide(hm,startKmer,freqThreshold);
  if (rightNuc < 0) {
    return;
  }
  ShortKmer kmer=new ShortKmer(startKmer);
  while (true) {
    kmer.shiftRight(rightNuc);
    byte nextRightNuc=HashMapOperations.getRightNucleotide(hm,kmer,freqThreshold);
    if (nextRightNuc < 0 || HashMapOperations.getLeftNucleotide(hm,kmer,freqThreshold) < 0) {
      break;
    }
    sequenceSB.append(DnaTools.toChar(rightNuc));
    value=hm.get(kmer.toLong());
    seqWeight+=value;
    minWeight=Math.min(minWeight,value);
    maxWeight=Math.max(maxWeight,value);
    rightNuc=nextRightNuc;
  }
  if (sequenceSB.length() >= lenThreshold) {
    sequenceList.add(new Sequence(sequenceSB.toString(),seqWeight,minWeight,maxWeight));
  }
}

Fixed version (ground truth):
private void processSequence(ShortKmer startKmer){
  int value=hm.get(startKmer.toLong());
  StringBuilder sequenceSB=new StringBuilder(startKmer.toString());
  long seqWeight=value, minWeight=value, maxWeight=value;
  ShortKmer kmer=new ShortKmer(startKmer);
  while (true) {
    byte rightNuc=HashMapOperations.getRightNucleotide(hm,kmer,freqThreshold);
    if (rightNuc < 0) {
      break;
    }
    kmer.shiftRight(rightNuc);
    byte leftNuc=HashMapOperations.getLeftNucleotide(hm,kmer,freqThreshold);
    if (leftNuc < 0) {
      break;
    }
    sequenceSB.append(DnaTools.toChar(rightNuc));
    value=hm.get(kmer.toLong());
    seqWeight+=value;
    minWeight=Math.min(minWeight,value);
    maxWeight=Math.max(maxWeight,value);
  }
  if (sequenceSB.length() >= lenThreshold) {
    sequenceList.add(new Sequence(sequenceSB.toString(),seqWeight,minWeight,maxWeight));
  }
}
Program: 36888
Project: 36888
Buggy source:
@Override public void run(){
  for (  Long2IntMap.Entry entry : openHM.long2IntEntrySet()) {
    int value=entry.getIntValue();
    if (value <= freqThreshold) {
      continue;
    }
    long key=entry.getLongKey();
    ShortKmer kmer=new ShortKmer(key,k);
    if (HashMapOperations.getRightNucleotide(hm,kmer,freqThreshold) < 0 || HashMapOperations.getLeftNucleotide(hm,kmer,freqThreshold) >= 0) {
      continue;
    }
    processSequence(kmer);
  }
}

Fixed version (ground truth):
@Override public void run(){
  for (  Long2IntMap.Entry entry : openHM.long2IntEntrySet()) {
    int value=entry.getIntValue();
    if (value <= freqThreshold) {
      continue;
    }
    long key=entry.getLongKey();
    ShortKmer kmerF=new ShortKmer(key,k);
    ShortKmer[] kmers=new ShortKmer[]{kmerF,kmerF.rc()};
    for (    ShortKmer kmer : kmers) {
      boolean isLeft=false;
      byte nuc=HashMapOperations.getLeftNucleotide(hm,kmer,freqThreshold);
      if (nuc < 0) {
        isLeft=true;
      }
 else {
        byte rightNuc=kmer.nucAt(k - 1);
        kmer.shiftLeft(nuc);
        if (HashMapOperations.getRightNucleotide(hm,kmer,freqThreshold) < 0) {
          isLeft=true;
        }
        kmer.shiftRight(rightNuc);
      }
      if (isLeft) {
        processSequence(kmer);
      }
    }
  }
}
Program: 36889
Project: 36889
Buggy source:
private void processSequence(ShortKmer startKmer){
  int value=hm.get(startKmer.toLong());
  StringBuilder sequenceSB=new StringBuilder(startKmer.toString());
  long seqWeight=value, minWeight=value, maxWeight=value;
  ShortKmer kmer=new ShortKmer(startKmer);
  while (true) {
    byte rightNuc=HashMapOperations.getRightNucleotide(hm,kmer,freqThreshold);
    if (rightNuc < 0) {
      break;
    }
    kmer.shiftRight(rightNuc);
    byte leftNuc=HashMapOperations.getLeftNucleotide(hm,kmer,freqThreshold);
    if (leftNuc < 0) {
      break;
    }
    sequenceSB.append(DnaTools.toChar(rightNuc));
    value=hm.get(kmer.toLong());
    seqWeight+=value;
    minWeight=Math.min(minWeight,value);
    maxWeight=Math.max(maxWeight,value);
  }
  if (sequenceSB.length() >= lenThreshold) {
    sequenceList.add(new Sequence(sequenceSB.toString(),seqWeight,minWeight,maxWeight));
  }
}

Fixed version (ground truth):
private void processSequence(ShortKmer startKmer){
  int value=hm.get(startKmer.toLong());
  StringBuilder sequenceSB=new StringBuilder(startKmer.toString());
  long seqWeight=value;
  int minWeight=value, maxWeight=value;
  ShortKmer kmer=new ShortKmer(startKmer);
  while (true) {
    byte rightNuc=HashMapOperations.getRightNucleotide(hm,kmer,freqThreshold);
    if (rightNuc < 0) {
      break;
    }
    kmer.shiftRight(rightNuc);
    byte leftNuc=HashMapOperations.getLeftNucleotide(hm,kmer,freqThreshold);
    if (leftNuc < 0) {
      break;
    }
    sequenceSB.append(DnaTools.toChar(rightNuc));
    value=hm.get(kmer.toLong());
    seqWeight+=value;
    minWeight=Math.min(minWeight,value);
    maxWeight=Math.max(maxWeight,value);
  }
  if (sequenceSB.length() >= lenThreshold) {
    sequenceList.add(new Sequence(sequenceSB.toString(),(int)(seqWeight / (sequenceSB.length() - k + 1)),minWeight,maxWeight));
  }
}
Program: 36890
Project: 36890
Buggy source:
public Sequence(String repr,long totalWeight,long minWeight,long maxWeight){
  this.repr=repr;
  this.totalWeight=totalWeight;
  this.minWeight=minWeight;
  this.maxWeight=maxWeight;
}

Fixed version (ground truth):
public Sequence(String repr,int avgWeight,int minWeight,int maxWeight){
  this.repr=repr;
  this.avgWeight=avgWeight;
  this.minWeight=minWeight;
  this.maxWeight=maxWeight;
}
Program: 36891
Project: 36891
Buggy source:
public int averageWeight(){
  return (int)(totalWeight / length());
}

Fixed version (ground truth):
public int averageWeight(){
  return avgWeight;
}
Program: 36893
Project: 36893
Buggy source:
public static void printSequences(Iterable<Sequence> sequences,File destination) throws FileNotFoundException {
  PrintWriter pw=new PrintWriter(destination);
  int sequenceId=0;
  for (  Sequence seq : sequences) {
    sequenceId++;
    String seqInfo=String.format("String_Node_Str",sequenceId,seq.length(),seq.averageWeight(),seq.minWeight,seq.maxWeight);
    pw.println(seqInfo);
    pw.println(seq);
  }
}

Fixed version (ground truth):
public static void printSequences(Iterable<Sequence> sequences,File destination) throws FileNotFoundException {
  PrintWriter pw=new PrintWriter(destination);
  int sequenceId=0;
  for (  Sequence seq : sequences) {
    sequenceId++;
    String seqInfo=String.format("String_Node_Str",sequenceId,seq.length(),seq.averageWeight(),seq.minWeight,seq.maxWeight);
    pw.println(seqInfo);
    pw.println(seq);
  }
  pw.close();
}
Program: 36894
Project: 36894
Buggy source:
/** 
 * Set the priority of codecs to use.
 */
private void setCodecPrio(){
  try {
    CodecInfoVector codecList=mEndpoint.codecEnum();
    String codecId;
    CodecInfo info;
    Short prio;
    for (int i=1; i < codecList.size(); i++) {
      info=codecList.get(i);
      codecId=info.getCodecId();
      prio=sCodecPrioMapping.get(codecId);
      if (prio != null) {
        mEndpoint.codecSetPriority(codecId,prio);
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Set the priority of codecs to use.
 */
private void setCodecPrio(){
  try {
    CodecInfoVector codecList=mEndpoint.codecEnum();
    String codecId;
    CodecInfo info;
    Short prio;
    for (int i=1; i < codecList.size(); i++) {
      info=codecList.get(i);
      codecId=info.getCodecId();
      prio=findCodecPriority(codecId);
      if (prio != null) {
        mEndpoint.codecSetPriority(codecId,prio);
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 36895
Project: 36895
Buggy source:
@Override protected void onPause(){
  super.onPause();
  mRemoteLogger.d("String_Node_Str");
  PowerManager powerManager=(PowerManager)getSystemService(POWER_SERVICE);
  boolean isScreenInteractive;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
    isScreenInteractive=powerManager.isScreenOn();
  }
 else {
    isScreenInteractive=powerManager.isInteractive();
  }
  if (!isScreenInteractive) {
    mRemoteLogger.i("String_Node_Str");
    return;
  }
  if (mIncomingCallIsRinging) {
    mNotificationHelper.removeAllNotifications();
    mNotificationId=mNotificationHelper.displayNotificationWithCallActions(mCallerIdToDisplay,mPhoneNumberToDisplay);
    mMediaManager.stopIncomingCallRinger();
    mPausedRinging=true;
  }
  if (!mSipServiceBound && mSipService == null) {
    mBroadcastManager.unregisterReceiver(mCallStatusReceiver);
  }
  unregisterReceiver(mBluetoothButtonReceiver);
  stopService();
}

Fixed version (ground truth):
@Override protected void onPause(){
  super.onPause();
  mRemoteLogger.d("String_Node_Str");
  PowerManager powerManager=(PowerManager)getSystemService(POWER_SERVICE);
  boolean isScreenInteractive;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
    isScreenInteractive=powerManager.isScreenOn();
  }
 else {
    isScreenInteractive=powerManager.isInteractive();
  }
  if (!isScreenInteractive) {
    mRemoteLogger.i("String_Node_Str");
    return;
  }
  if (mIncomingCallIsRinging) {
    mNotificationHelper.removeAllNotifications();
    mNotificationId=mNotificationHelper.displayNotificationWithCallActions(mCallerIdToDisplay,mPhoneNumberToDisplay);
    mMediaManager.stopIncomingCallRinger();
    mPausedRinging=true;
  }
  if (mSipService != null && mSipService.getCurrentCall() == null) {
    try {
      mBroadcastManager.unregisterReceiver(mCallStatusReceiver);
    }
 catch (    IllegalArgumentException e) {
      mRemoteLogger.w("String_Node_Str");
    }
  }
  try {
    unregisterReceiver(mBluetoothButtonReceiver);
  }
 catch (  IllegalArgumentException e) {
    mRemoteLogger.w("String_Node_Str");
  }
  stopService();
}
Program: 36896
Project: 36896
Buggy source:
@Override protected void onDestroy(){
  super.onDestroy();
  mRemoteLogger.d("String_Node_Str");
  mNotificationHelper.removeAllNotifications();
  mProximityHelper.stopSensor();
  mMediaManager.deInit();
}

Fixed version (ground truth):
@Override protected void onDestroy(){
  super.onDestroy();
  mRemoteLogger.d("String_Node_Str");
  mNotificationHelper.removeAllNotifications();
  mProximityHelper.stopSensor();
  try {
    unregisterReceiver(mBluetoothButtonReceiver);
  }
 catch (  IllegalArgumentException e) {
    mRemoteLogger.w("String_Node_Str");
  }
  mMediaManager.deInit();
}
Program: 36898
Project: 36898
Buggy source:
@Override public void audioLost(boolean lost){
  mRemoteLogger.i("String_Node_Str");
  mRemoteLogger.i("String_Node_Str" + lost);
  if (lost) {
    if (mConnected) {
      toggleOnHold();
      updateCallButton(R.id.button_onhold,true);
      onCallStatusUpdate(CALL_PUT_ON_HOLD_ACTION);
    }
  }
}

Fixed version (ground truth):
@Override public void audioLost(boolean lost){
  mRemoteLogger.i("String_Node_Str");
  mRemoteLogger.i("String_Node_Str" + lost);
  if (lost) {
    mRemoteLogger.e("String_Node_Str" + mSipService.nativeCallIsRinging());
    if (mConnected && !mSipService.nativeCallIsRinging()) {
      onCallStatusUpdate(CALL_PUT_ON_HOLD_ACTION);
    }
  }
 else {
    if (mConnected && mSipService.getCurrentCall() != null && mSipService.getCurrentCall().isOnHold()) {
      onCallStatusUpdate(CALL_PUT_ON_HOLD_ACTION);
    }
  }
}