Program: 31933
Project: 31933
Buggy source:
/** 
 * List the item provided in an intent.
 * @param intent the intent.
 * @param loader the class loader.
 * @return the room list
 */
public static List<RoomMediaMessage> listRoomMediaMessages(Intent intent,ClassLoader loader){
  List<RoomMediaMessage> roomMediaMessages=new ArrayList<>();
  if (null != intent) {
    if (TextUtils.equals(intent.getType(),ClipDescription.MIMETYPE_TEXT_PLAIN)) {
      String message=intent.getStringExtra(Intent.EXTRA_TEXT);
      if (null == message) {
        CharSequence sequence=intent.getCharSequenceExtra(Intent.EXTRA_TEXT);
        if (null != sequence) {
          message=sequence.toString();
        }
      }
      String subject=intent.getStringExtra(Intent.EXTRA_SUBJECT);
      if (!TextUtils.isEmpty(subject)) {
        if (TextUtils.isEmpty(message)) {
          message=subject;
        }
 else         if (android.util.Patterns.WEB_URL.matcher(message).matches()) {
          message=subject + "String_Node_Str" + message;
        }
      }
      if (!TextUtils.isEmpty(message)) {
        roomMediaMessages.add(new RoomMediaMessage(message,null,intent.getType()));
        return roomMediaMessages;
      }
    }
    ClipData clipData=null;
    List<String> mimetypes=null;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
      clipData=intent.getClipData();
    }
    if (null != clipData) {
      if (null != clipData.getDescription()) {
        if (0 != clipData.getDescription().getMimeTypeCount()) {
          mimetypes=new ArrayList<>();
          for (int i=0; i < clipData.getDescription().getMimeTypeCount(); i++) {
            mimetypes.add(clipData.getDescription().getMimeType(i));
          }
          if (1 == mimetypes.size()) {
            if (mimetypes.get(0).endsWith("String_Node_Str")) {
              mimetypes=null;
            }
          }
        }
      }
      int count=clipData.getItemCount();
      for (int i=0; i < count; i++) {
        ClipData.Item item=clipData.getItemAt(i);
        String mimetype=null;
        if (null != mimetypes) {
          if (i < mimetypes.size()) {
            mimetype=mimetypes.get(i);
          }
 else {
            mimetype=mimetypes.get(0);
          }
          if (TextUtils.equals(mimetype,ClipDescription.MIMETYPE_TEXT_URILIST)) {
            mimetype=null;
          }
        }
        roomMediaMessages.add(new RoomMediaMessage(item,mimetype));
      }
    }
 else     if (null != intent.getData()) {
      roomMediaMessages.add(new RoomMediaMessage(intent.getData()));
    }
 else {
      Bundle bundle=intent.getExtras();
      if (null != bundle) {
        if (null != loader) {
          bundle.setClassLoader(RoomMediaMessage.class.getClassLoader());
        }
        if (bundle.containsKey(Intent.EXTRA_STREAM)) {
          try {
            Object streamUri=bundle.get(Intent.EXTRA_STREAM);
            if (streamUri instanceof Uri) {
              roomMediaMessages.add(new RoomMediaMessage((Uri)streamUri));
            }
 else             if (streamUri instanceof List) {
              List<Object> streams=(List<Object>)streamUri;
              for (              Object object : streams) {
                if (object instanceof Uri) {
                  roomMediaMessages.add(new RoomMediaMessage((Uri)object));
                }
 else                 if (object instanceof RoomMediaMessage) {
                  roomMediaMessages.add((RoomMediaMessage)object);
                }
              }
            }
          }
 catch (          Exception e) {
            Log.e(LOG_TAG,"String_Node_Str",e);
          }
        }
      }
    }
  }
  return roomMediaMessages;
}

Fixed version (ground truth):
/** 
 * List the item provided in an intent.
 * @param intent the intent.
 * @param loader the class loader.
 * @return the room list
 */
public static List<RoomMediaMessage> listRoomMediaMessages(Intent intent,ClassLoader loader){
  List<RoomMediaMessage> roomMediaMessages=new ArrayList<>();
  if (null != intent) {
    if (TextUtils.equals(intent.getType(),ClipDescription.MIMETYPE_TEXT_PLAIN)) {
      String message=intent.getStringExtra(Intent.EXTRA_TEXT);
      if (null == message) {
        CharSequence sequence=intent.getCharSequenceExtra(Intent.EXTRA_TEXT);
        if (null != sequence) {
          message=sequence.toString();
        }
      }
      String subject=intent.getStringExtra(Intent.EXTRA_SUBJECT);
      if (!TextUtils.isEmpty(subject)) {
        if (TextUtils.isEmpty(message)) {
          message=subject;
        }
 else         if (android.util.Patterns.WEB_URL.matcher(message).matches()) {
          message=subject + "String_Node_Str" + message;
        }
      }
      if (!TextUtils.isEmpty(message)) {
        roomMediaMessages.add(new RoomMediaMessage(message,null,intent.getType()));
        return roomMediaMessages;
      }
    }
    ClipData clipData=null;
    List<String> mimetypes=null;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
      clipData=intent.getClipData();
    }
    if (null != clipData) {
      if (null != clipData.getDescription()) {
        if (0 != clipData.getDescription().getMimeTypeCount()) {
          mimetypes=new ArrayList<>();
          for (int i=0; i < clipData.getDescription().getMimeTypeCount(); i++) {
            mimetypes.add(clipData.getDescription().getMimeType(i));
          }
          if (1 == mimetypes.size()) {
            if (mimetypes.get(0).endsWith("String_Node_Str")) {
              mimetypes=null;
            }
          }
        }
      }
      int count=clipData.getItemCount();
      for (int i=0; i < count; i++) {
        ClipData.Item item=clipData.getItemAt(i);
        String mimetype=null;
        if (null != mimetypes) {
          if (i < mimetypes.size()) {
            mimetype=mimetypes.get(i);
          }
 else {
            mimetype=mimetypes.get(0);
          }
          if (TextUtils.equals(mimetype,ClipDescription.MIMETYPE_TEXT_URILIST)) {
            mimetype=null;
          }
        }
        roomMediaMessages.add(new RoomMediaMessage(item,mimetype));
      }
    }
 else     if (null != intent.getData()) {
      roomMediaMessages.add(new RoomMediaMessage(intent.getData()));
    }
 else {
      Bundle bundle=intent.getExtras();
      if (null != bundle) {
        bundle.setClassLoader(RoomMediaMessage.class.getClassLoader());
        if (bundle.containsKey(Intent.EXTRA_STREAM)) {
          try {
            Object streamUri=bundle.get(Intent.EXTRA_STREAM);
            if (streamUri instanceof Uri) {
              roomMediaMessages.add(new RoomMediaMessage((Uri)streamUri));
            }
 else             if (streamUri instanceof List) {
              List<Object> streams=(List<Object>)streamUri;
              for (              Object object : streams) {
                if (object instanceof Uri) {
                  roomMediaMessages.add(new RoomMediaMessage((Uri)object));
                }
 else                 if (object instanceof RoomMediaMessage) {
                  roomMediaMessages.add((RoomMediaMessage)object);
                }
              }
            }
          }
 catch (          Exception e) {
            Log.e(LOG_TAG,"String_Node_Str",e);
          }
        }
      }
    }
  }
  return roomMediaMessages;
}