WW-5009 EmptyStackException in JSON plugin due to concurrency

This commit is contained in:
Aleksandr Mashchenko
2019-02-03 12:41:18 +02:00
parent 8988d57644
commit 0323795d67
@@ -71,13 +71,6 @@ public class JSONInterceptor extends AbstractInterceptor {
private String jsonContentType = "application/json";
private String jsonRpcContentType = "application/json-rpc";
private JSONUtil jsonUtil;
@Inject
public void setJsonUtil(JSONUtil jsonUtil) {
this.jsonUtil = jsonUtil;
}
@SuppressWarnings("unchecked")
public String intercept(ActionInvocation invocation) throws Exception {
HttpServletRequest request = ServletActionContext.getRequest();
@@ -175,6 +168,8 @@ public class JSONInterceptor extends AbstractInterceptor {
result = rpcResponse;
}
JSONUtil jsonUtil = invocation.getInvocationContext().getContainer().getInstance(JSONUtil.class);
String json = jsonUtil.serialize(result, excludeProperties, getIncludeProperties(),
ignoreHierarchy, excludeNullProperties);
json = addCallbackIfApplicable(request, json);