cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From santhosheduku...@apache.org
Subject git commit: updated refs/heads/master to a7e3861
Date Thu, 31 Jul 2014 11:27:47 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 6133bda64 -> a7e3861f5


Fixed Coverity Issues


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

Branch: refs/heads/master
Commit: a7e3861f5e20bcd40d098b4d7f41e96261c81d96
Parents: 6133bda
Author: Santhosh Edukulla <santhosh.edukulla@gmail.com>
Authored: Thu Jul 31 16:57:20 2014 +0530
Committer: Santhosh Edukulla <santhosh.edukulla@gmail.com>
Committed: Thu Jul 31 16:57:20 2014 +0530

----------------------------------------------------------------------
 .../storage/dao/StoragePoolHostDaoImpl.java     | 37 +++++++-------------
 .../adapter/AwtVncKeyboardAdapter.java          |  2 +-
 2 files changed, 13 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a7e3861f/engine/schema/src/com/cloud/storage/dao/StoragePoolHostDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/storage/dao/StoragePoolHostDaoImpl.java b/engine/schema/src/com/cloud/storage/dao/StoragePoolHostDaoImpl.java
index e11c6d5..c1a7657 100644
--- a/engine/schema/src/com/cloud/storage/dao/StoragePoolHostDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/StoragePoolHostDaoImpl.java
@@ -102,37 +102,25 @@ public class StoragePoolHostDaoImpl extends GenericDaoBase<StoragePoolHostVO,
Lo
     @Override
     public List<StoragePoolHostVO> listByHostStatus(long poolId, Status hostStatus)
{
         TransactionLegacy txn = TransactionLegacy.currentTxn();
-        PreparedStatement pstmt = null;
+        String sql = HOST_FOR_POOL_SEARCH;
         List<StoragePoolHostVO> result = new ArrayList<StoragePoolHostVO>();
-        ResultSet rs = null;
-        try {
-            String sql = HOST_FOR_POOL_SEARCH;
-            pstmt = txn.prepareStatement(sql);
-
+        try(PreparedStatement pstmt = txn.prepareStatement(sql);) {
             pstmt.setLong(1, poolId);
             pstmt.setString(2, hostStatus.toString());
-            rs = pstmt.executeQuery();
-            while (rs.next()) {
-                // result.add(toEntityBean(rs, false)); TODO: this is buggy in
-                // GenericDaoBase for hand constructed queries
-                long id = rs.getLong(1); // ID column
-                result.add(findById(id));
-            }
-        } catch (Exception e) {
-            s_logger.warn("Exception: ", e);
-        } finally {
-            try {
-                if (rs != null) {
-                    rs.close();
-                }
-                if (pstmt != null) {
-                    pstmt.close();
+            try(ResultSet rs = pstmt.executeQuery();) {
+                while (rs.next()) {
+                    // result.add(toEntityBean(rs, false)); TODO: this is buggy in
+                    // GenericDaoBase for hand constructed queries
+                    long id = rs.getLong(1); // ID column
+                    result.add(findById(id));
                 }
-            } catch (SQLException e) {
+            }catch (SQLException e) {
+                s_logger.warn("listByHostStatus:Exception: ", e);
             }
+        } catch (Exception e) {
+            s_logger.warn("listByHostStatus:Exception: ", e);
         }
         return result;
-
     }
 
     @Override
@@ -140,7 +128,6 @@ public class StoragePoolHostDaoImpl extends GenericDaoBase<StoragePoolHostVO,
Lo
         ArrayList<Pair<Long, Integer>> l = new ArrayList<Pair<Long, Integer>>();
         String sql = sharedOnly ? SHARED_STORAGE_POOL_HOST_INFO : STORAGE_POOL_HOST_INFO;
         TransactionLegacy txn = TransactionLegacy.currentTxn();
-        ;
         PreparedStatement pstmt = null;
         try {
             pstmt = txn.prepareAutoCloseStatement(sql);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a7e3861f/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/adapter/AwtVncKeyboardAdapter.java
----------------------------------------------------------------------
diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/adapter/AwtVncKeyboardAdapter.java
b/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/adapter/AwtVncKeyboardAdapter.java
index 6b50e35..ac6d1ab 100755
--- a/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/adapter/AwtVncKeyboardAdapter.java
+++ b/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/adapter/AwtVncKeyboardAdapter.java
@@ -205,7 +205,7 @@ public class AwtVncKeyboardAdapter extends BaseElement {
         case KeyEvent.VK_N:
             return (sh ^ caps) ? 'N' : 'n';
         case KeyEvent.VK_M:
-            return (sh ^ caps) ? 'M' : 'M';
+            return (sh ^ caps) ? 'M' : 'm';
         case KeyEvent.VK_COMMA:
             return (sh) ? '<' : ',';
         case KeyEvent.VK_PERIOD:


Mime
View raw message