Process the wrapper list and return the results

@param <T> Type of list to process
@param typeRef
@param url URL of the page (Error output only)
@param errorMessageSuffix Error message to output (Error output only)
@return
@throws MovieDbException
776948
protected <T> List<T> processWrapperList(TypeReference typeRef, URL url, String errorMessageSuffix) throws MovieDbException {
        WrapperGenericList<T> val = processWrapper(typeRef, url, errorMessageSuffix);
        return val.getResults();
    }
862315
public RestHandlerExceptionResolverBuilder defaultContentType(String mediaType) {
        defaultContentType( hasText(mediaType) ? MediaType.parseMediaType(mediaType) : null );
        return this;
    }
987909
public static void throwInternalError(String message, UriInfo uriInfo) {
    GenericError error =  new GenericError(
        message,
        ErrorCode.INTERNAL.getCode(),
        uriInfo.getAbsolutePath().toString());

    throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR)
        .type(MediaType.APPLICATION_JSON_TYPE)
        .entity(error)
        .build());
  }
498145
public Map<String, String> getParams(HttpMessage msg, HtmlParameter.Type type) {
		switch (type) {
		case form:	return this.getFormParamParser(msg.getRequestHeader().getURI().toString()).getParams(msg, type);
		case url:	return this.getUrlParamParser(msg.getRequestHeader().getURI().toString()).getParams(msg, type);
		default:
					throw new InvalidParameterException("Type not supported: " + type);
		}
	}
424435
private static <T> T jsonDecode(String responseContent, TypeReference<T> valueTypeRef) throws IOException {

      ObjectMapper mapper = new ObjectMapper();
      
      try {
         return mapper.<T>readValue(responseContent, valueTypeRef);
      } catch (JsonGenerationException e) {
         logger.severe("unable decode");
         throw new IOException(e);
      } catch (JsonMappingException e) {
         logger.severe("unable decode");
         throw new IOException(e.getMessage());
      }
   }
663593
public ResultList<Genre> getGenreMovieList(String language) throws MovieDbException {
        return getGenreList(language, MethodSub.MOVIE_LIST);
    }
847147
@Override
    public Object readFrom(Class<Object> c, Type t, Annotation[] anns, MediaType mt,
                           MultivaluedMap<String, String> headers, InputStream is) throws IOException, WebApplicationException {
        // TODO Auto-generated method stub
        //if Type t contains IAttachment, IMutibody, convert to Attachment, Mutibody to adapt CXF MultipartProvider.readFrom
        multipartProvider.setMessageContext(mc);
        ParameterizedType origType = null;
        Type[] actualType = null;
        if (ParameterizedType.class.isAssignableFrom(t.getClass())) {
            origType = (ParameterizedType) t;
            actualType = origType.getActualTypeArguments();
            for (int i = 0; i < actualType.length; i++) {
                if (actualType[i].equals(IAttachment.class)) {
                    actualType[i] = Attachment.class;
                } else if (actualType[i].equals(IMultipartBody.class)) {
                    actualType[i] = MultipartBody.class;
                }
            }

            if (actualType != null && origType != null) {
                t = IBMParameterizedTypeImpl.make(origType.getRawType().getClass(), actualType, origType.getOwnerType());
            }
        } else if (IMultipartBody.class.isAssignableFrom(getActualType(t, 0))) {
            t = MultipartBody.class;
        }
        if (IAttachment.class.equals(c)) {
            c = (Class<Object>) (Object) Attachment.class;
        } else if (IMultipartBody.class.equals(c)) {
            c = (Class<Object>) (Object) MultipartBody.class;
        }
        //add additional converting logic since the above converting doesn't work in personal build server.
        if ("com.ibm.websphere.jaxrs20.multipart.IAttachment".equals(c.getName())) {
            c = (Class<Object>) (Object) Attachment.class;
        } else if ("com.ibm.websphere.jaxrs20.multipart.IMultipartBody".equals(c.getName())) {
            c = (Class<Object>) (Object) MultipartBody.class;
        }
        Object object = multipartProvider.readFrom(c, t, anns, mt, headers, is);
        //if object contains Attachment/MultiBoday for CXF, convert to AttachmentImpl, MultipartBodyImpl for IBM
        //List Value type: DataHandler, DataSource, Attachment, only converty Attachment
        if (object instanceof List<?>) {
            List attList = (List) object;
            List<AttachmentImpl> attImplList;
            if (!attList.isEmpty()) {
                attImplList = new LinkedList<AttachmentImpl>();
                AttachmentImpl attImpl;
                for (Object obj : attList) {
                    if (obj != null && obj instanceof Attachment) {
                        attImpl = new AttachmentImpl((Attachment) obj);
                        attImplList.add(attImpl);
                    }
                }
                return attImplList;
            }
            return object;
        }
        //convert Map if contains Attachment, e.g. LinkedHashMap <a.getContentType().toString(),fromAttachment>, fromAttachment== List<>: DataHandler, DataSource, Attachment
        else if (object != null && Map.class.isAssignableFrom(object.getClass())) {
            Map<Object, Object> attMap = (Map) object;
            if (!attMap.isEmpty()) {
                for (Iterator it = attMap.entrySet().iterator(); it.hasNext();) {
                    Entry entrySet = (Entry) it.next();
                    if (entrySet.getValue() != null && List.class.isAssignableFrom(entrySet.getValue().getClass())) {
                        List attList = (List) entrySet.getValue();
                        List<AttachmentImpl> attImplList;
                        if (!attList.isEmpty()) {
                            attImplList = new LinkedList<AttachmentImpl>();
                            AttachmentImpl attImpl;
                            for (Object obj : attList) {
                                if (obj != null && Attachment.class.isAssignableFrom(obj.getClass())) {
                                    attImpl = new AttachmentImpl((Attachment) obj);
                                    attImplList.add(attImpl);
                                }
                            }
                            entrySet.setValue(attImplList);
                        }
                    }
                }
            }
            return attMap;
        }
        //if object is MultipartBody, convert to MultipartBodayImpl
        else if (object instanceof MultipartBody) {
            IMultipartBody imbody = new MultipartBodyImpl((MultipartBody) object);
            return imbody;
        }
        return object;
    }
61942
public ResultList<Translation> getMovieTranslations(int movieId) throws MovieDbException {
        TmdbParameters parameters = new TmdbParameters();
        parameters.add(Param.ID, movieId);

        URL url = new ApiUrl(apiKey, MethodBase.MOVIE).subMethod(MethodSub.TRANSLATIONS).buildUrl(parameters);
        String webpage = httpTools.getRequest(url);

        try {
            WrapperTranslations wrapper = MAPPER.readValue(webpage, WrapperTranslations.class);
            ResultList<Translation> results = new ResultList<>(wrapper.getTranslations());
            wrapper.setResultProperties(results);
            return results;
        } catch (IOException ex) {
            throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get translations", url, ex);
        }
    }
548086
public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders,
			InputStream entityStream) throws IOException, WebApplicationException {
		String input = null;
		try {
			input = IOUtils.inputStreamToString(entityStream);
		} catch (Exception e) {
			
		}
		if (input == null) {
            return null;
        }
		if (fastJsonConfig.features == null)
			return JSON.parseObject(input, type, fastJsonConfig.parserConfig, JSON.DEFAULT_PARSER_FEATURE);
		else
			return JSON.parseObject(input, type, fastJsonConfig.parserConfig, JSON.DEFAULT_PARSER_FEATURE, fastJsonConfig.features);
	}
1146362
@SuppressWarnings("unchecked")
    @Override
    public <T> ListResult<T> list(EntityListOperation<T> lister)
            throws ServiceException {
        lister.setProxyData(createProxyData());
        Object rawResponse = getResource(lister.getUri())
                .queryParams(lister.getQueryParameters())
                .type(lister.getContentType()).accept(lister.getAcceptType())
                .get(lister.getResponseGenericType());
        Object processedResponse = lister.processResponse(rawResponse);
        return (ListResult<T>) processedResponse;

    }
8826
private ModelAndView getParamErrors(TypeMismatchException e) {

        Throwable t = e.getCause();

        if (t instanceof ConversionFailedException) {

            ConversionFailedException x = (ConversionFailedException) t;
            TypeDescriptor type = x.getTargetType();
            Annotation[] annotations = type != null ? type.getAnnotations() : new Annotation[0];
            Map<String, String> errors = new HashMap<String, String>();
            for (Annotation a : annotations) {
                if (a instanceof RequestParam) {
                    errors.put(((RequestParam) a).value(), "parameter type error!");
                }
            }
            if (errors.size() > 0) {
                return paramError(errors, ErrorCode.TYPE_MIS_MATCH);
            }
        }

        JsonObjectBase jsonObject = JsonObjectUtils.buildGlobalError("parameter type error!", ErrorCode.TYPE_MIS_MATCH);
        return JsonObjectUtils.JsonObjectError2ModelView((JsonObjectError) jsonObject);
    }
752181
public ResultList<Keyword> getMovieKeywords(int movieId) throws MovieDbException {
        TmdbParameters parameters = new TmdbParameters();
        parameters.add(Param.ID, movieId);

        URL url = new ApiUrl(apiKey, MethodBase.MOVIE).subMethod(MethodSub.KEYWORDS).buildUrl(parameters);
        String webpage = httpTools.getRequest(url);

        try {
            WrapperMovieKeywords wrapper = MAPPER.readValue(webpage, WrapperMovieKeywords.class);
            ResultList<Keyword> results = new ResultList<>(wrapper.getKeywords());
            wrapper.setResultProperties(results);
            return results;
        } catch (IOException ex) {
            throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get keywords", url, ex);
        }
    }
1275776
private void processParseResult(final URI currentFile) {
        // Category non-copyto result and update uplevels accordingly
        for (final Reference file: listFilter.getNonCopytoResult()) {
            categorizeReferenceFile(file);
            updateUplevels(file.filename);
        }
        for (final Map.Entry<URI, URI> e : listFilter.getCopytoMap().entrySet()) {
            final URI source = e.getValue();
            final URI target = e.getKey();
            copyTo.put(target, source);
            updateUplevels(target);

        }
        schemeSet.addAll(listFilter.getSchemeRefSet());

        // collect key definitions
        for (final Map.Entry<String, KeyDef> e: keydefFilter.getKeysDMap().entrySet()) {
            // key and value.keys will differ when keydef is a redirect to another keydef
            final String key = e.getKey();
            final KeyDef value = e.getValue();
            if (schemeSet.contains(currentFile)) {
                schemekeydefMap.put(key, new KeyDef(key, value.href, value.scope, value.format, currentFile, null));
            }
        }

        hrefTargetSet.addAll(listFilter.getHrefTargets());
        conrefTargetSet.addAll(listFilter.getConrefTargets());
        nonConrefCopytoTargetSet.addAll(listFilter.getNonConrefCopytoTargets());
        coderefTargetSet.addAll(listFilter.getCoderefTargets());
        outDitaFilesSet.addAll(listFilter.getOutFilesSet());

        // Generate topic-scheme dictionary
        final Set<URI> schemeSet = listFilter.getSchemeSet();
        if (schemeSet != null && !schemeSet.isEmpty()) {
            Set<URI> children = schemeDictionary.get(currentFile);
            if (children == null) {
                children = new HashSet<>();
            }
            children.addAll(schemeSet);
            schemeDictionary.put(currentFile, children);
            final Set<URI> hrfSet = listFilter.getHrefTargets();
            for (final URI filename: hrfSet) {
                children = schemeDictionary.get(filename);
                if (children == null) {
                    children = new HashSet<>();
                }
                children.addAll(schemeSet);
                schemeDictionary.put(filename, children);
            }
        }
    }
1043543
@FFDCIgnore(IOException.class)
    public boolean processWithWholeMessageHandler(DATA_TYPE dt) throws CharacterCodingException {
        if ((appTextMessageHandler != null) && (dt == DATA_TYPE.TEXT)) {

            Class<?> clazz = appTextMessageHandlerClass;

            if (clazz.equals(String.class)) {
                String message = convertMessageToString();

                // call the application's MessageHandler.onMessage(<String> x) method
                connLink.setReadLinkStatus(READ_LINK_STATUS.ON_READ_THREAD);
                ((MessageHandler.Whole<String>) appTextMessageHandler).onMessage(message);
                return true;
            }

            else if (clazz.equals(Reader.class)) {
                Reader message = convertMessageToReader();

                // call the application's MessageHandler.onMessage(<Reader> x) method
                connLink.setReadLinkStatus(READ_LINK_STATUS.ON_READ_THREAD);
                ((MessageHandler.Whole<Reader>) appTextMessageHandler).onMessage(message);
                return true;
            }
        }

        if ((appBinaryMessageHandler != null) && (dt == DATA_TYPE.BINARY)) {
            Class<?> clazz = appBinaryMessageHandlerClass;

            if (clazz.equals(ByteBuffer.class)) {
                ByteBuffer message = convertMessageToByteBuffer();

                // call the application's MessageHandler.onMessage(<ByteBuffer> x) method
                connLink.setReadLinkStatus(READ_LINK_STATUS.ON_READ_THREAD);
                ((MessageHandler.Whole<ByteBuffer>) appBinaryMessageHandler).onMessage(message);
                return true;
            }

            else if (clazz.equals(byte[].class)) {
                byte[] message = convertPayloadToByteArray();

                // call the application's MessageHandler.onMessage(<byte[]> x) method
                connLink.setReadLinkStatus(READ_LINK_STATUS.ON_READ_THREAD);
                ((MessageHandler.Whole<byte[]>) appBinaryMessageHandler).onMessage(message);
                return true;
            }

            else if (clazz.equals(InputStream.class)) {
                InputStream message = convertMessageToInputStream();

                // call the application's MessageHandler.onMessage(<InputStream> x) method
                connLink.setReadLinkStatus(READ_LINK_STATUS.ON_READ_THREAD);
                ((MessageHandler.Whole<InputStream>) appBinaryMessageHandler).onMessage(message);
                return true;
            }
        }
        if ((appPongMessageHandler != null) && (dt == DATA_TYPE.PONG)) {
            Class<?> clazz = appPongMessageHandlerClass;
            if (clazz.equals(PongMessage.class)) {
                ByteBuffer message = convertMessageToByteBuffer(true);
                PongMessage msg = new PongMessageImpl(message);

                // call the application's MessageHandler.onMessage(<Reader> x) method
                connLink.setReadLinkStatus(READ_LINK_STATUS.ON_READ_THREAD);
                ((MessageHandler.Whole<PongMessage>) appPongMessageHandler).onMessage(msg);
                return true;
            }
        }

        // if the generic type for this MessageHandler.Whole equals one of the configured decoder generic types, then use that decoder
        // clazz: is the generic class that the MessageHandler.Whole specifies
        // then go through the decoders that also have been specified with this same (or assignable) generic class.
        // in other words, let me see if I have any decoders<X> to use with this  MessageHandler<X>.
        if ((appTextMessageHandler != null) && (dt == DATA_TYPE.TEXT)) {

            Class<?> clazz = appTextMessageHandlerClass;
            ArrayList<Decoder> dcList = findDecoderFromAppDecoderType(clazz, dt);

            if (dcList != null && dcList.size() > 0) {
                Decoder firstDecoder = dcList.get(0);
                if (firstDecoder instanceof Decoder.Text) {
                    String message = convertMessageToString();
                    //user might have declared multiple decoders of same type for this endpoint. In this case, check
                    //decoder list and find the first decoder in the list which has implemented willDecode(..) to return
                    //'true'
                    Decoder dc = findWillDecodeDecoder(dcList, message);
                    if (dc != null) {
                        try {
                            dc.init(endpointConfig);
                            Object appObj = ((Decoder.Text) dc).decode(message);
                            connLink.setReadLinkStatus(READ_LINK_STATUS.ON_READ_THREAD);
                            ((MessageHandler.Whole) appTextMessageHandler).onMessage(appObj);
                            return true;
                        } catch (DecodeException e) {
                            connLink.callOnError(e, true);
                            return true;
                        }
                    }
                } else if (firstDecoder instanceof Decoder.TextStream) {
                    Reader message = convertMessageToReader();
                    try {
                        //WebSocket API does not support willDecode() method for Decoder.BinaryStream type. Hence, even if
                        //user has declared multiple same type of decoder, just pick the first one in the list and use it.

                        firstDecoder.init(endpointConfig);
                        Object appObj = ((Decoder.TextStream) firstDecoder).decode(message);
                        connLink.setReadLinkStatus(READ_LINK_STATUS.ON_READ_THREAD);
                        ((MessageHandler.Whole) appTextMessageHandler).onMessage(appObj);
                        return true;
                    } catch (DecodeException e) {
                        connLink.callOnError(e, true);
                        return true;
                    } catch (IOException e) {
                        if (tc.isDebugEnabled()) {
                            Tr.debug(tc, "IOException calling onMessage on class " + clazz.getName() + " while decoding Decoder.TextStream type "
                                         + ((Decoder.TextStream) firstDecoder).toString()
                                         + "Exception is: " + e.getMessage());
                        }
                        //Since IOexception has occurred, there is no point in attempting to read message TextStream to convert into
                        //message string to pass as first param to form DecodeException. Hence passing just a error message
                        //"IOException decoding BinaryStream" as first parameter here
                        String msg = Tr.formatMessage(tc,
                                                      "decoder.ioexception",
                                                      appTextMessageHandler.getClass().getName(), firstDecoder.getClass().getName());

                        DecodeException de = new DecodeException(msg, e.getMessage(), e);
                        connLink.callOnError(de, true);
                        return true;
                    }
                }
            }
        }

        if ((appBinaryMessageHandler != null) && (dt == DATA_TYPE.BINARY)) {
            Class<?> clazz = appBinaryMessageHandlerClass;
            ArrayList<Decoder> dcList = findDecoderFromAppDecoderType(clazz, dt);

            if (dcList != null && dcList.size() > 0) {
                Decoder firstDecoder = dcList.get(0);
                if (firstDecoder instanceof Decoder.Binary) {
                    // Decode the given bytes into an object of type T
                    ByteBuffer message = convertMessageToByteBuffer();
                    //user might have declared multiple decoders of same type for this endpoint. In this case, check
                    //decoder list and find the first decoder in the list which has implemented willDecode(..) to return
                    //'true'
                    Decoder dc = findWillDecodeDecoder(dcList, message);
                    if (dc != null) {
                        try {
                            dc.init(endpointConfig);
                            Object appObj = ((Decoder.Binary) dc).decode(message);
                            connLink.setReadLinkStatus(READ_LINK_STATUS.ON_READ_THREAD);
                            ((MessageHandler.Whole) appBinaryMessageHandler).onMessage(appObj);
                            return true;
                        } catch (DecodeException e) {
                            connLink.callOnError(e, true);
                            return true;
                        }
                    } else {
                        if (tc.isDebugEnabled()) {
                            Tr.debug(tc, "willDecode returned false");
                        }
                        return true;
                    }
                } else if (firstDecoder instanceof Decoder.BinaryStream) {
                    InputStream message = convertMessageToInputStream();
                    try {
                        //WebSocket API does not support willDecode() method for Decoder.BinaryStream type. Hence, even if
                        //user has declared multiple same type of decoder, just pick the first one in the list and use it.
                        firstDecoder.init(endpointConfig);
                        Object appObj = ((Decoder.BinaryStream) firstDecoder).decode(message);
                        connLink.setReadLinkStatus(READ_LINK_STATUS.ON_READ_THREAD);
                        ((MessageHandler.Whole) appBinaryMessageHandler).onMessage(appObj);
                        return true;
                    } catch (DecodeException e) {
                        connLink.callOnError(e, true);
                        return true;
                    } catch (IOException e) {
                        // do NOT allow instrumented FFDC to be used here
                        if (tc.isDebugEnabled()) {
                            Tr.debug(tc, "IOException calling onMessage on class " + clazz.getName() + " while decoding Decoder.BinaryStream type "
                                         + ((Decoder.BinaryStream) firstDecoder).toString()
                                         + "Exception is: " + e.getMessage());
                        }
                        //Since IOexception has occurred, there is no point in attempting to read message BinaryStream to convert into
                        //message string to pass as first param to form DecodeException. Hence passing just a error message
                        //"IOException decoding BinaryStream" as first parameter here
                        String msg = Tr.formatMessage(tc,
                                                      "decoder.ioexception",
                                                      appBinaryMessageHandler.getClass().getName(), ((Decoder.BinaryStream) firstDecoder).getClass().getName());
                        DecodeException de = new DecodeException(msg, e.getMessage(), e);
                        connLink.callOnError(de, true);
                        return true;
                    }
                }
            }
        }
        return false;
    }
267024
def TypeUrlToMessage(type_url):
  """"""

  if not type_url.startswith(TYPE_URL_PREFIX):
    raise ValueError("Type URL has to start with a prefix %s: %s" %
                     (TYPE_URL_PREFIX, type_url))

  full_name = type_url[len(TYPE_URL_PREFIX):]
  try:
    return symbol_database.Default().GetSymbol(full_name)()
  except KeyError as e:
    raise ProtobufTypeNotFound(str(e))
540031
public void scanProcesses(Object typeObject, OperationType type)
    {
        String strTargetVersion = this.getProperty("version");
        if (strTargetVersion == null)
            strTargetVersion = this.getDefaultVersion();
        Record recMessageTransport = ((ReferenceField)this.getRecord(MessageControl.MESSAGE_CONTROL_FILE).getField(MessageControl.WEB_MESSAGE_TRANSPORT_ID)).getReference();
        MessageVersion recMessageVersion = ((MessageControl)this.getRecord(MessageControl.MESSAGE_CONTROL_FILE)).getMessageVersion(strTargetVersion);
        MessageProcessInfo recMessageProcessInfo = new MessageProcessInfo(this);
        recMessageProcessInfo.setKeyArea(MessageProcessInfo.MESSAGE_INFO_ID_KEY);
        try   {
             // Always register this generic processing queue.
            recMessageProcessInfo.close();
            while (recMessageProcessInfo.hasNext())
            {
                recMessageProcessInfo.next();
                String strQueueName = recMessageProcessInfo.getQueueName(true);
                String strQueueType = recMessageProcessInfo.getQueueType(true);
                String strProcessClass = recMessageProcessInfo.getField(MessageProcessInfo.PROCESSOR_CLASS).toString();
                Map<String,Object> properties = ((PropertiesField)recMessageProcessInfo.getField(MessageProcessInfo.PROPERTIES)).getProperties();
                Record recMessageType = ((ReferenceField)recMessageProcessInfo.getField(MessageProcessInfo.MESSAGE_TYPE_ID)).getReference();
                if (recMessageType != null)
                {   // Start all processes that handle INcoming REQUESTs.
                    String strMessageType = recMessageType.getField(MessageType.CODE).toString();
                    Record recMessageInfo = ((ReferenceField)recMessageProcessInfo.getField(MessageProcessInfo.MESSAGE_INFO_ID)).getReference();
                    if (recMessageInfo != null)
                    {
                        Record recMessageInfoType = ((ReferenceField)recMessageInfo.getField(MessageInfo.MESSAGE_INFO_TYPE_ID)).getReference();
                        if (recMessageInfoType != null)
                        {
                            String strMessageInfoType = recMessageInfoType.getField(MessageInfoType.CODE).toString();
                            if (MessageInfoType.REQUEST.equals(strMessageInfoType))
                                if (MessageType.MESSAGE_IN.equals(strMessageType))
                                    if ((strQueueName != null) && (strQueueName.length() > 0))
                            {
                                Record recMessageTransportInfo = this.getRecord(MessageTransportInfo.MESSAGE_TRANSPORT_INFO_FILE);
                                recMessageTransportInfo.setKeyArea(MessageTransportInfo.MESSAGE_PROCESS_INFO_ID_KEY);
                                recMessageTransportInfo.getField(MessageTransportInfo.MESSAGE_PROCESS_INFO_ID).moveFieldToThis(recMessageProcessInfo.getField(MessageProcessInfo.ID));
                                recMessageTransportInfo.getField(MessageTransportInfo.MESSAGE_TRANSPORT_ID).moveFieldToThis(recMessageTransport.getField(MessageTransport.ID));
                                recMessageTransportInfo.getField(MessageTransportInfo.MESSAGE_VERSION_ID).moveFieldToThis(recMessageVersion.getField(MessageVersion.ID));
                                if (recMessageTransportInfo.seek(DBConstants.EQUALS))
                                {
                                    this.addProcessForWSDL(strTargetVersion, typeObject, recMessageProcessInfo, type);
                                }
                            }
                        }
                    }
                }
            }
            recMessageProcessInfo.close();
        } catch (DBException ex)    {
            ex.printStackTrace();
        } finally {
            recMessageProcessInfo.free();
        }
    }
1007362
public ResultList<PersonFind> searchPeople(String query, Integer page, Boolean includeAdult, SearchType searchType) throws MovieDbException {
        TmdbParameters parameters = new TmdbParameters();
        parameters.add(Param.QUERY, query);
        parameters.add(Param.ADULT, includeAdult);
        parameters.add(Param.PAGE, page);
        if (searchType != null) {
            parameters.add(Param.SEARCH_TYPE, searchType.getPropertyString());
        }
        URL url = new ApiUrl(apiKey, MethodBase.SEARCH).subMethod(MethodSub.PERSON).buildUrl(parameters);
        WrapperGenericList<PersonFind> wrapper = processWrapper(getTypeReference(PersonFind.class), url, "person");
        return wrapper.getResultsList();
    }