From c7423febc0617aece8f3c06171db32c9cf4d9578 Mon Sep 17 00:00:00 2001 From: Bharath Thiruveedula Date: Tue, 6 Mar 2018 00:10:51 +0530 Subject: Fix Sonar Issue Rename "jdbi" which hides the field declared at line 68 Sonar Link: https://sonar.onap.org/project/issues?id=org.onap.dcaegen2.platform%3Ainventory-api&open=AWEPiFFX-08if2a6xy_T&resolved=false&severities=MAJOR Change-Id: Iae7765c0d58be81b02977f2a3e9c300a8e4c757b Issue-ID: DCAEGEN2-380 Signed-off-by: Bharath Thiruveedula --- .../java/org/onap/dcae/inventory/daos/InventoryDAOManager.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/onap/dcae/inventory/daos/InventoryDAOManager.java b/src/main/java/org/onap/dcae/inventory/daos/InventoryDAOManager.java index 2bd17bf..dbdf546 100644 --- a/src/main/java/org/onap/dcae/inventory/daos/InventoryDAOManager.java +++ b/src/main/java/org/onap/dcae/inventory/daos/InventoryDAOManager.java @@ -98,11 +98,11 @@ public final class InventoryDAOManager { */ public void initialize() { final DBIFactory factory = new DBIFactory(); - final DBI jdbi = factory.build(this.environment, this.configuration.getDataSourceFactory(), "dcae-database"); - jdbi.registerArgumentFactory(new StringListArgument()); + final DBI jdbi_local = factory.build(this.environment, this.configuration.getDataSourceFactory(), "dcae-database"); + jdbi_local.registerArgumentFactory(new StringListArgument()); for (Class daoClass : DAO_CLASSES) { - final InventoryDAO dao = jdbi.onDemand(daoClass); + final InventoryDAO dao = jdbi_local.onDemand(daoClass); if (dao.checkIfTableExists()) { LOG.info(String.format("Sql table exists: %s", daoClass.getSimpleName())); @@ -114,7 +114,7 @@ public final class InventoryDAOManager { // CREATE VIEWS // TODO: This doesn't belong here and is not consistent with the above approach. Make it better. - try (Handle jdbiHandle = jdbi.open()) { + try (Handle jdbiHandle = jdbi_local.open()) { String viewName = "dcae_service_types_latest"; String checkQuery = String.format("select exists (select * from information_schema.tables where table_name = '%s')", viewName); @@ -135,7 +135,7 @@ public final class InventoryDAOManager { } // Do this assignment at the end after performing table checks to ensure that connection is good - this.jdbi = jdbi; + this.jdbi = jdbi_local; } private InventoryDAO getDAO(Class klass) { -- cgit 1.2.3-korg