nus-yam/ex-repair huggingface dataset:
Program: 36794
Project: 36794
Buggy source:
protected void addBugInstancesToFindBugsDescriptor(final Store store,final BugCollectionType bugCollectionType,final FindBugsDescriptor findBugsDescriptor){
  for (  BugInstanceType bugInstanceType : bugCollectionType.getBugInstance()) {
    BugInstanceDescriptor bugInstanceDescriptor=store.create(BugInstanceDescriptor.class);
    bugInstanceDescriptor.setType(bugInstanceType.getType());
    bugInstanceDescriptor.setPriority(bugInstanceType.getPriority());
    bugInstanceDescriptor.setAbbrev(bugInstanceType.getAbbrev());
    bugInstanceDescriptor.setCategory(bugInstanceType.getCategory());
    final SourceLineType bugInstanceTypeSourceLine=bugInstanceType.getSourceLine();
    final SourceLineDescriptor sourceLineDescriptor=store.create(SourceLineDescriptor.class);
    sourceLineDescriptor.setClassname(bugInstanceTypeSourceLine.getClassname());
    sourceLineDescriptor.setStart(bugInstanceTypeSourceLine.getStart());
    sourceLineDescriptor.setEnd(bugInstanceTypeSourceLine.getEnd());
    sourceLineDescriptor.setSourcefile(bugInstanceTypeSourceLine.getSourcefile());
    sourceLineDescriptor.setSourcepath(bugInstanceTypeSourceLine.getSourcepath());
    bugInstanceDescriptor.setSourceLineDescriptor(sourceLineDescriptor);
    findBugsDescriptor.getContains().add(bugInstanceDescriptor);
  }
}

Fixed version (ground truth):
protected void addBugInstancesToFindBugsDescriptor(final Store store,final BugCollectionType bugCollectionType,final FindBugsDescriptor findBugsDescriptor){
  for (  BugInstanceType bugInstanceType : bugCollectionType.getBugInstance()) {
    BugInstanceDescriptor bugInstanceDescriptor=store.create(BugInstanceDescriptor.class);
    bugInstanceDescriptor.setType(bugInstanceType.getType());
    bugInstanceDescriptor.setPriority(bugInstanceType.getPriority());
    bugInstanceDescriptor.setAbbrev(bugInstanceType.getAbbrev());
    bugInstanceDescriptor.setCategory(bugInstanceType.getCategory());
    if (bugInstanceType.getSourceLine() != null) {
      final SourceLineType bugInstanceTypeSourceLine=bugInstanceType.getSourceLine();
      final SourceLineDescriptor sourceLineDescriptor=store.create(SourceLineDescriptor.class);
      sourceLineDescriptor.setClassname(bugInstanceTypeSourceLine.getClassname());
      sourceLineDescriptor.setStart(bugInstanceTypeSourceLine.getStart());
      sourceLineDescriptor.setEnd(bugInstanceTypeSourceLine.getEnd());
      sourceLineDescriptor.setSourcefile(bugInstanceTypeSourceLine.getSourcefile());
      sourceLineDescriptor.setSourcepath(bugInstanceTypeSourceLine.getSourcepath());
      bugInstanceDescriptor.setSourceLineDescriptor(sourceLineDescriptor);
    }
    findBugsDescriptor.getContains().add(bugInstanceDescriptor);
  }
}
Program: 36795
Project: 36795
Buggy source:
public long getAvailableSpace(){
  return available_space;
}

Fixed version (ground truth):
public long getAvailableSpace(){
  if (available_space == null || available_space.isEmpty()) {
    return 0;
  }
  return Long.parseLong(available_space);
}
Program: 36796
Project: 36796
Buggy source:
public long getStorageLimit(){
  return storage_limit;
}

Fixed version (ground truth):
public long getStorageLimit(){
  if (storage_limit == null || used_storage_size.isEmpty()) {
    return 0;
  }
  return Long.parseLong(storage_limit);
}
Program: 36797
Project: 36797
Buggy source:
public long getUsedStorageSize(){
  return used_storage_size;
}

Fixed version (ground truth):
public long getUsedStorageSize(){
  if (used_storage_size == null || used_storage_size.isEmpty()) {
    return 0;
  }
  return Long.parseLong(used_storage_size);
}
Program: 36798
Project: 36798
Buggy source:
void checkFinished(Upload upload){
  if (mDebug) {
    System.out.println("String_Node_Str" + mUpload);
  }
  if (upload.isHashInAccount()) {
    if (mDebug) {
      System.out.println("String_Node_Str" + mUpload);
    }
    Upload.Options.ActionOnInAccount actionOnInAccount=upload.getOptions().getActionOnInAccount();
switch (actionOnInAccount) {
case UPLOAD_ALWAYS:
      doInstantUpload(upload);
    break;
case UPLOAD_IF_NOT_IN_FOLDER:
  if (upload.isHashInFolder()) {
    doInstantUpload(upload);
  }
 else {
    if (mListener != null) {
      mListener.uploadFinished(upload,upload.getDuplicateQuickKey());
    }
  }
break;
case DO_NOT_UPLOAD:
default :
if (mListener != null) {
mListener.uploadFinished(upload,upload.getDuplicateQuickKey());
}
break;
}
return;
}
 else {
if (mDebug) {
System.out.println("String_Node_Str" + mUpload);
}
}
if (upload.isHashInMediaFire()) {
if (mDebug) {
System.out.println("String_Node_Str" + mUpload);
}
doInstantUpload(upload);
}
 else {
if (mDebug) {
System.out.println("String_Node_Str" + mUpload);
}
doResumableUpload(upload);
}
}

Fixed version (ground truth):
void checkFinished(Upload upload){
  if (mDebug) {
    System.out.println("String_Node_Str" + mUpload);
  }
  if (upload.isHashInAccount()) {
    if (mDebug) {
      System.out.println("String_Node_Str" + mUpload);
    }
    Upload.Options.ActionOnInAccount actionOnInAccount=upload.getOptions().getActionOnInAccount();
switch (actionOnInAccount) {
case UPLOAD_ALWAYS:
      doInstantUpload(upload);
    break;
case UPLOAD_IF_NOT_IN_FOLDER:
  if (!upload.isHashInFolder()) {
    doInstantUpload(upload);
  }
 else {
    if (mListener != null) {
      mListener.uploadFinished(upload,upload.getDuplicateQuickKey());
    }
  }
break;
case DO_NOT_UPLOAD:
default :
if (mListener != null) {
mListener.uploadFinished(upload,upload.getDuplicateQuickKey());
}
break;
}
return;
}
 else {
if (mDebug) {
System.out.println("String_Node_Str" + mUpload);
}
}
if (upload.isHashInMediaFire()) {
if (mDebug) {
System.out.println("String_Node_Str" + mUpload);
}
doInstantUpload(upload);
}
 else {
if (mDebug) {
System.out.println("String_Node_Str" + mUpload);
}
doResumableUpload(upload);
}
}
Program: 36799
Project: 36799
Buggy source:
private ActionToken createActionToken(Class<? extends ActionToken> clazz,GetActionTokenResponse getActionTokenResponse,Request request){
  if (getActionTokenResponse == null) {
    return null;
  }
  if (getActionTokenResponse.hasError()) {
    return null;
  }
  String tokenString=getActionTokenResponse.getActionToken();
  long tokenExpiry;
  if (request.getQueryParameters().containsKey("String_Node_Str")) {
    Object lifeSpanParam=request.getQueryParameters().get("String_Node_Str");
    String lifeSpanParamAsString=String.valueOf(lifeSpanParam);
    tokenExpiry=Long.valueOf(lifeSpanParamAsString);
  }
 else {
    tokenExpiry=0;
  }
  if (clazz == ImageActionToken.class) {
    return new ImageActionToken(tokenString,tokenExpiry);
  }
  if (clazz == UploadActionToken.class) {
    return new UploadActionToken(tokenString,tokenExpiry);
  }
  return null;
}

Fixed version (ground truth):
private ActionToken createActionToken(Class<? extends ActionToken> clazz,GetActionTokenResponse getActionTokenResponse,Request request){
  if (getActionTokenResponse == null) {
    return null;
  }
  if (getActionTokenResponse.hasError()) {
    return null;
  }
  String tokenString=getActionTokenResponse.getActionToken();
  long tokenExpiry;
  if (request.getQueryParameters().containsKey("String_Node_Str")) {
    Object lifeSpanParam=request.getQueryParameters().get("String_Node_Str");
    String lifeSpanParamAsString=String.valueOf(lifeSpanParam);
    tokenExpiry=Long.valueOf(lifeSpanParamAsString);
  }
 else {
    tokenExpiry=0;
  }
  int multiplier=60 * 1000;
  tokenExpiry*=multiplier;
  if (clazz == ImageActionToken.class) {
    return new ImageActionToken(tokenString,tokenExpiry);
  }
  if (clazz == UploadActionToken.class) {
    return new UploadActionToken(tokenString,tokenExpiry);
  }
  return null;
}
Program: 36800
Project: 36800
Buggy source:
private void pollUploadFinished(PollResponse pollResponse) throws IOException, NoSuchAlgorithmException {
  MFConfiguration.getStaticMFLogger().w(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().w(TAG,"String_Node_Str" + pollResponse.getDoUpload().getStatusCode().toString() + "String_Node_Str");
    startOrRestartUpload();
  }
}

Fixed version (ground truth):
private void pollUploadFinished(PollResponse pollResponse) throws IOException, NoSuchAlgorithmException {
  MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str");
  PollResponse.DoUpload doUpload=pollResponse.getDoUpload();
  PollResponse.Status pollStatusCode=doUpload.getStatusCode();
  PollResponse.Result pollResultCode=doUpload.getResultCode();
  PollResponse.FileError pollFileErrorCode=doUpload.getFileErrorCode();
  MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str" + pollStatusCode.toString());
  MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str" + pollResultCode.toString());
  MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str" + pollFileErrorCode.toString());
  if (pollStatusCode == PollResponse.Status.NO_MORE_REQUESTS_FOR_THIS_KEY && pollResultCode == PollResponse.Result.SUCCESS && pollFileErrorCode == PollResponse.FileError.NO_ERROR) {
    MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str");
    notifyUploadListenerCompleted();
  }
 else   if (pollStatusCode != PollResponse.Status.NO_MORE_REQUESTS_FOR_THIS_KEY && pollResultCode == PollResponse.Result.SUCCESS && pollFileErrorCode == PollResponse.FileError.NO_ERROR) {
    MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str" + PollResponse.Status.NO_MORE_REQUESTS_FOR_THIS_KEY + "String_Node_Str"+ pollStatusCode.toString()+ "String_Node_Str");
    startOrRestartUpload();
  }
 else {
    MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str");
    notifyUploadListenerCancelled();
  }
}
Program: 36801
Project: 36801
Buggy source:
@Override public MFResponse doRequest(final MFRequester mfRequester){
  MFConfiguration.getStaticMFLogger().v(TAG,"String_Node_Str");
  MFResponse mfResponse=null;
  try {
    mfHttpClientSetup.prepareMFRequestForHttpClient(mfRequester);
    mfResponse=mfHttpClient.sendRequest(mfRequester);
  }
 catch (  UnsupportedEncodingException e) {
    e.printStackTrace();
  }
 finally {
    final MFResponse finalMfResponse=mfResponse;
    Thread thread=new Thread(new Runnable(){
      @Override public void run(){
        mfHttpClientCleanup.returnToken(mfRequester,finalMfResponse);
      }
    }
);
    thread.start();
  }
  return mfResponse;
}

Fixed version (ground truth):
@Override public MFResponse doRequest(final MFRequester mfRequester){
  MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str");
  MFResponse mfResponse=null;
  try {
    mfHttpClientSetup.prepareMFRequestForHttpClient(mfRequester);
    mfResponse=mfHttpClient.sendRequest(mfRequester);
    final MFResponse finalMfResponse=mfResponse;
    Thread thread=new Thread(new Runnable(){
      @Override public void run(){
        try {
          mfHttpClientCleanup.returnToken(mfRequester,finalMfResponse);
        }
 catch (        MFHttpException e) {
          MFConfiguration.getStaticMFLogger().e(TAG,e.getMessage(),e);
        }
      }
    }
);
    thread.start();
  }
 catch (  UnsupportedEncodingException e) {
    return null;
  }
catch (  MFHttpException e) {
    return null;
  }
  return mfResponse;
}
Program: 36802
Project: 36802
Buggy source:
@Override public void run(){
  mfHttpClientCleanup.returnToken(mfRequester,finalMfResponse);
}

Fixed version (ground truth):
@Override public void run(){
  try {
    mfHttpClientCleanup.returnToken(mfRequester,finalMfResponse);
  }
 catch (  MFHttpException e) {
    MFConfiguration.getStaticMFLogger().e(TAG,e.getMessage(),e);
  }
}
Program: 36803
Project: 36803
Buggy source:
protected final String urlEncodedQueryValue(String value) throws UnsupportedEncodingException {
  return URLEncoder.encode(value,"String_Node_Str");
}

Fixed version (ground truth):
protected final String urlEncodedQueryValue(String value) throws UnsupportedEncodingException {
  if (value == null) {
    return null;
  }
  return URLEncoder.encode(value,"String_Node_Str");
}
Program: 36804
Project: 36804
Buggy source:
protected final String makeQueryString(Map<String,String> requestParameters,boolean urlEncode) throws UnsupportedEncodingException {
  StringBuilder stringBuilder=new StringBuilder();
  for (  String key : requestParameters.keySet()) {
    stringBuilder.append("String_Node_Str");
    stringBuilder.append(key);
    stringBuilder.append("String_Node_Str");
    if (urlEncode) {
      stringBuilder.append(urlEncodedQueryValue(requestParameters.get(key)));
    }
 else {
      stringBuilder.append(requestParameters.get(key));
    }
  }
  String queryString=stringBuilder.toString().substring(1);
  return queryString;
}

Fixed version (ground truth):
protected final String makeQueryString(Map<String,String> requestParameters,boolean urlEncode) throws UnsupportedEncodingException {
  MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str" + urlEncode + "String_Node_Str");
  StringBuilder stringBuilder=new StringBuilder();
  for (  String key : requestParameters.keySet()) {
    stringBuilder.append("String_Node_Str");
    stringBuilder.append(key);
    stringBuilder.append("String_Node_Str");
    if (urlEncode) {
      stringBuilder.append(urlEncodedQueryValue(requestParameters.get(key)));
    }
 else {
      stringBuilder.append(requestParameters.get(key));
    }
  }
  String queryString=stringBuilder.toString().substring(1);
  return queryString;
}
Program: 36805
Project: 36805
Buggy source:
protected final String makeUrlAttachableQueryString(String queryString){
  StringBuilder stringBuilder=new StringBuilder();
  stringBuilder.append("String_Node_Str");
  stringBuilder.append(queryString);
  return stringBuilder.toString();
}

Fixed version (ground truth):
protected final String makeUrlAttachableQueryString(String queryString){
  MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str");
  StringBuilder stringBuilder=new StringBuilder();
  stringBuilder.append("String_Node_Str");
  stringBuilder.append(queryString);
  return stringBuilder.toString();
}
Program: 36806
Project: 36806
Buggy source:
protected final String makeBaseUrl(MFRequester mfRequester){
  String scheme=mfRequester.getProtocol().getScheme();
  String host=mfRequester.getHost().getSubDomainAndHostName();
  String uri=mfRequester.getUri();
  StringBuilder stringBuilder=new StringBuilder();
  stringBuilder.append(scheme);
  stringBuilder.append(host);
  stringBuilder.append(uri);
  return stringBuilder.toString();
}

Fixed version (ground truth):
protected final String makeBaseUrl(MFRequester mfRequester){
  MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str");
  String scheme=mfRequester.getProtocol().getScheme();
  String host=mfRequester.getHost().getSubDomainAndHostName();
  String uri=mfRequester.getUri();
  StringBuilder stringBuilder=new StringBuilder();
  stringBuilder.append(scheme);
  stringBuilder.append(host);
  stringBuilder.append(uri);
  return stringBuilder.toString();
}
Program: 36807
Project: 36807
Buggy source:
private MFResponse getResponseFromStream(URLConnection connection,MFRequester mfRequester) throws IOException {
  int status=((HttpURLConnection)connection).getResponseCode();
  MFResponse mfResponse;
  if (status / 100 != 2) {
    MFConfiguration.getStaticMFLogger().v(TAG,"String_Node_Str");
    BufferedInputStream bufferedInputStream=new BufferedInputStream(((HttpURLConnection)connection).getErrorStream());
    byte[] body=readStream(bufferedInputStream);
    mfResponse=new MFResponse(status,new Hashtable<String,List<String>>(),body,mfRequester);
  }
 else {
    MFConfiguration.getStaticMFLogger().v(TAG,"String_Node_Str");
    BufferedInputStream bufferedInputStream=new BufferedInputStream(connection.getInputStream());
    byte[] body=readStream(bufferedInputStream);
    mfResponse=new MFResponse(status,connection.getHeaderFields(),body,mfRequester);
  }
  return mfResponse;
}

Fixed version (ground truth):
private MFResponse getResponseFromStream(URLConnection connection,MFRequester mfRequester) throws IOException {
  MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str");
  int status=((HttpURLConnection)connection).getResponseCode();
  MFResponse mfResponse;
  if (status / 100 != 2) {
    MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str");
    BufferedInputStream bufferedInputStream=new BufferedInputStream(((HttpURLConnection)connection).getErrorStream());
    byte[] body=readStream(bufferedInputStream);
    mfResponse=new MFResponse(status,new Hashtable<String,List<String>>(),body,mfRequester);
  }
 else {
    MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str");
    BufferedInputStream bufferedInputStream=new BufferedInputStream(connection.getInputStream());
    byte[] body=readStream(bufferedInputStream);
    mfResponse=new MFResponse(status,connection.getHeaderFields(),body,mfRequester);
  }
  return mfResponse;
}
Program: 36808
Project: 36808
Buggy source:
private HttpURLConnection createHttpConnection(MFRequester mfRequester) throws IOException, NoSuchAlgorithmException, KeyManagementException {
  MFConfiguration.getStaticMFLogger().v(TAG,"String_Node_Str" + mfRequester.getProtocol() + "String_Node_Str");
  URL url=makeFullUrl(mfRequester);
  MFConfiguration.getStaticMFLogger().v(TAG,"String_Node_Str" + url.toString());
  URLConnection connection;
switch (mfRequester.getProtocol()) {
case HTTP:
    connection=url.openConnection();
  setConnectionParameters(connection,mfRequester);
return (HttpURLConnection)connection;
case HTTPS:
TrustManager[] trustAllCerts=new TrustManager[]{new X509TrustManager(){
public java.security.cert.X509Certificate[] getAcceptedIssuers(){
  return null;
}
public void checkClientTrusted(X509Certificate[] certs,String authType){
}
public void checkServerTrusted(X509Certificate[] certs,String authType){
}
}
};
SSLContext sc=SSLContext.getInstance("String_Node_Str");
sc.init(null,trustAllCerts,new java.security.SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
HostnameVerifier allHostsValid=new HostnameVerifier(){
public boolean verify(String hostname,SSLSession session){
return true;
}
}
;
HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid);
connection=url.openConnection();
setConnectionParameters(connection,mfRequester);
return (HttpsURLConnection)connection;
default :
throw new IllegalStateException("String_Node_Str");
}
}

Fixed version (ground truth):
private HttpURLConnection createHttpConnection(MFRequester mfRequester) throws IOException, NoSuchAlgorithmException, KeyManagementException {
  MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str" + mfRequester.getProtocol() + "String_Node_Str");
  URL url=makeFullUrl(mfRequester);
  MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str" + url.toString());
  URLConnection connection;
switch (mfRequester.getProtocol()) {
case HTTP:
    connection=url.openConnection();
  setConnectionParameters(connection,mfRequester);
return (HttpURLConnection)connection;
case HTTPS:
TrustManager[] trustAllCerts=new TrustManager[]{new X509TrustManager(){
public java.security.cert.X509Certificate[] getAcceptedIssuers(){
  return null;
}
public void checkClientTrusted(X509Certificate[] certs,String authType){
}
public void checkServerTrusted(X509Certificate[] certs,String authType){
}
}
};
SSLContext sc=SSLContext.getInstance("String_Node_Str");
sc.init(null,trustAllCerts,new java.security.SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
HostnameVerifier allHostsValid=new HostnameVerifier(){
public boolean verify(String hostname,SSLSession session){
return true;
}
}
;
HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid);
connection=url.openConnection();
setConnectionParameters(connection,mfRequester);
return (HttpsURLConnection)connection;
default :
throw new IllegalStateException("String_Node_Str");
}
}
Program: 36809
Project: 36809
Buggy source:
private void setConnectionParameters(URLConnection connection,MFRequester mfRequester){
  if (mfRequester.isQueryPostable() || mfRequester.getPayload() != null) {
    connection.setDoOutput(true);
  }
 else {
  }
  connection.setConnectTimeout(connectionTimeout);
  connection.setReadTimeout(readTimeout);
  if (mfRequester.getHeaders() != null) {
    for (    String key : mfRequester.getHeaders().keySet()) {
      connection.addRequestProperty(key,mfRequester.getHeaders().get(key));
    }
  }
}

Fixed version (ground truth):
private void setConnectionParameters(URLConnection connection,MFRequester mfRequester){
  MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str");
  if (mfRequester.isQueryPostable() || mfRequester.getPayload() != null) {
    connection.setDoOutput(true);
  }
 else {
  }
  connection.setConnectTimeout(connectionTimeout);
  connection.setReadTimeout(readTimeout);
  if (mfRequester.getHeaders() != null) {
    for (    String key : mfRequester.getHeaders().keySet()) {
      connection.addRequestProperty(key,mfRequester.getHeaders().get(key));
    }
  }
}
Program: 36810
Project: 36810
Buggy source:
private URL makeFullUrl(MFRequester mfRequester) throws MalformedURLException, UnsupportedEncodingException {
  StringBuilder stringBuilder=new StringBuilder();
  stringBuilder.append(makeBaseUrl(mfRequester));
  if (!mfRequester.isQueryPostable()) {
    String queryString=makeQueryString(mfRequester.getRequestParameters());
    queryString=makeUrlAttachableQueryString(queryString);
    stringBuilder.append(queryString);
  }
  return new URL(stringBuilder.toString());
}

Fixed version (ground truth):
private URL makeFullUrl(MFRequester mfRequester) throws MalformedURLException, UnsupportedEncodingException {
  MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str");
  StringBuilder stringBuilder=new StringBuilder();
  stringBuilder.append(makeBaseUrl(mfRequester));
  if (!mfRequester.isQueryPostable()) {
    String queryString=makeQueryString(mfRequester.getRequestParameters());
    queryString=makeUrlAttachableQueryString(queryString);
    stringBuilder.append(queryString);
  }
  return new URL(stringBuilder.toString());
}
Program: 36811
Project: 36811
Buggy source:
private byte[] readStream(InputStream inputStream) throws IOException {
  if (inputStream == null) {
    return null;
  }
  byte[] buffer=new byte[1024];
  int count;
  ByteArrayOutputStream outputStream=new ByteArrayOutputStream(1024);
  while ((count=inputStream.read(buffer)) != -1) {
    outputStream.write(buffer,0,count);
  }
  inputStream.close();
  byte[] bytes=outputStream.toByteArray();
  outputStream.close();
  return bytes;
}

Fixed version (ground truth):
private byte[] readStream(InputStream inputStream) throws IOException {
  MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str");
  if (inputStream == null) {
    return null;
  }
  byte[] buffer=new byte[1024];
  int count;
  ByteArrayOutputStream outputStream=new ByteArrayOutputStream(1024);
  while ((count=inputStream.read(buffer)) != -1) {
    outputStream.write(buffer,0,count);
  }
  inputStream.close();
  byte[] bytes=outputStream.toByteArray();
  outputStream.close();
  return bytes;
}
Program: 36812
Project: 36812
Buggy source:
public MFResponse sendRequest(MFRequester mfRequester){
  MFConfiguration.getStaticMFLogger().v(TAG,"String_Node_Str");
  URLConnection connection=null;
  MFResponse mfResponse=null;
  try {
    connection=createHttpConnection(mfRequester);
    postData(mfRequester,connection);
    mfResponse=getResponseFromStream(connection,mfRequester);
    MFConfiguration.getStaticMFLogger().v(TAG,"String_Node_Str" + mfResponse.getResponseAsString());
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  NoSuchAlgorithmException e) {
    e.printStackTrace();
  }
catch (  KeyManagementException e) {
    e.printStackTrace();
  }
 finally {
    if (connection != null) {
      ((HttpURLConnection)connection).disconnect();
    }
  }
  return mfResponse;
}

Fixed version (ground truth):
public MFResponse sendRequest(MFRequester mfRequester){
  MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str");
  URLConnection connection=null;
  MFResponse mfResponse=null;
  try {
    connection=createHttpConnection(mfRequester);
    postData(mfRequester,connection);
    mfResponse=getResponseFromStream(connection,mfRequester);
    MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str" + mfResponse.getResponseAsString());
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  NoSuchAlgorithmException e) {
    e.printStackTrace();
  }
catch (  KeyManagementException e) {
    e.printStackTrace();
  }
 finally {
    if (connection != null) {
      ((HttpURLConnection)connection).disconnect();
    }
  }
  return mfResponse;
}
Program: 36813
Project: 36813
Buggy source:
private void postData(MFRequester mfRequester,URLConnection connection) throws IOException {
  byte[] payload=null;
  if (mfRequester.isQueryPostable()) {
    payload=makeQueryString(mfRequester.getRequestParameters()).getBytes();
  }
 else   if (mfRequester.getPayload() != null) {
    payload=mfRequester.getPayload();
  }
  if (payload != null) {
    connection.addRequestProperty("String_Node_Str",String.valueOf(payload.length));
    connection.getOutputStream().write(payload);
  }
}

Fixed version (ground truth):
private void postData(MFRequester mfRequester,URLConnection connection) throws IOException {
  MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str");
  byte[] payload=null;
  if (mfRequester.isQueryPostable()) {
    String stringPayload=makeQueryString(mfRequester.getRequestParameters());
    MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str" + stringPayload);
    payload=stringPayload.getBytes();
  }
 else   if (mfRequester.getPayload() != null) {
    payload=mfRequester.getPayload();
  }
  if (payload != null) {
    connection.addRequestProperty("String_Node_Str",String.valueOf(payload.length));
    connection.getOutputStream().write(payload);
  }
}
Program: 36814
Project: 36814
Buggy source:
public MFActionToken createActionToken(MFActionToken.Type type,GetActionTokenResponse getActionTokenResponse,MFRequester mfRequester){
  MFConfiguration.getStaticMFLogger().v(TAG,"String_Node_Str");
  if (getActionTokenResponse == null) {
    MFConfiguration.getStaticMFLogger().v(TAG,"String_Node_Str");
    return null;
  }
  if (getActionTokenResponse.hasError()) {
    MFConfiguration.getStaticMFLogger().v(TAG,"String_Node_Str");
    return null;
  }
  String tokenString=getActionTokenResponse.getActionToken();
  long tokenExpiry;
  if (mfRequester.getRequestParameters().containsKey("String_Node_Str")) {
    tokenExpiry=Long.valueOf(mfRequester.getRequestParameters().get("String_Node_Str"));
  }
 else {
    tokenExpiry=0;
  }
  MFActionToken actionToken=new MFActionToken(tokenString,type,tokenExpiry);
  MFConfiguration.getStaticMFLogger().v(TAG,"String_Node_Str" + actionToken.toString());
  return actionToken;
}

Fixed version (ground truth):
public MFActionToken createActionToken(MFActionToken.Type type,GetActionTokenResponse getActionTokenResponse,MFRequester mfRequester){
  MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str");
  if (getActionTokenResponse == null) {
    MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str");
    return null;
  }
  if (getActionTokenResponse.hasError()) {
    MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str");
    return null;
  }
  String tokenString=getActionTokenResponse.getActionToken();
  long tokenExpiry;
  if (mfRequester.getRequestParameters().containsKey("String_Node_Str")) {
    tokenExpiry=Long.valueOf(mfRequester.getRequestParameters().get("String_Node_Str"));
  }
 else {
    tokenExpiry=0;
  }
  MFActionToken actionToken=new MFActionToken(tokenString,type,tokenExpiry);
  MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str" + actionToken.toString());
  return actionToken;
}
Program: 36815
Project: 36815
Buggy source:
public MFSessionToken createNewSessionToken(GetSessionTokenResponse getSessionTokenResponse){
  MFConfiguration.getStaticMFLogger().v(TAG,"String_Node_Str");
  if (getSessionTokenResponse == null) {
    MFConfiguration.getStaticMFLogger().v(TAG,"String_Node_Str");
    return null;
  }
  if (getSessionTokenResponse.hasError()) {
    MFConfiguration.getStaticMFLogger().v(TAG,"String_Node_Str");
    return null;
  }
  String tokenString=getSessionTokenResponse.getSessionToken();
  String secretKey=getSessionTokenResponse.getSecretKey();
  String time=getSessionTokenResponse.getTime();
  String pkey=getSessionTokenResponse.getPkey();
  String ekey=getSessionTokenResponse.getEkey();
  MFSessionToken mfSessionToken=new MFSessionToken(tokenString,secretKey,time,pkey,ekey);
  MFConfiguration.getStaticMFLogger().v(TAG,"String_Node_Str" + mfSessionToken.toString());
  return mfSessionToken;
}

Fixed version (ground truth):
public MFSessionToken createNewSessionToken(GetSessionTokenResponse getSessionTokenResponse) throws MFHttpException {
  MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str");
  if (getSessionTokenResponse == null) {
    MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str");
    return null;
  }
  if (getSessionTokenResponse.hasError()) {
    MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str");
    throw new MFHttpException("String_Node_Str" + getSessionTokenResponse.getMessage());
  }
  String tokenString=getSessionTokenResponse.getSessionToken();
  String secretKey=getSessionTokenResponse.getSecretKey();
  String time=getSessionTokenResponse.getTime();
  String pkey=getSessionTokenResponse.getPkey();
  String ekey=getSessionTokenResponse.getEkey();
  MFSessionToken mfSessionToken=new MFSessionToken(tokenString,secretKey,time,pkey,ekey);
  MFConfiguration.getStaticMFLogger().w(TAG,"String_Node_Str" + mfSessionToken.toString());
  return mfSessionToken;
}
Program: 36817
Project: 36817
Buggy source:
@Override protected void doUploadProcess(){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  Thread.currentThread().setPriority(3);
  String filename;
  try {
    filename=URLEncoder.encode(uploadItem.getFileName(),"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str" + e);
    notifyListenerException(e);
    return;
  }
  Map<String,String> keyValue=generateRequestParameters(filename);
  MFRequest mfRequest=new MFRequest(MFHost.LIVE_HTTP,MFApi.UPLOAD_INSTANT,keyValue);
  MFHttpRunner.RunnerHolder runnerHolder=mfTokenFarm.getMfHttpRunner().doRequest(mfRequest);
  MFResponse receivedMFResponse=runnerHolder.getMfResponse();
  InstantResponse response=receivedMFResponse.getResponseObject(InstantResponse.class);
  if (response == null) {
    notifyListenerLostConnection();
    return;
  }
  if (response.getErrorCode() != ApiResponse.ResponseCode.NO_ERROR) {
    notifyListenerCancelled(response);
    return;
  }
  if (!response.getQuickkey().isEmpty()) {
    notifyListenerCompleted(response);
  }
 else {
    notifyListenerCancelled(response);
  }
}

Fixed version (ground truth):
@Override protected void doUploadProcess(){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  String filename;
  try {
    filename=URLEncoder.encode(uploadItem.getFileName(),"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str" + e);
    notifyListenerException(e);
    return;
  }
  Map<String,String> keyValue=generateRequestParameters(filename);
  MFRequest mfRequest=new MFRequest(MFHost.LIVE_HTTP,MFApi.UPLOAD_INSTANT,keyValue);
  MFHttpRunner.RunnerHolder runnerHolder=mfTokenFarm.getMfHttpRunner().doRequest(mfRequest);
  MFResponse receivedMFResponse=runnerHolder.getMfResponse();
  InstantResponse response=receivedMFResponse.getResponseObject(InstantResponse.class);
  if (response == null) {
    notifyListenerLostConnection();
    return;
  }
  if (response.getErrorCode() != ApiResponse.ResponseCode.NO_ERROR) {
    notifyListenerCancelled(response);
    return;
  }
  if (!response.getQuickkey().isEmpty()) {
    notifyListenerCompleted(response);
  }
 else {
    notifyListenerCancelled(response);
  }
}
Program: 36819
Project: 36819
Buggy source:
private MFConfiguration(MFConfigurationBuilder mfConfigurationBuilder){
  this.httpReadTimeout=mfConfigurationBuilder.httpReadTimeout;
  this.httpConnectionTimeout=mfConfigurationBuilder.httpConnectionTimeout;
  this.minimumSessionTokens=mfConfigurationBuilder.minimumSessionTokens;
  this.maximumSessionTokens=mfConfigurationBuilder.maximumSessionTokens;
  this.httpPoolSize=mfConfigurationBuilder.httpPoolSize;
  this.appId=mfConfigurationBuilder.appId;
  this.apiKey=mfConfigurationBuilder.apiKey;
  this.mfLogger=mfConfigurationBuilder.mfLogger;
  this.mfCredentials=mfConfigurationBuilder.mfCredentials;
  this.mfExecutorService=mfConfigurationBuilder.mfExecutorService;
}

Fixed version (ground truth):
private MFConfiguration(MFConfigurationBuilder mfConfigurationBuilder){
  this.httpReadTimeout=mfConfigurationBuilder.httpReadTimeout;
  this.httpConnectionTimeout=mfConfigurationBuilder.httpConnectionTimeout;
  this.minimumSessionTokens=mfConfigurationBuilder.minimumSessionTokens;
  this.maximumSessionTokens=mfConfigurationBuilder.maximumSessionTokens;
  this.httpPoolSize=mfConfigurationBuilder.httpPoolSize;
  this.appId=mfConfigurationBuilder.appId;
  this.apiKey=mfConfigurationBuilder.apiKey;
  this.mfLogger=mfConfigurationBuilder.mfLogger;
  this.mfCredentials=mfConfigurationBuilder.mfCredentials;
  this.mfExecutorService=mfConfigurationBuilder.mfExecutorService;
  staticMFLogger=this.mfLogger;
}
Program: 36820
Project: 36820
Buggy source:
public void doRequest(MFRequest mfRequest){
  doRequest(mfRequest,null);
}

Fixed version (ground truth):
public RunnerHolder doRequest(MFRequest mfRequest){
  mfConfiguration.getMfLogger().logMessage(TAG,"String_Node_Str");
  MFResponse mfResponse=null;
  try {
    mfHttpClientSetup.prepareMFRequestForHttpClient(mfRequest);
    mfResponse=mfHttpClient.sendRequest(mfRequest);
  }
 catch (  UnsupportedEncodingException e) {
    e.printStackTrace();
  }
  mfConfiguration.getMfLogger().logApiError(TAG,mfRequest,mfResponse);
  mfHttpClientCleanup.returnToken(mfRequest,mfResponse);
  return new RunnerHolder(mfRequest,mfResponse);
}
Program: 36821
Project: 36821
Buggy source:
public int getAllItems(){
  MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
  return workQueue.size() + executor.getActiveCount();
}

Fixed version (ground truth):
public int getAllItems(){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  return workQueue.size() + executor.getActiveCount();
}
Program: 36822
Project: 36822
Buggy source:
public void setUploadListener(UploadListener uiListener){
  MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
  this.uiListener=uiListener;
}

Fixed version (ground truth):
public void setUploadListener(UploadListener uiListener){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  this.uiListener=uiListener;
}
Program: 36823
Project: 36823
Buggy source:
public void addUploadRequest(UploadItem uploadItem){
  MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
  if (uploadItem == null) {
    MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
    return;
  }
  if (uploadItem.getFileData() == null || uploadItem.getFileData().getFilePath() == null || uploadItem.getFileData().getFilePath().isEmpty() || uploadItem.getFileData().getFileHash().isEmpty() || uploadItem.getFileData().getFileSize() == 0) {
    MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
    return;
  }
  if (uploadItem.getUploadAttemptCount() < MAX_UPLOAD_ATTEMPTS) {
    CheckProcess process=new CheckProcess(mfTokenFarm,this,uploadItem);
    executor.execute(process);
  }
}

Fixed version (ground truth):
public void addUploadRequest(UploadItem uploadItem){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  if (uploadItem == null) {
    MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
    return;
  }
  if (uploadItem.getFileData() == null || uploadItem.getFileData().getFilePath() == null || uploadItem.getFileData().getFilePath().isEmpty() || uploadItem.getFileData().getFileHash().isEmpty() || uploadItem.getFileData().getFileSize() == 0) {
    MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
    return;
  }
  if (uploadItem.getUploadAttemptCount() < MAX_UPLOAD_ATTEMPTS) {
    CheckProcess process=new CheckProcess(mfTokenFarm,this,uploadItem);
    executor.execute(process);
  }
}
Program: 36824
Project: 36824
Buggy source:
public void clearUploadQueue(){
  MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
  boolean isPaused=isPaused();
  if (!isPaused) {
    pause();
  }
  executor.purge();
  if (!isPaused) {
    resume();
  }
}

Fixed version (ground truth):
public void clearUploadQueue(){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  boolean isPaused=isPaused();
  if (!isPaused) {
    pause();
  }
  executor.purge();
  if (!isPaused) {
    resume();
  }
}
Program: 36825
Project: 36825
Buggy source:
protected void notifyUploadListenerCancelled(UploadItem uploadItem){
  MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
  if (uiListener != null) {
    uiListener.onCancelled(uploadItem);
  }
}

Fixed version (ground truth):
protected void notifyUploadListenerCancelled(UploadItem uploadItem){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  if (uiListener != null) {
    uiListener.onCancelled(uploadItem);
  }
}
Program: 36826
Project: 36826
Buggy source:
protected void notifyUploadListenerStarted(UploadItem uploadItem){
  MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
  if (uiListener != null) {
    uiListener.onStarted(uploadItem);
  }
}

Fixed version (ground truth):
protected void notifyUploadListenerStarted(UploadItem uploadItem){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  if (uiListener != null) {
    uiListener.onStarted(uploadItem);
  }
}
Program: 36827
Project: 36827
Buggy source:
protected void notifyUploadListenerOnProgressUpdate(UploadItem uploadItem,int chunkNumber,int numChunks){
  MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
  if (uiListener != null) {
    uiListener.onProgressUpdate(uploadItem,chunkNumber,numChunks);
  }
}

Fixed version (ground truth):
protected void notifyUploadListenerOnProgressUpdate(UploadItem uploadItem,int chunkNumber,int numChunks){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  if (uiListener != null) {
    uiListener.onProgressUpdate(uploadItem,chunkNumber,numChunks);
  }
}
Program: 36828
Project: 36828
Buggy source:
protected void notifyUploadListenerCompleted(UploadItem uploadItem){
  MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
  if (uiListener != null) {
    uiListener.onCompleted(uploadItem);
  }
}

Fixed version (ground truth):
protected void notifyUploadListenerCompleted(UploadItem uploadItem){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  if (uiListener != null) {
    uiListener.onCompleted(uploadItem);
  }
}
Program: 36829
Project: 36829
Buggy source:
public BlockingQueue<Runnable> getAllWaitingRunnables(){
  MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
  return workQueue;
}

Fixed version (ground truth):
public BlockingQueue<Runnable> getAllWaitingRunnables(){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  return workQueue;
}
Program: 36830
Project: 36830
Buggy source:
private void hashNotInAccount(UploadItem uploadItem){
  MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
  InstantProcess process=new InstantProcess(mfTokenFarm,this,uploadItem);
  Thread thread=new Thread(process);
  thread.start();
}

Fixed version (ground truth):
private void hashNotInAccount(UploadItem uploadItem){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  InstantProcess process=new InstantProcess(mfTokenFarm,this,uploadItem);
  Thread thread=new Thread(process);
  thread.start();
}
Program: 36831
Project: 36831
Buggy source:
@Override public void onCancelled(UploadItem uploadItem,ApiResponse apiResponse){
  MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
  notifyUploadListenerCancelled(uploadItem);
  if (apiResponse != null && apiResponse.hasError()) {
    addUploadRequest(uploadItem);
  }
}

Fixed version (ground truth):
@Override public void onCancelled(UploadItem uploadItem,ApiResponse apiResponse){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  notifyUploadListenerCancelled(uploadItem);
  if (apiResponse != null && apiResponse.hasError()) {
    addUploadRequest(uploadItem);
  }
}
Program: 36832
Project: 36832
Buggy source:
public void resume(){
  MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
  executor.resume();
}

Fixed version (ground truth):
public void resume(){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  executor.resume();
}
Program: 36833
Project: 36833
Buggy source:
public boolean isPaused(){
  MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
  return executor.isPaused();
}

Fixed version (ground truth):
public boolean isPaused(){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  return executor.isPaused();
}
Program: 36834
Project: 36834
Buggy source:
@Override public void onInstantCompleted(UploadItem uploadItem,InstantResponse response){
  MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
  notifyUploadListenerCompleted(uploadItem);
}

Fixed version (ground truth):
@Override public void onInstantCompleted(UploadItem uploadItem,InstantResponse response){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  notifyUploadListenerCompleted(uploadItem);
}
Program: 36835
Project: 36835
Buggy source:
@Override public void onProcessException(UploadItem uploadItem,Exception exception){
  MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
  MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str" + exception);
  if (errorTracker != null) {
    errorTracker.e(UploadManagerWorker.class.getCanonicalName(),exception);
  }
  notifyUploadListenerCancelled(uploadItem);
}

Fixed version (ground truth):
@Override public void onProcessException(UploadItem uploadItem,Exception exception){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str" + exception);
  if (errorTracker != null) {
    errorTracker.logException(UploadManagerWorker.class.getCanonicalName(),exception);
  }
  notifyUploadListenerCancelled(uploadItem);
}
Program: 36836
Project: 36836
Buggy source:
/** 
 * Pausable interface
 */
public void pause(){
  MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
  executor.pause();
}

Fixed version (ground truth):
/** 
 * Pausable interface
 */
public void pause(){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  executor.pause();
}
Program: 36837
Project: 36837
Buggy source:
@Override public void onLostConnection(UploadItem uploadItem){
  MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
  notifyUploadListenerCancelled(uploadItem);
  pause();
  addUploadRequest(uploadItem);
}

Fixed version (ground truth):
@Override public void onLostConnection(UploadItem uploadItem){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  notifyUploadListenerCancelled(uploadItem);
  pause();
  addUploadRequest(uploadItem);
}
Program: 36838
Project: 36838
Buggy source:
@Override public void onProgressUpdate(UploadItem uploadItem,int chunkNumber,int numChunks){
  MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
  notifyUploadListenerOnProgressUpdate(uploadItem,chunkNumber,numChunks);
}

Fixed version (ground truth):
@Override public void onProgressUpdate(UploadItem uploadItem,int chunkNumber,int numChunks){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  notifyUploadListenerOnProgressUpdate(uploadItem,chunkNumber,numChunks);
}
Program: 36839
Project: 36839
Buggy source:
private void hashDoesNotExist(UploadItem uploadItem,CheckResponse checkResponse){
  MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
  if (checkResponse.getResumableUpload().getUnitSize() == 0) {
    MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
    notifyUploadListenerCancelled(uploadItem);
    return;
  }
  if (checkResponse.getResumableUpload().getNumberOfUnits() == 0) {
    MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
    notifyUploadListenerCancelled(uploadItem);
    return;
  }
  if (checkResponse.getResumableUpload().areAllUnitsReady() && !uploadItem.getPollUploadKey().isEmpty()) {
    MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
    PollProcess process=new PollProcess(mfTokenFarm,this,uploadItem);
    executor.execute(process);
  }
 else {
    MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
    ResumableProcess process=new ResumableProcess(mfTokenFarm,this,uploadItem);
    executor.execute(process);
  }
}

Fixed version (ground truth):
private void hashDoesNotExist(UploadItem uploadItem,CheckResponse checkResponse){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  if (checkResponse.getResumableUpload().getUnitSize() == 0) {
    MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
    notifyUploadListenerCancelled(uploadItem);
    return;
  }
  if (checkResponse.getResumableUpload().getNumberOfUnits() == 0) {
    MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
    notifyUploadListenerCancelled(uploadItem);
    return;
  }
  if (checkResponse.getResumableUpload().areAllUnitsReady() && !uploadItem.getPollUploadKey().isEmpty()) {
    MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
    PollProcess process=new PollProcess(mfTokenFarm,this,uploadItem);
    executor.execute(process);
  }
 else {
    MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
    ResumableProcess process=new ResumableProcess(mfTokenFarm,this,uploadItem);
    executor.execute(process);
  }
}
Program: 36840
Project: 36840
Buggy source:
private void hashExists(UploadItem uploadItem,CheckResponse checkResponse){
  MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
  if (!checkResponse.isInAccount()) {
    hashNotInAccount(uploadItem);
  }
 else {
    hashInAccount(uploadItem,checkResponse);
  }
}

Fixed version (ground truth):
private void hashExists(UploadItem uploadItem,CheckResponse checkResponse){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  if (!checkResponse.isInAccount()) {
    hashNotInAccount(uploadItem);
  }
 else {
    hashInAccount(uploadItem,checkResponse);
  }
}
Program: 36841
Project: 36841
Buggy source:
@Override public void onResumableCompleted(UploadItem uploadItem,ResumableResponse response){
  MFConfiguration.getErrorTracker().i(TAG,"String_Node_Str");
  if (response != null && response.getResumableUpload().areAllUnitsReady() && !response.getDoUpload().getPollUploadKey().isEmpty()) {
    PollProcess process=new PollProcess(mfTokenFarm,this,uploadItem);
    executor.execute(process);
  }
 else {
    CheckProcess process=new CheckProcess(mfTokenFarm,this,uploadItem);
    executor.execute(process);
  }
}

Fixed version (ground truth):
@Override public void onResumableCompleted(UploadItem uploadItem,ResumableResponse response){
  MFConfiguration.getStaticMFLogger().logMessage(TAG,"String_Node_Str");
  if (response != null && response.getResumableUpload().areAllUnitsReady() && !response.getDoUpload().getPollUploadKey().isEmpty()) {
    PollProcess process=new PollProcess(mfTokenFarm,this,uploadItem);
    executor.execute(process);
  }
 else {
    CheckProcess process=new CheckProcess(mfTokenFarm,this,uploadItem);
    executor.execute(process);
  }
}