commit | 19bb6f6d7d2b5ec8847b9657c0984fbcf2ac381f | [log] [tgz] |
---|---|---|
author | zhouyanjie <zhouyanjie@aliyun.com> | Fri Dec 04 17:52:21 2020 +0800 |
committer | zhouyanjie <zhouyanjie@aliyun.com> | Fri Dec 04 17:52:21 2020 +0800 |
tree | 6714415266bf2bce05c0639911cb86327841fc90 | |
parent | 7b53e470dc36f6049a926e07f155224ccdcab9cf [diff] |
Fix repeat creating Gson
diff --git a/shardingsphere-elasticjob-cloud-ui/shardingsphere-elasticjob-cloud-ui-backend/src/main/java/org/apache/shardingsphere/elasticjob/cloud/ui/security/AuthenticationFilter.java b/shardingsphere-elasticjob-cloud-ui/shardingsphere-elasticjob-cloud-ui-backend/src/main/java/org/apache/shardingsphere/elasticjob/cloud/ui/security/AuthenticationFilter.java index d550fa5..89cc404 100644 --- a/shardingsphere-elasticjob-cloud-ui/shardingsphere-elasticjob-cloud-ui-backend/src/main/java/org/apache/shardingsphere/elasticjob/cloud/ui/security/AuthenticationFilter.java +++ b/shardingsphere-elasticjob-cloud-ui/shardingsphere-elasticjob-cloud-ui-backend/src/main/java/org/apache/shardingsphere/elasticjob/cloud/ui/security/AuthenticationFilter.java
@@ -94,6 +94,6 @@ private void respondWithUnauthorized(final HttpServletResponse httpResponse) throws IOException { httpResponse.setContentType("application/json"); httpResponse.setCharacterEncoding("UTF-8"); - httpResponse.getWriter().write(new Gson().toJson(ResponseResultUtil.handleUnauthorizedException("Unauthorized."))); + httpResponse.getWriter().write(gson.toJson(ResponseResultUtil.handleUnauthorizedException("Unauthorized."))); } }
diff --git a/shardingsphere-elasticjob-lite-ui/shardingsphere-elasticjob-lite-ui-backend/src/main/java/org/apache/shardingsphere/elasticjob/lite/ui/security/AuthenticationFilter.java b/shardingsphere-elasticjob-lite-ui/shardingsphere-elasticjob-lite-ui-backend/src/main/java/org/apache/shardingsphere/elasticjob/lite/ui/security/AuthenticationFilter.java index 23901af..b299e82 100644 --- a/shardingsphere-elasticjob-lite-ui/shardingsphere-elasticjob-lite-ui-backend/src/main/java/org/apache/shardingsphere/elasticjob/lite/ui/security/AuthenticationFilter.java +++ b/shardingsphere-elasticjob-lite-ui/shardingsphere-elasticjob-lite-ui-backend/src/main/java/org/apache/shardingsphere/elasticjob/lite/ui/security/AuthenticationFilter.java
@@ -94,6 +94,6 @@ private void respondWithUnauthorized(final HttpServletResponse httpResponse) throws IOException { httpResponse.setContentType("application/json"); httpResponse.setCharacterEncoding("UTF-8"); - httpResponse.getWriter().write(new Gson().toJson(ResponseResultUtil.handleUnauthorizedException("Unauthorized."))); + httpResponse.getWriter().write(gson.toJson(ResponseResultUtil.handleUnauthorizedException("Unauthorized."))); } }