Fix Sonar Issues

few major issues in sli/adaptors module

Issue-Id: CCSDK-87
Change-Id: I43865634fa7d5f5d1b84c7efff691047cfcd5feb
Signed-off-by: surya-huawei <a.u.surya@huawei.com>
diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIDeclarations.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIDeclarations.java
index 413d85a..61df170 100644
--- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIDeclarations.java
+++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIDeclarations.java
@@ -245,7 +245,8 @@
 							}
 							ctx.setAttribute(prefix + ".error.message", exc.getMessage());
 							if(errorCode >= 300) {
-								ctx.setAttribute(prefix + ".error.http.response-code", "" + exc.getReturnCode());
+								ctx.setAttribute(prefix + ".error.http.response-code",
+												 Integer.toString(exc.getReturnCode()));
 							}
 							return QueryStatus.FAILURE;
 						}
@@ -1295,8 +1296,8 @@
 						j++;
 					}
 						AAIRequest rlRequest = AAIRequest.createRequest(relatedTo, relParams);
-						for(String key1 : relParams.keySet()) {
-							rlRequest.addRequestProperty(key1, relParams.get(key1));
+						for(Map.Entry<String,String> entry : relParams.entrySet()) {
+							rlRequest.addRequestProperty(entry.getKey(), entry.getValue());
 						}
 						String path = rlRequest.updatePathDataValues(null);
 						relationship.setRelatedLink(path);
diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIRequest.java
index c6145f8..03121ac 100644
--- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIRequest.java
+++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIRequest.java
@@ -140,11 +140,11 @@
 	/**
 	 * Map containing resource tag to its bit position in bitset mapping
 	 */
-	private static Map<String, String> tagValues = new LinkedHashMap<String, String>();
+	private static Map<String, String> tagValues = new LinkedHashMap<>();
 	/**
 	 * Map containing bitset value of the path to its path mapping
 	 */
-	private static Map<BitSet, String> bitsetPaths = new LinkedHashMap<BitSet, String>();
+	private static Map<BitSet, String> bitsetPaths = new LinkedHashMap<>();
 
 
 	public static Set<String> getResourceNames() {
@@ -180,7 +180,7 @@
 			Set<String> keys = properties.stringPropertyNames();
 
 			int index = 0;
-			Set<String> resourceNames = new TreeSet<String>();
+			Set<String> resourceNames = new TreeSet<>();
 
 			for(String key : keys) {
 				String[] tags = key.split("\\|");
@@ -325,8 +325,8 @@
 	}
 
 	protected static Set<String> extractUniqueResourceSetFromKeys(Set<String> keySet) {
-		Set<String> uniqueResources = new TreeSet<String>();
-		List<String> keys = new ArrayList<String>(keySet);
+		Set<String> uniqueResources = new TreeSet<>();
+		List<String> keys = new ArrayList<>(keySet);
 		for(String resource : keys) {
 			if(resource.contains(".")) {
 				String [] split = resource.split("\\.");
@@ -339,7 +339,7 @@
 	public void processRequestPathValues(Map<String, String> nameValues) {
 		Set<String> uniqueResources = extractUniqueResourceSetFromKeys(nameValues.keySet());
 
-		Set<String> tokens = new TreeSet<String>();
+		Set<String> tokens = new TreeSet<>();
 		tokens.add(DEPTH);
 		tokens.addAll(Arrays.asList(this.getArgsList()));
 
@@ -409,12 +409,12 @@
 	}
 
 	public static Map<String, String> splitQuery(String query) throws UnsupportedEncodingException {
-	    Map<String, String> query_pairs = new LinkedHashMap<String, String>();
+	    Map<String, String> query_pairs = new LinkedHashMap<>();
 
 	    if(query != null && !query.isEmpty()) {
 	    	String[] pairs = query.split("&");
 	    	for (String pair : pairs) {
-	    		int idx = pair.indexOf("=");
+	    		int idx = pair.indexOf('=');
 	    		query_pairs.put(URLDecoder.decode(pair.substring(0, idx), "UTF-8"), URLDecoder.decode(pair.substring(idx + 1), "UTF-8"));
 	    	}
 	    }
@@ -422,12 +422,12 @@
 	}
 
 	public static Map<String, String> splitPath(String path) throws UnsupportedEncodingException {
-	    Map<String, String> query_pairs = new LinkedHashMap<String, String>();
+	    Map<String, String> query_pairs = new LinkedHashMap<>();
 
 	    if(path != null && !path.isEmpty()) {
 	    	String[] pairs = path.split("/");
 	    	for (String pair : pairs) {
-	    		int idx = pair.indexOf("=");
+	    		int idx = pair.indexOf('=');
 	    		query_pairs.put(URLDecoder.decode(pair.substring(0, idx), "UTF-8"), URLDecoder.decode(pair.substring(idx + 1), "UTF-8"));
 	    	}
 	    }