Fix Sonar Issues in sli/core module

Few major issues
*Remove unused imports
To increase code readability
*Replace the type specification with the diamond operator
To reduce the verbosity of generics code
*Add the "@Override" annotation above this method signature
To increase code readability
*Remove this unnecessary cast to "String"
Unnecessary casting expressions pollutes code

Issue-Id: CCSDK-87
Change-Id: I38952f5026a5c61af73ac16706e8ddc278566b13
Signed-off-by: surya-huawei <a.u.surya@huawei.com>
diff --git a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/DBResourceManager.java b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/DBResourceManager.java
index a2eb0f9..014dab3 100755
--- a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/DBResourceManager.java
+++ b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/DBResourceManager.java
@@ -52,18 +52,7 @@
 import java.util.concurrent.ConcurrentLinkedQueue;
 import java.util.concurrent.atomic.AtomicBoolean;
 
-import javax.sql.DataSource;
-import javax.sql.rowset.CachedRowSet;
-
-import org.apache.tomcat.jdbc.pool.PoolExhaustedException;
-import org.onap.ccsdk.sli.core.dblib.config.DbConfigPool;
 import org.onap.ccsdk.sli.core.dblib.config.JDBCConfiguration;
-import org.onap.ccsdk.sli.core.dblib.factory.DBConfigFactory;
-import org.onap.ccsdk.sli.core.dblib.pm.PollingWorker;
-import org.onap.ccsdk.sli.core.dblib.pm.SQLExecutionMonitor;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * @version $Revision: 1.15 $
@@ -161,7 +150,7 @@
 	}
 
 	private void config(Properties configProps) throws Exception {
-		final ConcurrentLinkedQueue<CachedDataSource> semaphore = new ConcurrentLinkedQueue<CachedDataSource>();
+		final ConcurrentLinkedQueue<CachedDataSource> semaphore = new ConcurrentLinkedQueue<>();
 		final DbConfigPool dbConfig = DBConfigFactory.createConfig(configProps);
 
 		long startTime = System.currentTimeMillis();
@@ -268,7 +257,7 @@
 		String value = null;
 		long tmpLongValue = defaultValue;
 		try {
-			value = (String)props.getProperty(property);
+			value = props.getProperty(property);
 			if(value != null)
 				tmpLongValue = Long.parseLong(value);
 
@@ -288,7 +277,7 @@
 		String value = null;
 
 		try {
-			value = (String)props.getProperty(property);
+			value = props.getProperty(property);
 			if(value != null)
 				tmpValue = Boolean.parseBoolean(value);
 
@@ -303,6 +292,7 @@
 	}
 
 
+	@Override
 	public void update(Observable observable, Object data) {
 		// if observable is active and there is a standby available, switch
 		if(observable instanceof SQLExecutionMonitor)
@@ -400,7 +390,7 @@
 		CachedDataSource active = null;
 
 		// test if there are any connection pools available
-		LinkedList<CachedDataSource> sources = new LinkedList<CachedDataSource>(this.dsQueue);
+		LinkedList<CachedDataSource> sources = new LinkedList<>(this.dsQueue);
 		if(sources.isEmpty()){
 			LOGGER.error("Generated alarm: DBResourceManager.getData - No active DB connection pools are available.");
 			throw new DBLibException("No active DB connection pools are available in RequestDataWithRecovery call.");
@@ -603,6 +593,7 @@
 		}
 	}
 
+	@Override
 	public Connection getConnection() throws SQLException {
 		Throwable lastException = null;
 		CachedDataSource active = null;
@@ -664,6 +655,7 @@
 		}
 	}
 
+	@Override
 	public Connection getConnection(String username, String password)
 	throws SQLException {
 		CachedDataSource active = null;
@@ -754,18 +746,22 @@
 		}
 	}
 
+	@Override
 	public PrintWriter getLogWriter() throws SQLException {
 		return ((CachedDataSource)this.dsQueue.peek()).getLogWriter();
 	}
 
+	@Override
 	public int getLoginTimeout() throws SQLException {
 		return ((CachedDataSource)this.dsQueue.peek()).getLoginTimeout();
 	}
 
+	@Override
 	public void setLogWriter(PrintWriter out) throws SQLException {
 		((CachedDataSource)this.dsQueue.peek()).setLogWriter(out);
 	}
 
+	@Override
 	public void setLoginTimeout(int seconds) throws SQLException {
 		((CachedDataSource)this.dsQueue.peek()).setLoginTimeout(seconds);
 	}
@@ -795,7 +791,7 @@
 	public String getDBStatus(boolean htmlFormat) {
 		StringBuilder buffer = new StringBuilder();
 
-		ArrayList<CachedDataSource> list = new ArrayList<CachedDataSource>();
+		ArrayList<CachedDataSource> list = new ArrayList<>();
 		list.addAll(dsQueue);
 		list.addAll(broken);
 		if (htmlFormat)
@@ -843,10 +839,12 @@
 		return buffer.toString();
 	}
 
+	@Override
 	public boolean isWrapperFor(Class<?> iface) throws SQLException {
 		return false;
 	}
 
+	@Override
 	public <T> T unwrap(Class<T> iface) throws SQLException {
 		return null;
 	}
@@ -854,6 +852,7 @@
 	/**
 	 * @return the monitorDbResponse
 	 */
+	@Override
 	public final boolean isMonitorDbResponse() {
 		return recoveryMode && monitorDbResponse;
 	}
@@ -880,7 +879,7 @@
 
 	public String getPreferredDataSourceName(AtomicBoolean flipper) {
 
-		LinkedList<CachedDataSource> snapshot = new LinkedList<CachedDataSource>(dsQueue);
+		LinkedList<CachedDataSource> snapshot = new LinkedList<>(dsQueue);
 		if(snapshot.size() > 1){
 			CachedDataSource first = snapshot.getFirst();
 			CachedDataSource last = snapshot.getLast();
@@ -901,6 +900,7 @@
 		return snapshot.peek().getDbConnectionName();
 	}
 
+	@Override
 	public java.util.logging.Logger getParentLogger()
 			throws SQLFeatureNotSupportedException {
 		return null;
@@ -916,7 +916,7 @@
 
 	private String getMasterDataSourceName(AtomicBoolean flipper) {
 
-		LinkedList<CachedDataSource> snapshot = new LinkedList<CachedDataSource>(dsQueue);
+		LinkedList<CachedDataSource> snapshot = new LinkedList<>(dsQueue);
 		if(snapshot.size() > 1){
 			CachedDataSource first = snapshot.getFirst();
 			CachedDataSource last = snapshot.getLast();
@@ -938,7 +938,8 @@
 	}
 
     class RemindTask extends TimerTask {
-        public void run() {
+        @Override
+		public void run() {
 			CachedDataSource ds = dsQueue.peek();
 			if(ds != null)
 				ds.getPoolInfo(false);