diff options
author | Bharath Thiruveedula <bharath.thiruveedula@verizon.com> | 2018-03-06 00:10:51 +0530 |
---|---|---|
committer | Bharath Thiruveedula <bharath.thiruveedula@verizon.com> | 2018-03-06 00:13:52 +0530 |
commit | c7423febc0617aece8f3c06171db32c9cf4d9578 (patch) | |
tree | 0772a9b30be1b0bc41975d1933c641f79b637a90 /src/main | |
parent | e3feed9c24da8eaeb148d85e2a484912bdc2050b (diff) |
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 <bharath_ves@hotmail.com>
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/onap/dcae/inventory/daos/InventoryDAOManager.java | 10 |
1 files 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<? extends InventoryDAO> 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<? extends InventoryDAO> klass) { |