Merge changes from topic "K-1"
[aaf/authz.git] / 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;