Source:
private Map getPropertiesMap(List<String> propertiesNamesList, MessageContext synCtx) { Map<String, Map<String, Object>> propertiesMap = new HashMap<>(); String[] contextAndName; Object 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 = synCtx.getProperty(contextAndName[1]); break; case TRANSPORT_CONTEXT: value = ((Map) axis2MsgCtx.getProperty(TRANSPORT_HEADERS)).get(contextAndName[1]); break; case AXIS2_CONTEXT: value = axis2MsgCtx.getProperty(contextAndName[1]); break; case AXIS2_CLIENT_CONTEXT: value = axis2MsgCtx.getOptions().getProperty(contextAndName[1]); break; case OPERATIONS_CONTEXT: value = axis2MsgCtx.getOperationContext().getProperty(contextAndName[1]); break; case FUNCTION_CONTEXT: value = 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; }

Target:
private Map<String, Map<String, Object>> getPropertiesMap(List<String> propertiesNamesList, MessageContext synCtx) { Map<String, Map<String, Object>> propertiesMap = new HashMap<>(); String[] contextAndName; Object 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 = synCtx.getProperty(contextAndName[1]); break; case TRANSPORT_CONTEXT: value = ((Map) axis2MsgCtx.getProperty(TRANSPORT_HEADERS)).get(contextAndName[1]); break; case AXIS2_CONTEXT: value = axis2MsgCtx.getProperty(contextAndName[1]); break; case AXIS2_CLIENT_CONTEXT: value = axis2MsgCtx.getOptions().getProperty(contextAndName[1]); break; case OPERATIONS_CONTEXT: value = axis2MsgCtx.getOperationContext().getProperty(contextAndName[1]); break; case FUNCTION_CONTEXT: value = 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; }