Source:
public static void populateQueryParamsToMessageContext(MessageContext synCtx) { String path = RESTUtils.getFullRequestPath(synCtx); String method = (String) synCtx.getProperty(RESTConstants.REST_METHOD); int queryIndex = path.indexOf('?'); if (queryIndex != -1) { String query = path.substring(queryIndex + 1); String[] entries = query.split(RESTConstants.QUERY_PARAM_DELIMITER); String name = null; String value; for (String entry : entries) { int index = entry.indexOf('='); if (index != -1) { try { name = entry.substring(0, index); value = URLDecoder.decode(entry.substring(index + 1), RESTConstants.DEFAULT_ENCODING); synCtx.setProperty(RESTConstants.REST_QUERY_PARAM_PREFIX + name, value); } catch (UnsupportedEncodingException uee) { handleException("Error processing " + method + " request for : " + path, uee); } catch (IllegalArgumentException e) { String errorMessage = "Error processing " + method + " request for : " + path + " due to an error in the request sent by the client"; synCtx.setProperty(SynapseConstants.ERROR_CODE, HttpStatus.SC_BAD_REQUEST); synCtx.setProperty(SynapseConstants.ERROR_MESSAGE, errorMessage); org.apache.axis2.context.MessageContext inAxisMsgCtx = ((Axis2MessageContext) synCtx).getAxis2MessageContext(); inAxisMsgCtx.setProperty(SynapseConstants.HTTP_SC, HttpStatus.SC_BAD_REQUEST); handleException(errorMessage, e); } } else { String existingValue = (String) synCtx.getProperty(RESTConstants.REST_QUERY_PARAM_PREFIX + name); value = RESTConstants.QUERY_PARAM_DELIMITER + entry; synCtx.setProperty(RESTConstants.REST_QUERY_PARAM_PREFIX + name, existingValue + value); } } } }

Target:
public static void populateQueryParamsToMessageContext(MessageContext synCtx) { String path = getFullRequestPath(synCtx); String method = (String) synCtx.getProperty(RESTConstants.REST_METHOD); int queryIndex = path.indexOf('?'); if (queryIndex != -1) { String query = path.substring(queryIndex + 1); String[] entries = query.split(RESTConstants.QUERY_PARAM_DELIMITER); String name = null; String value; for (String entry : entries) { int index = entry.indexOf('='); if (index != -1) { try { name = entry.substring(0, index); value = URLDecoder.decode(entry.substring(index + 1), RESTConstants.DEFAULT_ENCODING); synCtx.setProperty(RESTConstants.REST_QUERY_PARAM_PREFIX + name, value); } catch (UnsupportedEncodingException uee) { handleException("Error processing " + method + " request for : " + path, uee); } catch (IllegalArgumentException e) { String errorMessage = "Error processing " + method + " request for : " + path + " due to an error in the request sent by the client"; synCtx.setProperty(SynapseConstants.ERROR_CODE, HttpStatus.SC_BAD_REQUEST); synCtx.setProperty(SynapseConstants.ERROR_MESSAGE, errorMessage); org.apache.axis2.context.MessageContext inAxisMsgCtx = ((Axis2MessageContext) synCtx).getAxis2MessageContext(); inAxisMsgCtx.setProperty(SynapseConstants.HTTP_SC, HttpStatus.SC_BAD_REQUEST); handleException(errorMessage, e); } } else { String existingValue = (String) synCtx.getProperty(RESTConstants.REST_QUERY_PARAM_PREFIX + name); value = RESTConstants.QUERY_PARAM_DELIMITER + entry; synCtx.setProperty(RESTConstants.REST_QUERY_PARAM_PREFIX + name, existingValue + value); } } } }