You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@submarine.apache.org by GitBox <gi...@apache.org> on 2019/11/07 14:02:53 UTC

[GitHub] [submarine] lowc1012 commented on a change in pull request #85: SUBMARINE-284. Method invocation `SqlSession#close` may produce NPE

lowc1012 commented on a change in pull request #85: SUBMARINE-284. Method invocation `SqlSession#close` may produce NPE
URL: https://github.com/apache/submarine/pull/85#discussion_r343665565
 
 

 ##########
 File path: submarine-workbench/workbench-server/src/main/java/org/apache/submarine/rest/SysDeptRestApi.java
 ##########
 @@ -195,18 +180,14 @@ public Response edit(SysDept sysDept) {
   @SubmarineApi
   public Response resetParentDept() {
     LOG.info("resetParentDept()");
-    SqlSession sqlSession = null;
-    try {
-      sqlSession = MyBatisUtil.getSqlSession();
+    try (    SqlSession sqlSession = MyBatisUtil.getSqlSession()) {
 
 Review comment:
   Thank u, extra whitespace are removed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org