Merge this if statement with the enclosing one. 56/95456/1
authorThugutla sailakshmi <tsaila10@in.ibm.com>
Wed, 11 Sep 2019 06:14:10 +0000 (11:44 +0530)
committerThugutla sailakshmi <tsaila10@in.ibm.com>
Wed, 11 Sep 2019 06:15:06 +0000 (11:45 +0530)
Merge this if statement with the enclosing one.

Issue-ID: AAF-876
Change-Id: I45abf792e8d578f5f2faf7612619131a12c8716c
Signed-off-by: Thugutla sailakshmi <tsaila10@in.ibm.com>
auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/CQLBatchLoop.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;