Merge "Fixed Sonar issues in NodeClass.java"
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/NodeClass.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/NodeClass.java
index 1b36851..9d43bd0 100755
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/NodeClass.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/NodeClass.java
@@ -105,20 +105,20 @@
     public static void reload() {

         Map<String, Integer> m = new HashMap<String, Integer>();

         PreparedStatement ps = null;

-        ResultSet rs=null;

+

         try {

             DB db = new DB();

             @SuppressWarnings("resource")

             Connection conn = db.getConnection();

             String sql = "select NODEID, NAME from NODES";

             ps = conn.prepareStatement(sql);

-            rs = ps.executeQuery();

-            while (rs.next()) {

-                int id = rs.getInt("NODEID");

-                String name = rs.getString("NAME");

-                m.put(name, id);

+            try(ResultSet rs = ps.executeQuery()) {

+                while (rs.next()) {

+                    int id = rs.getInt("NODEID");

+                    String name = rs.getString("NAME");

+                    m.put(name, id);

+                }

             }

-            rs.close();

             ps.close();

             db.release(conn);

         } catch (SQLException e) {

@@ -128,10 +128,6 @@
                 if(ps!=null){

                     ps.close();

                 }

-                if(rs!=null){

-                    rs.close();

-                }

-

             } catch (SQLException e) {

                 intLogger.error("PROV0005 doInsert: " + e.getMessage(),e);

             }