From a4bdcb48203015685c1cda87e94a3e9e0aa54e01 Mon Sep 17 00:00:00 2001 From: Thugutla sailakshmi Date: Wed, 11 Sep 2019 11:44:10 +0530 Subject: Merge this if statement with the enclosing one. Merge this if statement with the enclosing one. Issue-ID: AAF-876 Change-Id: I45abf792e8d578f5f2faf7612619131a12c8716c Signed-off-by: Thugutla sailakshmi --- .../java/org/onap/aaf/auth/batch/helpers/CQLBatchLoop.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'auth') diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/CQLBatchLoop.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/CQLBatchLoop.java index 1a1bdf33..9cd7341c 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/CQLBatchLoop.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/CQLBatchLoop.java @@ -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; -- cgit 1.2.3-korg From bfc1adc274e1efff72b7914a718cd7c96176a763 Mon Sep 17 00:00:00 2001 From: Thugutla sailakshmi Date: Wed, 11 Sep 2019 11:52:13 +0530 Subject: Remove useless curly braces around statement Remove useless curly braces around statement Issue-ID: AAF-876 Change-Id: I612587a2d71f9a928c0abebd338235f613837815 Signed-off-by: Thugutla sailakshmi --- .../src/main/java/org/onap/aaf/auth/batch/helpers/UserRole.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'auth') diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/UserRole.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/UserRole.java index d5c0d771..dd24d7d9 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/UserRole.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/UserRole.java @@ -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 creator, Visitor 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 creator, String where, Visitor visitor) { -- cgit 1.2.3-korg From 6b9175cf95436283fe69fcb61e6186e18d00161d Mon Sep 17 00:00:00 2001 From: Thugutla sailakshmi Date: Wed, 11 Sep 2019 11:58:22 +0530 Subject: Merge this if statement with the enclosing one Merge this if statement with the enclosing one Issue-ID: AAF-876 Change-Id: I5c4642457c735d12343e058c14453adde2be3cb1 Signed-off-by: Thugutla sailakshmi --- .../java/org/onap/aaf/auth/batch/reports/bodies/NotifyBody.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'auth') diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/bodies/NotifyBody.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/bodies/NotifyBody.java index ec8d1451..6c95f02e 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/bodies/NotifyBody.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/bodies/NotifyBody.java @@ -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(); -- cgit 1.2.3-korg