Source:
private Map getPropertiesMap(List<String> propertiesNamesList, MessageContext synCtx) { Map<String, Map<String, String>> propertiesMap = new HashMap<>(); String[] contextAndName; String value = ""; org.apache.axis2.context.MessageContext axis2MsgCtx = ((Axis2MessageContext) synCtx).getAxis2MessageContext(); HashMap functionProperties = new HashMap(); Stack<TemplateContext> templeteContextStack = ((Stack) synCtx .getProperty(SynapseConstants.SYNAPSE__FUNCTION__STACK)); if (templeteContextStack != null) { TemplateContext templateContext = templeteContextStack.peek(); functionProperties.putAll(templateContext.getMappedValues()); } for (String propertyName : propertiesNamesList) { contextAndName = propertyName.split("\\['|'\\]"); switch (contextAndName[0].toUpperCase()) { case DEFAULT_CONTEXT: case SYNAPSE_CONTEXT: value = (String) synCtx.getProperty(contextAndName[1]); break; case TRANSPORT_CONTEXT: value = (String) ((Map) axis2MsgCtx.getProperty(TRANSPORT_HEADERS)).get(contextAndName[1]); break; case AXIS2_CONTEXT: value = (String) axis2MsgCtx.getProperty(contextAndName[1]); break; case AXIS2_CLIENT_CONTEXT: value = (String) axis2MsgCtx.getOptions().getProperty(contextAndName[1]); break; case OPERATIONS_CONTEXT: value = (String) axis2MsgCtx.getOperationContext().getProperty(contextAndName[1]); break; case FUNCTION_CONTEXT: value = (String) functionProperties.get(contextAndName[1]); break; default: log.warn(contextAndName[0] + " scope is not found. Setting it to an empty value."); value = ""; } if (value == null) { log.warn(propertyName + "not found. Setting it to an empty value."); value = ""; } insertToMap(propertiesMap, contextAndName, value); } return propertiesMap; }

Target:
private Map getPropertiesMap(List<String> propertiesNamesList, MessageContext synCtx) { Map<String, Map<String, String>> propertiesMap = new HashMap<>(); String[] contextAndName; String value = EMPTY_STRING; org.apache.axis2.context.MessageContext axis2MsgCtx = ((Axis2MessageContext) synCtx).getAxis2MessageContext(); HashMap functionProperties = new HashMap(); Stack<TemplateContext> templeteContextStack = ((Stack) synCtx .getProperty(SynapseConstants.SYNAPSE__FUNCTION__STACK)); if (templeteContextStack != null) { TemplateContext templateContext = templeteContextStack.peek(); functionProperties.putAll(templateContext.getMappedValues()); } for (String propertyName : propertiesNamesList) { contextAndName = propertyName.split("\\['|'\\]"); switch (contextAndName[0].toUpperCase()) { case DEFAULT_CONTEXT: case SYNAPSE_CONTEXT: value = (String) synCtx.getProperty(contextAndName[1]); break; case TRANSPORT_CONTEXT: value = (String) ((Map) axis2MsgCtx.getProperty(TRANSPORT_HEADERS)).get(contextAndName[1]); break; case AXIS2_CONTEXT: value = (String) axis2MsgCtx.getProperty(contextAndName[1]); break; case AXIS2_CLIENT_CONTEXT: value = (String) axis2MsgCtx.getOptions().getProperty(contextAndName[1]); break; case OPERATIONS_CONTEXT: value = (String) axis2MsgCtx.getOperationContext().getProperty(contextAndName[1]); break; case FUNCTION_CONTEXT: value = (String) functionProperties.get(contextAndName[1]); break; default: log.warn(contextAndName[0] + " scope is not found. Setting it to an empty value."); value = EMPTY_STRING; } if (value == null) { log.warn(propertyName + "not found. Setting it to an empty value."); value = EMPTY_STRING; } insertToMap(propertiesMap, contextAndName, value); } return propertiesMap; }