cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [17/30] git commit: updated refs/heads/master to 64ff67d
Date Fri, 14 Aug 2015 19:47:40 GMT
CLOUDSTACK-8656: unnecessary close construct removed

Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/6227c44c
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/6227c44c
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/6227c44c

Branch: refs/heads/master
Commit: 6227c44ca4d00e521654faa68747ae7b05dce62d
Parents: 08e6e16
Author: Daan Hoogland <daan@onecht.net>
Authored: Fri Aug 14 13:59:59 2015 +0200
Committer: Daan Hoogland <daan@onecht.net>
Committed: Fri Aug 14 13:59:59 2015 +0200

----------------------------------------------------------------------
 .../schema/src/com/cloud/upgrade/dao/Upgrade40to41.java  | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6227c44c/engine/schema/src/com/cloud/upgrade/dao/Upgrade40to41.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade40to41.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade40to41.java
index 29bd67e..ab683fc 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade40to41.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade40to41.java
@@ -82,23 +82,14 @@ public class Upgrade40to41 implements DbUpgrade {
         if (regionId != null) {
             region_id = Integer.parseInt(regionId);
         }
-        PreparedStatement pstmt = null;
-        try {
+        try (PreparedStatement pstmt = conn.prepareStatement("update `cloud`.`region` set
id = ?");) {
             //Update regionId in region table
             s_logger.debug("Updating region table with Id: " + region_id);
-            pstmt = conn.prepareStatement("update `cloud`.`region` set id = ?");
             pstmt.setInt(1, region_id);
             pstmt.executeUpdate();
 
         } catch (SQLException e) {
             throw new CloudRuntimeException("Error while updating region entries", e);
-        } finally {
-            try {
-                if (pstmt != null) {
-                    pstmt.close();
-                }
-            } catch (SQLException e) {
-            }
         }
     }
 


Mime
View raw message