nus-yam/ex-repair huggingface dataset:
Program: 25639
Project: 25639
Buggy source:
/** 
 * Returns the cache key for this request.  By default, this is the URL.
 */
public String getCacheKey(){
  return getUrl();
}

Fixed version (ground truth):
/** 
 * Returns the cache key for this request.  By default, this is the URL.
 */
public String getCacheKey(){
  return getOriginUrl();
}
Program: 25640
Project: 25640
Buggy source:
@SuppressWarnings("String_Node_Str") static void setConnectionParametersForRequest(HttpURLConnection connection,Request<?> request) throws IOException, AuthFailureError {
switch (request.getMethod()) {
case Method.DEPRECATED_GET_OR_POST:
    byte[] postBody=request.getPostBody();
  if (postBody != null) {
    connection.setDoOutput(true);
    connection.setRequestMethod("String_Node_Str");
    connection.addRequestProperty(HEADER_CONTENT_TYPE,request.getPostBodyContentType());
    DataOutputStream out=new DataOutputStream(connection.getOutputStream());
    out.write(postBody);
    out.close();
  }
break;
case Method.GET:
connection.setRequestMethod("String_Node_Str");
break;
case Method.DELETE:
connection.setRequestMethod("String_Node_Str");
break;
case Method.POST:
connection.setRequestMethod("String_Node_Str");
addBodyIfExists(connection,request);
break;
case Method.PUT:
connection.setRequestMethod("String_Node_Str");
addBodyIfExists(connection,request);
break;
case Method.HEAD:
connection.setRequestMethod("String_Node_Str");
break;
case Method.OPTIONS:
connection.setRequestMethod("String_Node_Str");
break;
case Method.TRACE:
connection.setRequestMethod("String_Node_Str");
break;
case Method.PATCH:
addBodyIfExists(connection,request);
connection.setRequestMethod("String_Node_Str");
break;
default :
throw new IllegalStateException("String_Node_Str");
}
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") static void setConnectionParametersForRequest(HttpURLConnection connection,Request<?> request) throws IOException, AuthFailureError {
switch (request.getMethod()) {
case Method.DEPRECATED_GET_OR_POST:
    byte[] postBody=request.getPostBody();
  if (postBody != null) {
    connection.setDoOutput(true);
    connection.setRequestMethod("String_Node_Str");
    connection.addRequestProperty(HEADER_CONTENT_TYPE,request.getPostBodyContentType());
    DataOutputStream out=new DataOutputStream(connection.getOutputStream());
    out.write(postBody);
    out.close();
  }
break;
case Method.GET:
connection.setRequestMethod("String_Node_Str");
break;
case Method.DELETE:
connection.setRequestMethod("String_Node_Str");
break;
case Method.POST:
connection.setRequestMethod("String_Node_Str");
addBodyIfExists(connection,request);
break;
case Method.PUT:
connection.setRequestMethod("String_Node_Str");
addBodyIfExists(connection,request);
break;
case Method.HEAD:
connection.setRequestMethod("String_Node_Str");
break;
case Method.OPTIONS:
connection.setRequestMethod("String_Node_Str");
break;
case Method.TRACE:
connection.setRequestMethod("String_Node_Str");
break;
case Method.PATCH:
connection.setRequestMethod("String_Node_Str");
addBodyIfExists(connection,request);
break;
default :
throw new IllegalStateException("String_Node_Str");
}
}
Program: 25641
Project: 25641
Buggy source:
@SuppressWarnings("String_Node_Str") static void setConnectionParametersForRequest(HttpURLConnection connection,Request<?> request) throws IOException, AuthFailureError {
switch (request.getMethod()) {
case Method.DEPRECATED_GET_OR_POST:
    byte[] postBody=request.getPostBody();
  if (postBody != null) {
    connection.setDoOutput(true);
    connection.setRequestMethod("String_Node_Str");
    connection.addRequestProperty(HEADER_CONTENT_TYPE,request.getPostBodyContentType());
    DataOutputStream out=new DataOutputStream(connection.getOutputStream());
    out.write(postBody);
    out.close();
  }
break;
case Method.GET:
connection.setRequestMethod("String_Node_Str");
break;
case Method.DELETE:
connection.setRequestMethod("String_Node_Str");
break;
case Method.POST:
connection.setRequestMethod("String_Node_Str");
addBodyIfExists(connection,request);
break;
case Method.PUT:
connection.setRequestMethod("String_Node_Str");
addBodyIfExists(connection,request);
break;
case Method.HEAD:
connection.setRequestMethod("String_Node_Str");
break;
case Method.OPTIONS:
connection.setRequestMethod("String_Node_Str");
break;
case Method.TRACE:
connection.setRequestMethod("String_Node_Str");
break;
case Method.PATCH:
addBodyIfExists(connection,request);
connection.setRequestMethod("String_Node_Str");
break;
default :
throw new IllegalStateException("String_Node_Str");
}
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") static void setConnectionParametersForRequest(HttpURLConnection connection,Request<?> request) throws IOException, AuthFailureError {
switch (request.getMethod()) {
case Method.DEPRECATED_GET_OR_POST:
    byte[] postBody=request.getPostBody();
  if (postBody != null) {
    connection.setDoOutput(true);
    connection.setRequestMethod("String_Node_Str");
    connection.addRequestProperty(HEADER_CONTENT_TYPE,request.getPostBodyContentType());
    DataOutputStream out=new DataOutputStream(connection.getOutputStream());
    out.write(postBody);
    out.close();
  }
break;
case Method.GET:
connection.setRequestMethod("String_Node_Str");
break;
case Method.DELETE:
connection.setRequestMethod("String_Node_Str");
break;
case Method.POST:
connection.setRequestMethod("String_Node_Str");
addBodyIfExists(connection,request);
break;
case Method.PUT:
connection.setRequestMethod("String_Node_Str");
addBodyIfExists(connection,request);
break;
case Method.HEAD:
connection.setRequestMethod("String_Node_Str");
break;
case Method.OPTIONS:
connection.setRequestMethod("String_Node_Str");
break;
case Method.TRACE:
connection.setRequestMethod("String_Node_Str");
break;
case Method.PATCH:
connection.setRequestMethod("String_Node_Str");
addBodyIfExists(connection,request);
break;
default :
throw new IllegalStateException("String_Node_Str");
}
}
Program: 25642
Project: 25642
Buggy source:
@SuppressWarnings("String_Node_Str") static void setConnectionParametersForRequest(HttpURLConnection connection,Request<?> request) throws IOException, AuthFailureError {
switch (request.getMethod()) {
case Method.DEPRECATED_GET_OR_POST:
    byte[] postBody=request.getPostBody();
  if (postBody != null) {
    connection.setDoOutput(true);
    connection.setRequestMethod("String_Node_Str");
    connection.addRequestProperty(HEADER_CONTENT_TYPE,request.getPostBodyContentType());
    DataOutputStream out=new DataOutputStream(connection.getOutputStream());
    out.write(postBody);
    out.close();
  }
break;
case Method.GET:
connection.setRequestMethod("String_Node_Str");
break;
case Method.DELETE:
connection.setRequestMethod("String_Node_Str");
break;
case Method.POST:
connection.setRequestMethod("String_Node_Str");
addBodyIfExists(connection,request);
break;
case Method.PUT:
connection.setRequestMethod("String_Node_Str");
addBodyIfExists(connection,request);
break;
case Method.HEAD:
connection.setRequestMethod("String_Node_Str");
break;
case Method.OPTIONS:
connection.setRequestMethod("String_Node_Str");
break;
case Method.TRACE:
connection.setRequestMethod("String_Node_Str");
break;
case Method.PATCH:
addBodyIfExists(connection,request);
connection.setRequestMethod("String_Node_Str");
break;
default :
throw new IllegalStateException("String_Node_Str");
}
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") static void setConnectionParametersForRequest(HttpURLConnection connection,Request<?> request) throws IOException, AuthFailureError {
switch (request.getMethod()) {
case Method.DEPRECATED_GET_OR_POST:
    byte[] postBody=request.getPostBody();
  if (postBody != null) {
    connection.setDoOutput(true);
    connection.setRequestMethod("String_Node_Str");
    connection.addRequestProperty(HEADER_CONTENT_TYPE,request.getPostBodyContentType());
    DataOutputStream out=new DataOutputStream(connection.getOutputStream());
    out.write(postBody);
    out.close();
  }
break;
case Method.GET:
connection.setRequestMethod("String_Node_Str");
break;
case Method.DELETE:
connection.setRequestMethod("String_Node_Str");
break;
case Method.POST:
connection.setRequestMethod("String_Node_Str");
addBodyIfExists(connection,request);
break;
case Method.PUT:
connection.setRequestMethod("String_Node_Str");
addBodyIfExists(connection,request);
break;
case Method.HEAD:
connection.setRequestMethod("String_Node_Str");
break;
case Method.OPTIONS:
connection.setRequestMethod("String_Node_Str");
break;
case Method.TRACE:
connection.setRequestMethod("String_Node_Str");
break;
case Method.PATCH:
connection.setRequestMethod("String_Node_Str");
addBodyIfExists(connection,request);
break;
default :
throw new IllegalStateException("String_Node_Str");
}
}
Program: 25643
Project: 25643
Buggy source:
@SuppressWarnings("String_Node_Str") static void setConnectionParametersForRequest(HttpURLConnection connection,Request<?> request) throws IOException, AuthFailureError {
switch (request.getMethod()) {
case Method.DEPRECATED_GET_OR_POST:
    byte[] postBody=request.getPostBody();
  if (postBody != null) {
    connection.setDoOutput(true);
    connection.setRequestMethod("String_Node_Str");
    connection.addRequestProperty(HEADER_CONTENT_TYPE,request.getPostBodyContentType());
    DataOutputStream out=new DataOutputStream(connection.getOutputStream());
    out.write(postBody);
    out.close();
  }
break;
case Method.GET:
connection.setRequestMethod("String_Node_Str");
break;
case Method.DELETE:
connection.setRequestMethod("String_Node_Str");
break;
case Method.POST:
connection.setRequestMethod("String_Node_Str");
addBodyIfExists(connection,request);
break;
case Method.PUT:
connection.setRequestMethod("String_Node_Str");
addBodyIfExists(connection,request);
break;
case Method.HEAD:
connection.setRequestMethod("String_Node_Str");
break;
case Method.OPTIONS:
connection.setRequestMethod("String_Node_Str");
break;
case Method.TRACE:
connection.setRequestMethod("String_Node_Str");
break;
case Method.PATCH:
addBodyIfExists(connection,request);
connection.setRequestMethod("String_Node_Str");
break;
default :
throw new IllegalStateException("String_Node_Str");
}
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") static void setConnectionParametersForRequest(HttpURLConnection connection,Request<?> request) throws IOException, AuthFailureError {
switch (request.getMethod()) {
case Method.DEPRECATED_GET_OR_POST:
    byte[] postBody=request.getPostBody();
  if (postBody != null) {
    connection.setDoOutput(true);
    connection.setRequestMethod("String_Node_Str");
    connection.addRequestProperty(HEADER_CONTENT_TYPE,request.getPostBodyContentType());
    DataOutputStream out=new DataOutputStream(connection.getOutputStream());
    out.write(postBody);
    out.close();
  }
break;
case Method.GET:
connection.setRequestMethod("String_Node_Str");
break;
case Method.DELETE:
connection.setRequestMethod("String_Node_Str");
break;
case Method.POST:
connection.setRequestMethod("String_Node_Str");
addBodyIfExists(connection,request);
break;
case Method.PUT:
connection.setRequestMethod("String_Node_Str");
addBodyIfExists(connection,request);
break;
case Method.HEAD:
connection.setRequestMethod("String_Node_Str");
break;
case Method.OPTIONS:
connection.setRequestMethod("String_Node_Str");
break;
case Method.TRACE:
connection.setRequestMethod("String_Node_Str");
break;
case Method.PATCH:
connection.setRequestMethod("String_Node_Str");
addBodyIfExists(connection,request);
break;
default :
throw new IllegalStateException("String_Node_Str");
}
}
Program: 25644
Project: 25644
Buggy source:
/** 
 * Handler for when an image failed to load.
 * @param cacheKey The cache key that is associated with the image request.
 */
private void onGetImageError(String cacheKey,VolleyError error){
  BatchedImageRequest request=mInFlightRequests.remove(cacheKey);
  if (request != null) {
    batchResponse(cacheKey,request,error);
  }
}

Fixed version (ground truth):
/** 
 * Handler for when an image failed to load.
 * @param cacheKey The cache key that is associated with the image request.
 */
private void onGetImageError(String cacheKey,VolleyError error){
  BatchedImageRequest request=mInFlightRequests.remove(cacheKey);
  request.setError(error);
  if (request != null) {
    batchResponse(cacheKey,request);
  }
}
Program: 25645
Project: 25645
Buggy source:
/** 
 * Starts the runnable for batched delivery of responses if it is not already started.
 * @param cacheKey The cacheKey of the response being delivered.
 * @param request The BatchedImageRequest to be delivered.
 * @param error The volley error associated with the request (if applicable).
 */
private void batchResponse(String cacheKey,BatchedImageRequest request,final VolleyError error){
  mBatchedResponses.put(cacheKey,request);
  if (mRunnable == null) {
    mRunnable=new Runnable(){
      @Override public void run(){
        for (        BatchedImageRequest bir : mBatchedResponses.values()) {
          for (          ImageContainer container : bir.mContainers) {
            if (container.mListener == null) {
              continue;
            }
            if (error == null) {
              container.mBitmap=bir.mResponseBitmap;
              container.mListener.onResponse(container,false);
            }
 else {
              container.mListener.onErrorResponse(error);
            }
          }
        }
        mBatchedResponses.clear();
        mRunnable=null;
      }
    }
;
    mHandler.postDelayed(mRunnable,mBatchResponseDelayMs);
  }
}

Fixed version (ground truth):
/** 
 * Starts the runnable for batched delivery of responses if it is not already started.
 * @param cacheKey The cacheKey of the response being delivered.
 * @param request The BatchedImageRequest to be delivered.
 * @param error The volley error associated with the request (if applicable).
 */
private void batchResponse(String cacheKey,BatchedImageRequest request){
  mBatchedResponses.put(cacheKey,request);
  if (mRunnable == null) {
    mRunnable=new Runnable(){
      @Override public void run(){
        for (        BatchedImageRequest bir : mBatchedResponses.values()) {
          for (          ImageContainer container : bir.mContainers) {
            if (container.mListener == null) {
              continue;
            }
            if (bir.getError() == null) {
              container.mBitmap=bir.mResponseBitmap;
              container.mListener.onResponse(container,false);
            }
 else {
              container.mListener.onErrorResponse(bir.getError());
            }
          }
        }
        mBatchedResponses.clear();
        mRunnable=null;
      }
    }
;
    mHandler.postDelayed(mRunnable,mBatchResponseDelayMs);
  }
}
Program: 25646
Project: 25646
Buggy source:
/** 
 * Handler for when an image was successfully loaded.
 * @param cacheKey The cache key that is associated with the image request.
 * @param response The bitmap that was returned from the network.
 */
private void onGetImageSuccess(String cacheKey,Bitmap response){
  mCache.putBitmap(cacheKey,response);
  BatchedImageRequest request=mInFlightRequests.remove(cacheKey);
  if (request != null) {
    request.mResponseBitmap=response;
    batchResponse(cacheKey,request,null);
  }
}

Fixed version (ground truth):
/** 
 * Handler for when an image was successfully loaded.
 * @param cacheKey The cache key that is associated with the image request.
 * @param response The bitmap that was returned from the network.
 */
private void onGetImageSuccess(String cacheKey,Bitmap response){
  mCache.putBitmap(cacheKey,response);
  BatchedImageRequest request=mInFlightRequests.remove(cacheKey);
  if (request != null) {
    request.mResponseBitmap=response;
    batchResponse(cacheKey,request);
  }
}
Program: 25647
Project: 25647
Buggy source:
@Override public void run(){
  for (  BatchedImageRequest bir : mBatchedResponses.values()) {
    for (    ImageContainer container : bir.mContainers) {
      if (container.mListener == null) {
        continue;
      }
      if (error == null) {
        container.mBitmap=bir.mResponseBitmap;
        container.mListener.onResponse(container,false);
      }
 else {
        container.mListener.onErrorResponse(error);
      }
    }
  }
  mBatchedResponses.clear();
  mRunnable=null;
}

Fixed version (ground truth):
@Override public void run(){
  for (  BatchedImageRequest bir : mBatchedResponses.values()) {
    for (    ImageContainer container : bir.mContainers) {
      if (container.mListener == null) {
        continue;
      }
      if (bir.getError() == null) {
        container.mBitmap=bir.mResponseBitmap;
        container.mListener.onResponse(container,false);
      }
 else {
        container.mListener.onErrorResponse(bir.getError());
      }
    }
  }
  mBatchedResponses.clear();
  mRunnable=null;
}
Program: 25648
Project: 25648
Buggy source:
/** 
 * Handler for when an image failed to load.
 * @param cacheKey The cache key that is associated with the image request.
 */
private void onGetImageError(String cacheKey,VolleyError error){
  BatchedImageRequest request=mInFlightRequests.remove(cacheKey);
  if (request != null) {
    batchResponse(cacheKey,request,error);
  }
}

Fixed version (ground truth):
/** 
 * Handler for when an image failed to load.
 * @param cacheKey The cache key that is associated with the image request.
 */
private void onGetImageError(String cacheKey,VolleyError error){
  BatchedImageRequest request=mInFlightRequests.remove(cacheKey);
  request.setError(error);
  if (request != null) {
    batchResponse(cacheKey,request);
  }
}
Program: 25649
Project: 25649
Buggy source:
/** 
 * Starts the runnable for batched delivery of responses if it is not already started.
 * @param cacheKey The cacheKey of the response being delivered.
 * @param request The BatchedImageRequest to be delivered.
 * @param error The volley error associated with the request (if applicable).
 */
private void batchResponse(String cacheKey,BatchedImageRequest request,final VolleyError error){
  mBatchedResponses.put(cacheKey,request);
  if (mRunnable == null) {
    mRunnable=new Runnable(){
      @Override public void run(){
        for (        BatchedImageRequest bir : mBatchedResponses.values()) {
          for (          ImageContainer container : bir.mContainers) {
            if (container.mListener == null) {
              continue;
            }
            if (error == null) {
              container.mBitmap=bir.mResponseBitmap;
              container.mListener.onResponse(container,false);
            }
 else {
              container.mListener.onErrorResponse(error);
            }
          }
        }
        mBatchedResponses.clear();
        mRunnable=null;
      }
    }
;
    mHandler.postDelayed(mRunnable,mBatchResponseDelayMs);
  }
}

Fixed version (ground truth):
/** 
 * Starts the runnable for batched delivery of responses if it is not already started.
 * @param cacheKey The cacheKey of the response being delivered.
 * @param request The BatchedImageRequest to be delivered.
 * @param error The volley error associated with the request (if applicable).
 */
private void batchResponse(String cacheKey,BatchedImageRequest request){
  mBatchedResponses.put(cacheKey,request);
  if (mRunnable == null) {
    mRunnable=new Runnable(){
      @Override public void run(){
        for (        BatchedImageRequest bir : mBatchedResponses.values()) {
          for (          ImageContainer container : bir.mContainers) {
            if (container.mListener == null) {
              continue;
            }
            if (bir.getError() == null) {
              container.mBitmap=bir.mResponseBitmap;
              container.mListener.onResponse(container,false);
            }
 else {
              container.mListener.onErrorResponse(bir.getError());
            }
          }
        }
        mBatchedResponses.clear();
        mRunnable=null;
      }
    }
;
    mHandler.postDelayed(mRunnable,mBatchResponseDelayMs);
  }
}
Program: 25650
Project: 25650
Buggy source:
/** 
 * Handler for when an image was successfully loaded.
 * @param cacheKey The cache key that is associated with the image request.
 * @param response The bitmap that was returned from the network.
 */
private void onGetImageSuccess(String cacheKey,Bitmap response){
  mCache.putBitmap(cacheKey,response);
  BatchedImageRequest request=mInFlightRequests.remove(cacheKey);
  if (request != null) {
    request.mResponseBitmap=response;
    batchResponse(cacheKey,request,null);
  }
}

Fixed version (ground truth):
/** 
 * Handler for when an image was successfully loaded.
 * @param cacheKey The cache key that is associated with the image request.
 * @param response The bitmap that was returned from the network.
 */
private void onGetImageSuccess(String cacheKey,Bitmap response){
  mCache.putBitmap(cacheKey,response);
  BatchedImageRequest request=mInFlightRequests.remove(cacheKey);
  if (request != null) {
    request.mResponseBitmap=response;
    batchResponse(cacheKey,request);
  }
}
Program: 25651
Project: 25651
Buggy source:
@Override public void run(){
  for (  BatchedImageRequest bir : mBatchedResponses.values()) {
    for (    ImageContainer container : bir.mContainers) {
      if (container.mListener == null) {
        continue;
      }
      if (error == null) {
        container.mBitmap=bir.mResponseBitmap;
        container.mListener.onResponse(container,false);
      }
 else {
        container.mListener.onErrorResponse(error);
      }
    }
  }
  mBatchedResponses.clear();
  mRunnable=null;
}

Fixed version (ground truth):
@Override public void run(){
  for (  BatchedImageRequest bir : mBatchedResponses.values()) {
    for (    ImageContainer container : bir.mContainers) {
      if (container.mListener == null) {
        continue;
      }
      if (bir.getError() == null) {
        container.mBitmap=bir.mResponseBitmap;
        container.mListener.onResponse(container,false);
      }
 else {
        container.mListener.onErrorResponse(bir.getError());
      }
    }
  }
  mBatchedResponses.clear();
  mRunnable=null;
}
Program: 25652
Project: 25652
Buggy source:
@SuppressWarnings("String_Node_Str") static void setConnectionParametersForRequest(HttpURLConnection connection,Request<?> request) throws IOException, AuthFailureError {
switch (request.getMethod()) {
case Method.DEPRECATED_GET_OR_POST:
    byte[] postBody=request.getPostBody();
  if (postBody != null) {
    connection.setDoOutput(true);
    connection.setRequestMethod("String_Node_Str");
    connection.addRequestProperty(HEADER_CONTENT_TYPE,request.getPostBodyContentType());
    DataOutputStream out=new DataOutputStream(connection.getOutputStream());
    out.write(postBody);
    out.close();
  }
break;
case Method.GET:
connection.setRequestMethod("String_Node_Str");
break;
case Method.DELETE:
connection.setRequestMethod("String_Node_Str");
break;
case Method.POST:
addBodyIfExists(connection,request);
connection.setRequestMethod("String_Node_Str");
break;
case Method.PUT:
addBodyIfExists(connection,request);
connection.setRequestMethod("String_Node_Str");
break;
default :
throw new IllegalStateException("String_Node_Str");
}
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") static void setConnectionParametersForRequest(HttpURLConnection connection,Request<?> request) throws IOException, AuthFailureError {
switch (request.getMethod()) {
case Method.DEPRECATED_GET_OR_POST:
    byte[] postBody=request.getPostBody();
  if (postBody != null) {
    connection.setDoOutput(true);
    connection.setRequestMethod("String_Node_Str");
    connection.addRequestProperty(HEADER_CONTENT_TYPE,request.getPostBodyContentType());
    DataOutputStream out=new DataOutputStream(connection.getOutputStream());
    out.write(postBody);
    out.close();
  }
break;
case Method.GET:
connection.setRequestMethod("String_Node_Str");
break;
case Method.DELETE:
connection.setRequestMethod("String_Node_Str");
break;
case Method.POST:
connection.setRequestMethod("String_Node_Str");
addBodyIfExists(connection,request);
break;
case Method.PUT:
connection.setRequestMethod("String_Node_Str");
addBodyIfExists(connection,request);
break;
default :
throw new IllegalStateException("String_Node_Str");
}
}
Program: 25653
Project: 25653
Buggy source:
/** 
 * @param urlRewriter Rewriter to use for request URLs
 */
public HurlStack(UrlRewriter urlRewriter){
  mUrlRewriter=urlRewriter;
}

Fixed version (ground truth):
/** 
 * @param urlRewriter Rewriter to use for request URLs
 * @param sslSocketFactory SSL factory to use for HTTPS connections
 */
public HurlStack(UrlRewriter urlRewriter,SSLSocketFactory sslSocketFactory){
  mUrlRewriter=urlRewriter;
  mSslSocketFactory=sslSocketFactory;
}
Program: 25654
Project: 25654
Buggy source:
/** 
 * Opens an   {@link HttpURLConnection} with parameters.
 * @param url
 * @return an open connection
 * @throws IOException
 */
private HttpURLConnection openConnection(URL url,Request<?> request) throws IOException {
  HttpURLConnection connection=(HttpURLConnection)url.openConnection();
  int timeoutMs=request.getTimeoutMs();
  connection.setConnectTimeout(timeoutMs);
  connection.setReadTimeout(timeoutMs);
  connection.setUseCaches(false);
  connection.setDoInput(true);
  return connection;
}

Fixed version (ground truth):
/** 
 * Opens an   {@link HttpURLConnection} with parameters.
 * @param url
 * @return an open connection
 * @throws IOException
 */
private HttpURLConnection openConnection(URL url,Request<?> request) throws IOException {
  HttpURLConnection connection=(HttpURLConnection)url.openConnection();
  int timeoutMs=request.getTimeoutMs();
  connection.setConnectTimeout(timeoutMs);
  connection.setReadTimeout(timeoutMs);
  connection.setUseCaches(false);
  connection.setDoInput(true);
  if ("String_Node_Str".equals(url.getProtocol()) && mSslSocketFactory != null) {
    ((HttpsURLConnection)connection).setSSLSocketFactory(mSslSocketFactory);
  }
  return connection;
}
Program: 25655
Project: 25655
Buggy source:
@SuppressWarnings("String_Node_Str") static void setConnectionParametersForRequest(HttpURLConnection connection,Request<?> request) throws IOException, AuthFailureError {
switch (request.getMethod()) {
case Method.DEPRECATED_GET_OR_POST:
    byte[] postBody=request.getPostBody();
  if (postBody != null) {
    connection.setDoOutput(true);
    connection.setRequestMethod("String_Node_Str");
    connection.addRequestProperty(HEADER_CONTENT_TYPE,request.getPostBodyContentType());
    DataOutputStream out=new DataOutputStream(connection.getOutputStream());
    out.write(postBody);
    out.close();
  }
break;
case Method.GET:
connection.setRequestMethod("String_Node_Str");
break;
case Method.DELETE:
connection.setRequestMethod("String_Node_Str");
break;
case Method.POST:
addBodyIfExists(connection,request);
connection.setRequestMethod("String_Node_Str");
break;
case Method.PUT:
addBodyIfExists(connection,request);
connection.setRequestMethod("String_Node_Str");
break;
default :
throw new IllegalStateException("String_Node_Str");
}
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") static void setConnectionParametersForRequest(HttpURLConnection connection,Request<?> request) throws IOException, AuthFailureError {
switch (request.getMethod()) {
case Method.DEPRECATED_GET_OR_POST:
    byte[] postBody=request.getPostBody();
  if (postBody != null) {
    connection.setDoOutput(true);
    connection.setRequestMethod("String_Node_Str");
    connection.addRequestProperty(HEADER_CONTENT_TYPE,request.getPostBodyContentType());
    DataOutputStream out=new DataOutputStream(connection.getOutputStream());
    out.write(postBody);
    out.close();
  }
break;
case Method.GET:
connection.setRequestMethod("String_Node_Str");
break;
case Method.DELETE:
connection.setRequestMethod("String_Node_Str");
break;
case Method.POST:
connection.setRequestMethod("String_Node_Str");
addBodyIfExists(connection,request);
break;
case Method.PUT:
connection.setRequestMethod("String_Node_Str");
addBodyIfExists(connection,request);
break;
default :
throw new IllegalStateException("String_Node_Str");
}
}
Program: 25656
Project: 25656
Buggy source:
/** 
 * @param urlRewriter Rewriter to use for request URLs
 */
public HurlStack(UrlRewriter urlRewriter){
  mUrlRewriter=urlRewriter;
}

Fixed version (ground truth):
/** 
 * @param urlRewriter Rewriter to use for request URLs
 * @param sslSocketFactory SSL factory to use for HTTPS connections
 */
public HurlStack(UrlRewriter urlRewriter,SSLSocketFactory sslSocketFactory){
  mUrlRewriter=urlRewriter;
  mSslSocketFactory=sslSocketFactory;
}
Program: 25657
Project: 25657
Buggy source:
/** 
 * Opens an   {@link HttpURLConnection} with parameters.
 * @param url
 * @return an open connection
 * @throws IOException
 */
private HttpURLConnection openConnection(URL url,Request<?> request) throws IOException {
  HttpURLConnection connection=(HttpURLConnection)url.openConnection();
  int timeoutMs=request.getTimeoutMs();
  connection.setConnectTimeout(timeoutMs);
  connection.setReadTimeout(timeoutMs);
  connection.setUseCaches(false);
  connection.setDoInput(true);
  return connection;
}

Fixed version (ground truth):
/** 
 * Opens an   {@link HttpURLConnection} with parameters.
 * @param url
 * @return an open connection
 * @throws IOException
 */
private HttpURLConnection openConnection(URL url,Request<?> request) throws IOException {
  HttpURLConnection connection=(HttpURLConnection)url.openConnection();
  int timeoutMs=request.getTimeoutMs();
  connection.setConnectTimeout(timeoutMs);
  connection.setReadTimeout(timeoutMs);
  connection.setUseCaches(false);
  connection.setDoInput(true);
  if ("String_Node_Str".equals(url.getProtocol()) && mSslSocketFactory != null) {
    ((HttpsURLConnection)connection).setSSLSocketFactory(mSslSocketFactory);
  }
  return connection;
}
Program: 25658
Project: 25658
Buggy source:
private void addParallaxEffect(int scrollPosition){
  float damping=mUseParallax ? 0.5f : 1.0f;
  int dampedScroll=(int)(scrollPosition * damping);
  int offset=mLastDampedScroll - dampedScroll;
  mHeaderContainer.offsetTopAndBottom(offset);
  if (mListViewBackgroundView != null) {
    offset=mLastScrollPosition - scrollPosition;
    mListViewBackgroundView.offsetTopAndBottom(offset);
  }
  mLastScrollPosition=scrollPosition;
  mLastDampedScroll=dampedScroll;
}

Fixed version (ground truth):
private void addParallaxEffect(int scrollPosition){
  float damping=mUseParallax ? 0.5f : 1.0f;
  int dampedScroll=(int)(scrollPosition * damping);
  int offset=mLastDampedScroll - dampedScroll;
  mHeaderContainer.offsetTopAndBottom(offset);
  if (mListViewBackgroundView != null) {
    offset=mLastScrollPosition - scrollPosition;
    mListViewBackgroundView.offsetTopAndBottom(offset);
  }
  if (mFirstGlobalLayoutPerformed) {
    mLastScrollPosition=scrollPosition;
    mLastDampedScroll=dampedScroll;
  }
}
Program: 25659
Project: 25659
Buggy source:
public void apply(SherlockActivity activity){
  parseAttrs(activity);
  mInflater=LayoutInflater.from(activity);
  mActionBar=activity.getSupportActionBar();
  if (mActionBarBackgroundDrawable == null) {
    mActionBarBackgroundDrawable=activity.getResources().getDrawable(mActionBarBackgroundResId);
  }
  mActionBar.setBackgroundDrawable(mActionBarBackgroundDrawable);
  if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN) {
    mActionBarBackgroundDrawable.setCallback(mDrawableCallback);
  }
  mActionBarBackgroundDrawable.setAlpha(0);
  LayoutInflater inflater=LayoutInflater.from(activity);
  if (mContentView == null) {
    mContentView=inflater.inflate(mContentLayoutResId,null);
  }
  if (mHeaderView == null) {
    mHeaderView=inflater.inflate(mHeaderLayoutResId,mHeaderContainer,false);
  }
  ListView listView=(ListView)activity.findViewById(android.R.id.list);
  if (listView != null) {
    applyListView(activity,listView);
  }
 else {
    applyScrollView(activity);
  }
}

Fixed version (ground truth):
public void apply(SherlockActivity activity){
  parseAttrs(activity);
  mInflater=LayoutInflater.from(activity);
  mActionBar=activity.getSupportActionBar();
  if (mActionBarBackgroundDrawable == null) {
    mActionBarBackgroundDrawable=activity.getResources().getDrawable(mActionBarBackgroundResId);
  }
  mActionBar.setBackgroundDrawable(mActionBarBackgroundDrawable);
  if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN) {
    mActionBarBackgroundDrawable.setCallback(mDrawableCallback);
  }
  mActionBarBackgroundDrawable.setAlpha(0);
  LayoutInflater inflater=LayoutInflater.from(activity);
  if (mContentView == null) {
    mContentView=inflater.inflate(mContentLayoutResId,null);
  }
  if (mHeaderView == null) {
    mHeaderView=inflater.inflate(mHeaderLayoutResId,mHeaderContainer,false);
  }
  ListView listView=(ListView)mContentView.findViewById(android.R.id.list);
  if (listView != null) {
    applyListView(activity,listView);
  }
 else {
    applyScrollView(activity);
  }
}
Program: 25660
Project: 25660
Buggy source:
protected ISimpleDialogListener getDialogListener(){
  final Fragment targetFragment=getTargetFragment();
  if (targetFragment != null) {
    if (targetFragment instanceof ISimpleDialogListener) {
      return (ISimpleDialogListener)targetFragment;
    }
  }
 else {
    if (getActivity() instanceof ISimpleDialogListener) {
      return (ISimpleDialogListener)getActivity();
    }
  }
  return null;
}

Fixed version (ground truth):
protected ISimpleDialogListener getDialogListener(){
  final Fragment targetFragment=getTargetFragment();
  if (targetFragment != null) {
    if (targetFragment instanceof ISimpleDialogListener) {
      return (ISimpleDialogListener)targetFragment;
    }
  }
 else   if (getParentFragment() != null && getParentFragment() instanceof ISimpleDialogListener) {
    return (ISimpleDialogListener)getParentFragment();
  }
 else {
    if (getActivity() instanceof ISimpleDialogListener) {
      return (ISimpleDialogListener)getActivity();
    }
  }
  return null;
}
Program: 25661
Project: 25661
Buggy source:
protected ISimpleDialogCancelListener getCancelListener(){
  final Fragment targetFragment=getTargetFragment();
  if (targetFragment != null) {
    if (targetFragment instanceof ISimpleDialogCancelListener) {
      return (ISimpleDialogCancelListener)targetFragment;
    }
  }
 else {
    if (getActivity() instanceof ISimpleDialogCancelListener) {
      return (ISimpleDialogCancelListener)getActivity();
    }
  }
  return null;
}

Fixed version (ground truth):
protected ISimpleDialogCancelListener getCancelListener(){
  final Fragment targetFragment=getTargetFragment();
  if (targetFragment != null) {
    if (targetFragment instanceof ISimpleDialogCancelListener) {
      return (ISimpleDialogCancelListener)targetFragment;
    }
  }
 else   if (getParentFragment() != null && getParentFragment() instanceof ISimpleDialogCancelListener) {
    return (ISimpleDialogCancelListener)getParentFragment();
  }
 else {
    if (getActivity() instanceof ISimpleDialogCancelListener) {
      return (ISimpleDialogCancelListener)getActivity();
    }
  }
  return null;
}
Program: 25662
Project: 25662
Buggy source:
private static void init(String path){
  Util.log(null,Log.WARN,"String_Node_Str" + path);
  mSecret=Long.toHexString(new Random().nextLong());
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT)   try {
    Class<?> libcore=Class.forName("String_Node_Str");
    Field fOs=libcore.getDeclaredField("String_Node_Str");
    fOs.setAccessible(true);
    Object os=fOs.get(null);
    Method setenv=os.getClass().getMethod("String_Node_Str",String.class,String.class,boolean.class);
    setenv.setAccessible(true);
    boolean aosp=new File("String_Node_Str").exists();
    setenv.invoke(os,"String_Node_Str",Boolean.toString(aosp),false);
    Util.log(null,Log.WARN,"String_Node_Str" + aosp);
  }
 catch (  Throwable ex) {
    Util.bug(null,ex);
  }
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
    try {
      Class<?> cSystemServer=Class.forName("String_Node_Str");
      Method mMain=cSystemServer.getDeclaredMethod("String_Node_Str",String[].class);
      XposedBridge.hookMethod(mMain,new XC_MethodHook(){
        @Override protected void beforeHookedMethod(        MethodHookParam param) throws Throwable {
          PrivacyService.register(mListHookError,null,mSecret,null);
        }
      }
);
    }
 catch (    Throwable ex) {
      Util.bug(null,ex);
    }
    hookAll(null);
  }
}

Fixed version (ground truth):
private static void init(String path){
  Util.log(null,Log.WARN,"String_Node_Str" + path);
  mSecret=Long.toHexString(new Random().nextLong());
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT)   try {
    Class<?> libcore=Class.forName("String_Node_Str");
    Field fOs=libcore.getDeclaredField("String_Node_Str");
    fOs.setAccessible(true);
    Object os=fOs.get(null);
    Method setenv=os.getClass().getMethod("String_Node_Str",String.class,String.class,boolean.class);
    setenv.setAccessible(true);
    boolean aosp=new File("String_Node_Str").exists();
    setenv.invoke(os,"String_Node_Str",Boolean.toString(aosp),false);
    Util.log(null,Log.WARN,"String_Node_Str" + aosp);
  }
 catch (  Throwable ex) {
    Util.bug(null,ex);
  }
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
    try {
      Class<?> cSystemServer=Class.forName("String_Node_Str");
      Method mMain=cSystemServer.getDeclaredMethod("String_Node_Str",String[].class);
      XposedBridge.hookMethod(mMain,new XC_MethodHook(){
        @Override protected void beforeHookedMethod(        MethodHookParam param) throws Throwable {
          PrivacyService.register(mListHookError,null,mSecret,null);
        }
      }
);
    }
 catch (    Throwable ex) {
      Util.bug(null,ex);
    }
    hookAll(null);
  }
  hookAll();
}
Program: 25664
Project: 25664
Buggy source:
private int getIsolatedUid(int uid){
  if (PrivacyManager.isIsolated(uid))   try {
    Class<?> cam=Class.forName("String_Node_Str");
    Object am=cam.getMethod("String_Node_Str").invoke(null);
    Field fmIsolatedProcesses=cam.getDeclaredField("String_Node_Str");
    fmIsolatedProcesses.setAccessible(true);
    SparseArray<?> mIsolatedProcesses=(SparseArray<?>)fmIsolatedProcesses.get(am);
    Object processRecord=mIsolatedProcesses.get(uid);
    Field fInfo=processRecord.getClass().getDeclaredField("String_Node_Str");
    fInfo.setAccessible(true);
    ApplicationInfo info=(ApplicationInfo)fInfo.get(processRecord);
    Util.log(null,Log.WARN,"String_Node_Str" + uid + "String_Node_Str"+ info.uid+ "String_Node_Str"+ info.packageName);
    return info.uid;
  }
 catch (  Throwable ex) {
    Util.bug(null,ex);
  }
  return uid;
}

Fixed version (ground truth):
private int getIsolatedUid(int uid){
  if (PrivacyManager.isIsolated(uid))   try {
    Class<?> cam;
    Object am;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
      cam=mAm.getClass();
      am=mAm;
    }
 else {
      cam=Class.forName("String_Node_Str");
      am=cam.getMethod("String_Node_Str").invoke(null);
    }
    Field fmIsolatedProcesses=cam.getDeclaredField("String_Node_Str");
    fmIsolatedProcesses.setAccessible(true);
    SparseArray<?> mIsolatedProcesses=(SparseArray<?>)fmIsolatedProcesses.get(am);
    Object processRecord=mIsolatedProcesses.get(uid);
    Field fInfo=processRecord.getClass().getDeclaredField("String_Node_Str");
    fInfo.setAccessible(true);
    ApplicationInfo info=(ApplicationInfo)fInfo.get(processRecord);
    Util.log(null,Log.WARN,"String_Node_Str" + uid + "String_Node_Str"+ info.uid+ "String_Node_Str"+ info.packageName);
    return info.uid;
  }
 catch (  Throwable ex) {
    Util.bug(null,ex);
  }
  return uid;
}
Program: 25668
Project: 25668
Buggy source:
private void setSettingInternal(PSetting setting) throws RemoteException {
  try {
    SQLiteDatabase db=getDb();
    mLock.writeLock().lock();
    db.beginTransaction();
    try {
      if (setting.value == null)       db.delete(cTableSetting,"String_Node_Str",new String[]{Integer.toString(setting.uid),setting.name});
 else {
        ContentValues values=new ContentValues();
        values.put("String_Node_Str",setting.uid);
        values.put("String_Node_Str",setting.name);
        values.put("String_Node_Str",setting.value);
        db.insertWithOnConflict(cTableSetting,null,values,SQLiteDatabase.CONFLICT_REPLACE);
      }
      db.setTransactionSuccessful();
    }
  finally {
      try {
        db.endTransaction();
      }
  finally {
        mLock.writeLock().unlock();
      }
    }
    if (mUseCache) {
      CSetting key=new CSetting(setting.uid,setting.name);
      key.setValue(setting.value);
synchronized (mSettingCache) {
        if (mSettingCache.containsKey(key))         mSettingCache.remove(key);
        if (setting.value != null)         mSettingCache.put(key,key);
      }
    }
  }
 catch (  Throwable ex) {
    Util.bug(null,ex);
    throw new RemoteException(ex.toString());
  }
}

Fixed version (ground truth):
private void setSettingInternal(PSetting setting) throws RemoteException {
  try {
    SQLiteDatabase db=getDb();
    mLock.writeLock().lock();
    db.beginTransaction();
    try {
      if (setting.value == null)       db.delete(cTableSetting,"String_Node_Str",new String[]{Integer.toString(setting.uid),setting.name});
 else {
        ContentValues values=new ContentValues();
        values.put("String_Node_Str",setting.uid);
        values.put("String_Node_Str",setting.name);
        values.put("String_Node_Str",setting.value);
        db.insertWithOnConflict(cTableSetting,null,values,SQLiteDatabase.CONFLICT_REPLACE);
      }
      db.setTransactionSuccessful();
    }
  finally {
      try {
        db.endTransaction();
      }
  finally {
        mLock.writeLock().unlock();
      }
    }
    if (mUseCache) {
      CSetting key=new CSetting(setting.uid,setting.name);
      key.setValue(setting.value);
synchronized (mSettingCache) {
        if (mSettingCache.containsKey(key))         mSettingCache.remove(key);
        if (setting.value != null)         mSettingCache.put(key,key);
      }
    }
    if (setting.name.startsWith("String_Node_Str")) synchronized (mRestrictionCache) {
      mRestrictionCache.clear();
    }
  }
 catch (  Throwable ex) {
    Util.bug(null,ex);
    throw new RemoteException(ex.toString());
  }
}
Program: 25670
Project: 25670
Buggy source:
public static List<Boolean> getRestartStates(int uid,String restrictionName){
  List<Boolean> listRestartRestriction=new ArrayList<Boolean>();
  Set<String> listRestriction=new HashSet<String>();
  if (restrictionName == null)   listRestriction=mRestart.keySet();
 else   if (mRestart.keySet().contains(restrictionName))   listRestriction.add(restrictionName);
  try {
    for (    String restriction : listRestriction) {
      for (      String method : mRestart.get(restriction))       listRestartRestriction.add(getRestriction(null,uid,restriction,method,null));
    }
  }
 catch (  Throwable ex) {
    Util.bug(null,ex);
  }
  return listRestartRestriction;
}

Fixed version (ground truth):
public static List<Boolean> getRestartStates(int uid,String restrictionName){
  List<Boolean> listRestartRestriction=new ArrayList<Boolean>();
  Set<String> listRestriction=new HashSet<String>();
  if (restrictionName == null)   listRestriction=mRestart.keySet();
 else   if (mRestart.keySet().contains(restrictionName))   listRestriction.add(restrictionName);
  try {
    for (    String restriction : listRestriction) {
      for (      String method : mRestart.get(restriction))       listRestartRestriction.add(getRestrictionEx(uid,restriction,method).restricted);
    }
  }
 catch (  Throwable ex) {
    Util.bug(null,ex);
  }
  return listRestartRestriction;
}
Program: 25671
Project: 25671
Buggy source:
@Override public List<PRestriction> getRestrictionList(PRestriction selector) throws RemoteException {
  List<PRestriction> result=new ArrayList<PRestriction>();
  try {
    enforcePermission();
    if (selector.restrictionName == null)     for (    String sRestrictionName : PrivacyManager.getRestrictions()) {
      PRestriction restriction=new PRestriction(selector.uid,sRestrictionName,null,false);
      restriction.restricted=getRestriction(restriction,false,mSecret).restricted;
      result.add(restriction);
    }
 else     for (    Hook md : PrivacyManager.getHooks(selector.restrictionName)) {
      PRestriction restriction=new PRestriction(selector.uid,selector.restrictionName,md.getName(),false);
      restriction.restricted=getRestriction(restriction,false,mSecret).restricted;
      result.add(restriction);
    }
  }
 catch (  Throwable ex) {
    Util.bug(null,ex);
synchronized (mListError) {
      mListError.add(ex.toString());
      mListError.add(Log.getStackTraceString(ex));
    }
    throw new RemoteException(ex.toString());
  }
  return result;
}

Fixed version (ground truth):
@Override public List<PRestriction> getRestrictionList(PRestriction selector) throws RemoteException {
  List<PRestriction> result=new ArrayList<PRestriction>();
  try {
    enforcePermission();
    if (selector.restrictionName == null)     for (    String sRestrictionName : PrivacyManager.getRestrictions()) {
      PRestriction restriction=new PRestriction(selector.uid,sRestrictionName,null,false);
      restriction.restricted=getRestriction(restriction,false,null).restricted;
      result.add(restriction);
    }
 else     for (    Hook md : PrivacyManager.getHooks(selector.restrictionName)) {
      PRestriction restriction=new PRestriction(selector.uid,selector.restrictionName,md.getName(),false);
      restriction.restricted=getRestriction(restriction,false,null).restricted;
      result.add(restriction);
    }
  }
 catch (  Throwable ex) {
    Util.bug(null,ex);
synchronized (mListError) {
      mListError.add(ex.toString());
      mListError.add(Log.getStackTraceString(ex));
    }
    throw new RemoteException(ex.toString());
  }
  return result;
}
Program: 25672
Project: 25672
Buggy source:
@Override public void run(){
  publishProgress(++mProgressCurrent,max);
}

Fixed version (ground truth):
@Override public void run(){
  mAppAdapter.notifyDataSetChanged();
}
Program: 25673
Project: 25673
Buggy source:
@Override public void endElement(String uri,String localName,String qName){
  if (qName.equals("String_Node_Str")) {
    finishLastImport();
    for (    int uid : mListRestartUid)     mAppAdapter.setMessage(uid,getString(R.string.msg_restart));
    if (mListAbortedUid.size() > 0) {
      int uid=mListAbortedUid.get(0);
      mAppAdapter.setState(uid,STATE_FAILURE);
      mAppAdapter.setMessage(uid,getString(R.string.msg_aborted));
    }
    mAppAdapter.notifyDataSetChanged();
  }
}

Fixed version (ground truth):
@Override public void endElement(String uri,String localName,String qName){
  if (qName.equals("String_Node_Str")) {
    finishLastImport();
    for (    int uid : mListRestartUid)     mAppAdapter.setMessage(uid,getString(R.string.msg_restart));
    if (mListAbortedUid.size() > 0) {
      int uid=mListAbortedUid.get(0);
      mAppAdapter.setState(uid,STATE_FAILURE);
      mAppAdapter.setMessage(uid,getString(R.string.msg_aborted));
    }
    runOnUiThread(new Runnable(){
      @Override public void run(){
        mAppAdapter.notifyDataSetChanged();
      }
    }
);
  }
}
Program: 25674
Project: 25674
Buggy source:
@Override public void run(){
  publishProgress(++mProgressCurrent,max);
}

Fixed version (ground truth):
@Override public void run(){
  mAppAdapter.notifyDataSetChanged();
}
Program: 25675
Project: 25675
Buggy source:
@Override public void endElement(String uri,String localName,String qName){
  if (qName.equals("String_Node_Str")) {
    finishLastImport();
    for (    int uid : mListRestartUid)     mAppAdapter.setMessage(uid,getString(R.string.msg_restart));
    if (mListAbortedUid.size() > 0) {
      int uid=mListAbortedUid.get(0);
      mAppAdapter.setState(uid,STATE_FAILURE);
      mAppAdapter.setMessage(uid,getString(R.string.msg_aborted));
    }
    mAppAdapter.notifyDataSetChanged();
  }
}

Fixed version (ground truth):
@Override public void endElement(String uri,String localName,String qName){
  if (qName.equals("String_Node_Str")) {
    finishLastImport();
    for (    int uid : mListRestartUid)     mAppAdapter.setMessage(uid,getString(R.string.msg_restart));
    if (mListAbortedUid.size() > 0) {
      int uid=mListAbortedUid.get(0);
      mAppAdapter.setState(uid,STATE_FAILURE);
      mAppAdapter.setMessage(uid,getString(R.string.msg_aborted));
    }
    runOnUiThread(new Runnable(){
      @Override public void run(){
        mAppAdapter.notifyDataSetChanged();
      }
    }
);
  }
}