From 9c72587e6a8303bf93586823907165ce9913a19f Mon Sep 17 00:00:00 2001 From: surya-huawei Date: Thu, 12 Oct 2017 10:42:37 +0530 Subject: Remove toString called on String object *Removed toString on a string object This is a redundant construction and saves keystrokes *Replace type specification in constructor with diamond operator This is to reduce verbosity of generics code Issue-Id: CCSDK-117 Change-Id: I5669450e8b5364eb9b01831b26a77596adf6c21a Signed-off-by: surya-huawei --- .../java/org/onap/ccsdk/sli/adaptors/aai/AAIDeclarations.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 f1663d2d..0f7e9981 100755 --- 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 @@ -740,7 +740,7 @@ public abstract class AAIDeclarations implements AAIClient { boolean itemRemoved = false; RelationshipList relationshipList = vnf.getRelationshipList(); List relationships = relationshipList.getRelationship(); - List iterableList = new LinkedList(relationships); + List iterableList = new LinkedList<>(relationships); for(Relationship relationship : iterableList) { if(relationship.getRelatedTo().equals(relatedTo)) { relationships.remove(relationship); @@ -1154,7 +1154,7 @@ public abstract class AAIDeclarations implements AAIClient { List newValues = new ArrayList<>(); String length = id+"_length"; if(!params.isEmpty() && params.containsKey(length)) { - String tmp = params.get(length).toString(); + String tmp = params.get(length); int count = Integer.parseInt(tmp); for(int i=0; i relData = relationship.getRelationshipData(); - Map relParams = new HashMap(); + Map relParams = new HashMap<>(); while(true) { String searchRelationshipKey = "relationship-list.relationship[" + i + "].relationship-data[" + j + "].relationship-key"; @@ -1544,7 +1544,7 @@ public abstract class AAIDeclarations implements AAIClient { boolean createdNewRelationships = false; List relationships = relationshipList.getRelationship(); if(relationships == null) { - relationships = new ArrayList(); + relationships = new ArrayList<>(); createdNewRelationships = true; } @@ -1745,7 +1745,7 @@ public abstract class AAIDeclarations implements AAIClient { } List relationships = relationshipList.getRelationship(); - List relationshipsToDelete = new LinkedList(); + List relationshipsToDelete = new LinkedList<>(); for(Relationship relationship : relationships) { if(relatedTo.equals(relationship.getRelatedTo())) { -- cgit 1.2.3-korg