Source:
<code>public ApiDynamicActionImplementor getSetMethodForContextApiAction() { return new ApiDynamicActionImplementor( API_METHOD_NAME, new String[] {PARAM_SCRIPT_NAME}, new String[] {PARAM_SCRIPT_CONFIG_PARAMS}) { @Override public void handleAction(JSONObject params) throws ApiException { Context context = ApiUtils.getContextByParamId(params, SessionManagementAPI.PARAM_CONTEXT_ID); String scriptName = ApiUtils.getNonEmptyStringParam(params, PARAM_SCRIPT_NAME); ScriptBasedSessionManagementMethod method = createSessionManagementMethod(context.getId()); ScriptWrapper script = getScriptsExtension().getScript(scriptName); if (script == null) { log.error( "Unable to find script while loading Script Based Session Management Method for name: " + scriptName); throw new ApiException(ApiException.Type.SCRIPT_NOT_FOUND, scriptName); <START> } else log.info("Loaded script for API:" + script.getName()); <END> method.script = script; SessionScript sessionScript = getScriptInterface(script); String[] requiredParams = sessionScript.getRequiredParamsNames(); String[] optionalParams = sessionScript.getOptionalParamsNames(); if (log.isDebugEnabled()) { log.debug( "Loaded session management script - required parameters: " + Arrays.toString(requiredParams) + " - optional parameters: " + Arrays.toString(optionalParams)); } Map<String, String> paramValues = new HashMap<String, String>(); for (String rp : requiredParams) { String val = ApiUtils.getNonEmptyStringParam(params, rp); paramValues.put(rp, val); } for (String op : optionalParams) paramValues.put(op, ApiUtils.getOptionalStringParam(params, op)); method.paramValues = paramValues; if (log.isDebugEnabled()) log.debug("Loaded session management script parameters:" + paramValues); context.setSessionManagementMethod(method); } }; }</code><technical_language>Braces</technical_language>

Target:
public ApiDynamicActionImplementor getSetMethodForContextApiAction() { return new ApiDynamicActionImplementor( API_METHOD_NAME, new String[] {PARAM_SCRIPT_NAME}, new String[] {PARAM_SCRIPT_CONFIG_PARAMS}) { @Override public void handleAction(JSONObject params) throws ApiException { Context context = ApiUtils.getContextByParamId(params, SessionManagementAPI.PARAM_CONTEXT_ID); String scriptName = ApiUtils.getNonEmptyStringParam(params, PARAM_SCRIPT_NAME); ScriptBasedSessionManagementMethod method = createSessionManagementMethod(context.getId()); ScriptWrapper script = getScriptsExtension().getScript(scriptName); if (script == null) { LOG.error( "Unable to find script while loading Script Based Session Management Method for name: " + scriptName); throw new ApiException(ApiException.Type.SCRIPT_NOT_FOUND, scriptName); } else { LOG.info("Loaded script for API:" + script.getName()); } method.script = script; SessionScript sessionScript = getScriptInterface(script); String[] requiredParams = sessionScript.getRequiredParamsNames(); String[] optionalParams = sessionScript.getOptionalParamsNames(); if (LOG.isDebugEnabled()) { LOG.debug( "Loaded session management script - required parameters: " + Arrays.toString(requiredParams) + " - optional parameters: " + Arrays.toString(optionalParams)); } Map<String, String> paramValues = new HashMap<String, String>(); for (String rp : requiredParams) { String val = ApiUtils.getNonEmptyStringParam(params, rp); paramValues.put(rp, val); } for (String op : optionalParams) paramValues.put(op, ApiUtils.getOptionalStringParam(params, op)); method.paramValues = paramValues; if (LOG.isDebugEnabled()) LOG.debug("Loaded session management script parameters:" + paramValues); context.setSessionManagementMethod(method); } }; }