Program: 142324
Project: 142324
Buggy source:
public static long sendInstance(int submissionNumber,File folder,SecretKeySpec key,String url,AsyncTask listener,User user) throws FileNotFoundException {
  boolean hasListener=false;
  DataSubmissionListener myListener=null;
  if (listener instanceof DataSubmissionListener) {
    hasListener=true;
    myListener=(DataSubmissionListener)listener;
  }
  File[] files=folder.listFiles();
  if (files == null) {
    String state=Environment.getExternalStorageState();
    if (!Environment.MEDIA_MOUNTED.equals(state)) {
      throw new SessionUnavailableException("String_Node_Str");
    }
 else {
      throw new FileNotFoundException("String_Node_Str" + folder.getAbsoluteFile());
    }
  }
  long bytes=0;
  for (int j=0; j < files.length; j++) {
    boolean supported=false;
    for (    String ext : SUPPORTED_FILE_EXTS) {
      if (files[j].getName().endsWith(ext)) {
        supported=true;
        break;
      }
    }
    if (!supported) {
      continue;
    }
    bytes+=files[j].length();
    System.out.println("String_Node_Str" + files[j].getName() + "String_Node_Str"+ bytes);
  }
  if (hasListener) {
    myListener.startSubmission(submissionNumber,bytes);
  }
  HttpRequestGenerator generator;
  if (user.getUserType().equals(User.TYPE_DEMO)) {
    generator=new HttpRequestGenerator();
  }
 else {
    generator=new HttpRequestGenerator(user);
  }
  String t="String_Node_Str";
  if (files == null) {
    Log.e(t,"String_Node_Str");
    listener.cancel(true);
  }
  MultipartEntity entity=new DataSubmissionEntity(myListener,submissionNumber);
  for (int j=0; j < files.length; j++) {
    File f=files[j];
    ContentBody fb;
    if (f.getName().endsWith("String_Node_Str")) {
      if (key != null) {
        fb=new EncryptedFileBody(f,FormUploadUtil.getDecryptCipher(key),"String_Node_Str");
      }
 else {
        fb=new FileBody(f,"String_Node_Str");
      }
      entity.addPart("String_Node_Str",fb);
    }
 else     if (f.getName().endsWith("String_Node_Str")) {
      fb=new FileBody(f,"String_Node_Str");
      if (fb.getContentLength() <= MAX_BYTES) {
        entity.addPart(f.getName(),fb);
        Log.i(t,"String_Node_Str" + f.getName());
      }
 else {
        Log.i(t,"String_Node_Str" + f.getName() + "String_Node_Str");
      }
    }
 else     if (f.getName().endsWith("String_Node_Str")) {
      fb=new FileBody(f,"String_Node_Str");
      if (fb.getContentLength() <= MAX_BYTES) {
        entity.addPart(f.getName(),fb);
        Log.i(t,"String_Node_Str" + f.getName());
      }
 else {
        Log.i(t,"String_Node_Str" + f.getName() + "String_Node_Str");
      }
    }
 else     if (f.getName().endsWith("String_Node_Str")) {
      fb=new FileBody(f,"String_Node_Str");
      if (fb.getContentLength() <= MAX_BYTES) {
        entity.addPart(f.getName(),fb);
        Log.i(t,"String_Node_Str" + f.getName());
      }
 else {
        Log.i(t,"String_Node_Str" + f.getName() + "String_Node_Str");
      }
    }
 else {
      Log.w(t,"String_Node_Str" + f.getName());
    }
  }
  HttpResponse response=null;
  try {
    response=generator.postData(url,entity);
  }
 catch (  ClientProtocolException e) {
    e.printStackTrace();
    return TRANSPORT_FAILURE;
  }
catch (  IOException e) {
    e.printStackTrace();
    return TRANSPORT_FAILURE;
  }
catch (  IllegalStateException e) {
    e.printStackTrace();
    return TRANSPORT_FAILURE;
  }
  String serverLocation=null;
  Header[] h=response.getHeaders("String_Node_Str");
  if (h != null && h.length > 0) {
    serverLocation=h[0].getValue();
  }
 else {
    Log.e(t,"String_Node_Str");
  }
  int responseCode=response.getStatusLine().getStatusCode();
  Log.e(t,"String_Node_Str" + responseCode);
  ByteArrayOutputStream bos=new ByteArrayOutputStream();
  try {
    AndroidStreamUtil.writeFromInputToOutput(response.getEntity().getContent(),bos);
  }
 catch (  IllegalStateException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  System.out.println(new String(bos.toByteArray()));
  if (responseCode >= 200 && responseCode < 300) {
    return FULL_SUCCESS;
  }
 else {
    return FAILURE;
  }
}

Fixed version (ground truth):
public static long sendInstance(int submissionNumber,File folder,SecretKeySpec key,String url,AsyncTask listener,User user) throws FileNotFoundException {
  boolean hasListener=false;
  DataSubmissionListener myListener=null;
  if (listener instanceof DataSubmissionListener) {
    hasListener=true;
    myListener=(DataSubmissionListener)listener;
  }
  File[] files=folder.listFiles();
  if (files == null) {
    String state=Environment.getExternalStorageState();
    if (!Environment.MEDIA_MOUNTED.equals(state)) {
      throw new SessionUnavailableException("String_Node_Str");
    }
 else {
      throw new FileNotFoundException("String_Node_Str" + folder.getAbsoluteFile());
    }
  }
  long bytes=0;
  for (int j=0; j < files.length; j++) {
    boolean supported=false;
    for (    String ext : SUPPORTED_FILE_EXTS) {
      if (files[j].getName().endsWith(ext)) {
        supported=true;
        break;
      }
    }
    if (!supported) {
      continue;
    }
    bytes+=files[j].length();
    System.out.println("String_Node_Str" + files[j].getName() + "String_Node_Str"+ bytes);
  }
  if (hasListener) {
    myListener.startSubmission(submissionNumber,bytes);
  }
  HttpRequestGenerator generator;
  if (user.getUserType().equals(User.TYPE_DEMO)) {
    generator=new HttpRequestGenerator();
  }
 else {
    generator=new HttpRequestGenerator(user);
  }
  String t="String_Node_Str";
  if (files == null) {
    Log.e(t,"String_Node_Str");
    listener.cancel(true);
  }
  MultipartEntity entity=new DataSubmissionEntity(myListener,submissionNumber);
  for (int j=0; j < files.length; j++) {
    File f=files[j];
    ContentBody fb;
    if (f.getName().endsWith("String_Node_Str")) {
      if (key != null) {
        fb=new EncryptedFileBody(f,FormUploadUtil.getDecryptCipher(key),"String_Node_Str");
      }
 else {
        fb=new FileBody(f,"String_Node_Str");
      }
      entity.addPart("String_Node_Str",fb);
    }
 else     if (f.getName().endsWith("String_Node_Str")) {
      fb=new FileBody(f,"String_Node_Str");
      if (fb.getContentLength() <= MAX_BYTES) {
        entity.addPart(f.getName(),fb);
        Log.i(t,"String_Node_Str" + f.getName());
      }
 else {
        Log.i(t,"String_Node_Str" + f.getName() + "String_Node_Str");
      }
    }
 else     if (f.getName().endsWith("String_Node_Str")) {
      fb=new FileBody(f,"String_Node_Str");
      if (fb.getContentLength() <= MAX_BYTES) {
        entity.addPart(f.getName(),fb);
        Log.i(t,"String_Node_Str" + f.getName());
      }
 else {
        Log.i(t,"String_Node_Str" + f.getName() + "String_Node_Str");
      }
    }
 else     if (f.getName().endsWith("String_Node_Str")) {
      fb=new FileBody(f,"String_Node_Str");
      if (fb.getContentLength() <= MAX_BYTES) {
        entity.addPart(f.getName(),fb);
        Log.i(t,"String_Node_Str" + f.getName());
      }
 else {
        Log.i(t,"String_Node_Str" + f.getName() + "String_Node_Str");
      }
    }
 else {
      Log.w(t,"String_Node_Str" + f.getName());
    }
  }
  HttpResponse response=null;
  try {
    response=generator.postData(url,entity);
  }
 catch (  ClientProtocolException e) {
    System.out.println("String_Node_Str");
    e.printStackTrace();
    return TRANSPORT_FAILURE;
  }
catch (  IOException e) {
    System.out.println("String_Node_Str");
    e.printStackTrace();
    return TRANSPORT_FAILURE;
  }
catch (  IllegalStateException e) {
    System.out.println("String_Node_Str");
    e.printStackTrace();
    return TRANSPORT_FAILURE;
  }
  String serverLocation=null;
  Header[] h=response.getHeaders("String_Node_Str");
  if (h != null && h.length > 0) {
    serverLocation=h[0].getValue();
  }
 else {
    Log.e(t,"String_Node_Str");
  }
  int responseCode=response.getStatusLine().getStatusCode();
  Log.e(t,"String_Node_Str" + responseCode);
  ByteArrayOutputStream bos=new ByteArrayOutputStream();
  try {
    AndroidStreamUtil.writeFromInputToOutput(response.getEntity().getContent(),bos);
  }
 catch (  IllegalStateException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  System.out.println(new String(bos.toByteArray()));
  if (responseCode >= 200 && responseCode < 300) {
    return FULL_SUCCESS;
  }
 else {
    return FAILURE;
  }
}