major-Extract the assignment out of this expression 16/95016/1
authorThugutla sailakshmi <tsaila10@in.ibm.com>
Thu, 5 Sep 2019 09:29:04 +0000 (14:59 +0530)
committerThugutla sailakshmi <tsaila10@in.ibm.com>
Thu, 5 Sep 2019 09:30:30 +0000 (15:00 +0530)
Extract the assignment out of this expression

Issue-ID: AAF-876
Change-Id: I112c451303b11b2c0afd13b23b4c2530abf0a7d1
Signed-off-by: Thugutla sailakshmi <tsaila10@in.ibm.com>
auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Cred.java

index 83638cc..14d65d4 100644 (file)
@@ -3,6 +3,7 @@
  * org.onap.aaf
  * ===========================================================================
  * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 IBM.
  * ===========================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -203,9 +204,10 @@ public class Cred  {
         }
         cred.instances.add(new Instance(type, timestamp, other, written/1000,tag));
         
-        List<Cred> lscd = byNS.get(cred.ns);
+        List<Cred> lscd = byNS.get(cred.ns);   
         if (lscd==null) {
-            byNS.put(cred.ns, (lscd=new ArrayList<>()));
+               lscd=new ArrayList<>();
+            byNS.put(cred.ns,lscd);
         }
         boolean found = false;
         for (Cred c : lscd) {