Program: 142146
Project: 142146
Buggy source:
/** 
 * Add files of supported type to the multipart entity, encrypting xml files.
 * @param entity Add files to this
 * @param key    Used to encrypt xml files
 * @param files  The files to be added to the entity,
 * @return false if invalid xml files are found; otherwise true.
 * @throws FileNotFoundException Is raised when an xml doesn't exist on thefile-system
 */
private static boolean buildMultipartEntity(MultipartEntity entity,SecretKeySpec key,File[] files) throws FileNotFoundException {
  for (  File f : files) {
    ContentBody fb;
    if (f.getName().endsWith("String_Node_Str")) {
      if (key != null) {
        if (!validateSubmissionFile(f)) {
          return false;
        }
        fb=new EncryptedFileBody(f,FormUploadUtil.getDecryptCipher(key),ContentType.TEXT_XML);
      }
 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(TAG,"String_Node_Str" + f.getName());
      }
 else {
        Log.i(TAG,"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(TAG,"String_Node_Str" + f.getName());
      }
 else {
        Log.i(TAG,"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(TAG,"String_Node_Str" + f.getName());
      }
 else {
        Log.i(TAG,"String_Node_Str" + f.getName() + "String_Node_Str");
      }
    }
 else     if (isSupportedMultimediaFile(f.getName())) {
      fb=new FileBody(f,"String_Node_Str");
      if (fb.getContentLength() <= MAX_BYTES) {
        entity.addPart(f.getName(),fb);
        Log.i(TAG,"String_Node_Str" + f.getName());
      }
 else {
        Log.i(TAG,"String_Node_Str" + f.getName() + "String_Node_Str");
      }
    }
 else {
      Log.w(TAG,"String_Node_Str" + f.getName());
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Add files of supported type to the multipart entity, encrypting xml files.
 * @param entity Add files to this
 * @param key    Used to encrypt xml files
 * @param files  The files to be added to the entity,
 * @return false if invalid xml files are found; otherwise true.
 * @throws FileNotFoundException Is raised when an xml doesn't exist on thefile-system
 */
private static boolean buildMultipartEntity(MultipartEntity entity,SecretKeySpec key,File[] files) throws FileNotFoundException {
  for (  File f : files) {
    ContentBody fb;
    if (f.getName().endsWith("String_Node_Str")) {
      if (key != null) {
        if (!validateSubmissionFile(f)) {
          return false;
        }
        fb=new EncryptedFileBody(f,FormUploadUtil.getDecryptCipher(key),ContentType.TEXT_XML);
      }
 else {
        fb=new FileBody(f,ContentType.TEXT_XML,f.getName());
      }
      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(TAG,"String_Node_Str" + f.getName());
      }
 else {
        Log.i(TAG,"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(TAG,"String_Node_Str" + f.getName());
      }
 else {
        Log.i(TAG,"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(TAG,"String_Node_Str" + f.getName());
      }
 else {
        Log.i(TAG,"String_Node_Str" + f.getName() + "String_Node_Str");
      }
    }
 else     if (isSupportedMultimediaFile(f.getName())) {
      fb=new FileBody(f,"String_Node_Str");
      if (fb.getContentLength() <= MAX_BYTES) {
        entity.addPart(f.getName(),fb);
        Log.i(TAG,"String_Node_Str" + f.getName());
      }
 else {
        Log.i(TAG,"String_Node_Str" + f.getName() + "String_Node_Str");
      }
    }
 else {
      Log.w(TAG,"String_Node_Str" + f.getName());
    }
  }
  return true;
}