Merge changes from topic "K-1"
authorJonathan Gathman <jonathan.gathman@att.com>
Tue, 17 Sep 2019 08:11:44 +0000 (08:11 +0000)
committerGerrit Code Review <gerrit@onap.org>
Tue, 17 Sep 2019 08:11:44 +0000 (08:11 +0000)
* changes:
  Merge this if statement with the enclosing one
  Remove useless curly braces around statement
  Merge this if statement with the enclosing one.

auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/CQLBatchLoop.java
auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/UserRole.java
auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/bodies/NotifyBody.java

index 1a1bdf3..9cd7341 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.
@@ -51,15 +52,14 @@ public class CQLBatchLoop {
     /**
      * Assume this is another line in the Batch
      * @return
-     */
+     */        
     public StringBuilder inc() {
-        if(i>=maxBatch || current.length()+sb.length()>MAX_CHARS) {
-            if(i>0) {
-                cqlBatch.execute(dryRun);
+        if((i>=maxBatch || current.length()+sb.length()>MAX_CHARS)&&(i>0)) {
+            
+                   cqlBatch.execute(dryRun);
                 i = -1;
                 incBatch();
-            }
-        }
+    }
         if(i<0) {
             cqlBatch.begin();
             i=0;
index d5c0d77..dd24d7d 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.
@@ -128,10 +129,10 @@ public class UserRole implements Cloneable, CacheChange.Data  {
 
     public static void load(Trans trans, CSV csv, Creator<UserRole> creator, Visitor<UserRole> visitor) throws IOException, CadiException {
 //        public UserRole(String user, String role, String ns, String rname, Date expires) {
-        csv.visit( row -> {
+        csv.visit( row -> 
             visitor.visit(new UserRole(row.get(1),row.get(2),row.get(3),row.get(4),
-                new Date(Long.parseLong(row.get(6)))));
-        });
+                new Date(Long.parseLong(row.get(6)))))
+        );
     }
     
     private static void load(Trans trans, Session session, Creator<UserRole> creator, String where, Visitor<UserRole> visitor) {
index ec8d145..6c95f02 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.
@@ -205,15 +206,13 @@ public abstract class NotifyBody {
         for(String cls : classNames) {
             try {
                 Class<?> c = cl.loadClass(cls);
-                if(c!=null) {
-                    if(!Modifier.isAbstract(c.getModifiers())) {
-                        Constructor<?> cst = c.getConstructor(Access.class);
+                if((c!=null)&&(!Modifier.isAbstract(c.getModifiers()))) {
+                       Constructor<?> cst = c.getConstructor(Access.class);
                         NotifyBody nb = (NotifyBody)cst.newInstance(access);
                         if(nb!=null) {
                             bodyMap.put("info|"+nb.name, nb);
                             bodyMap.put(nb.type+'|'+nb.name, nb);
-                        }
-                    }
+                          }
                 }
             } catch (ClassNotFoundException | NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
                 e.printStackTrace();