Sonar Fixes, Formatting
[aaf/authz.git] / auth / auth-batch / src / main / java / org / onap / aaf / auth / batch / helpers / CQLBatch.java
index d62c778..ccfb1c5 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -47,7 +47,7 @@ public class CQLBatch {
         hasAdded = sb.length();
         return sb;
     }
-    
+
     private boolean end() {
         if(sb.length()==hasAdded) {
             return false;
@@ -57,7 +57,7 @@ public class CQLBatch {
             return true;
         }
     }
-    
+
     public ResultSet execute() {
         if(end()) {
             if(sleep>0) {
@@ -66,17 +66,19 @@ public class CQLBatch {
                     try {
                         Thread.sleep(left);
                     } catch (InterruptedException e) {
-                        Access.NULL.log(e); // Keep code check idiocy at bay
+                        // PER ORACLE, this isn't actually needed, but Sonar idiocy
+                        // requires something or flags as error.
+                        return null;
                     }
                 }
-                last = System.currentTimeMillis()+sleep;
+                last = System.currentTimeMillis() + sleep;
             }
             return session.execute(sb.toString());
         } else {
             return null;
         }
     }
-    
+
     public ResultSet execute(boolean dryRun) {
         ResultSet rv = null;
         if(dryRun) {
@@ -86,10 +88,12 @@ public class CQLBatch {
                     try {
                         Thread.sleep(left);
                     } catch (InterruptedException e) {
-                        Access.NULL.log(e); // Keep code check idiocy at bay
+                        // PER ORACLE, this isn't actually needed, but Sonar idiocy
+                        // requires something or flags as error.
+                        return null;
                     }
                 }
-                last = System.currentTimeMillis()+sleep;
+                last = System.currentTimeMillis() + sleep;
             }
             end();
         } else {
@@ -98,7 +102,7 @@ public class CQLBatch {
         sb.setLength(0);
         return rv;
     }
-    
+
     public ResultSet singleExec(StringBuilder query, boolean dryRun) {
         if(dryRun) {
             return null;
@@ -106,10 +110,10 @@ public class CQLBatch {
             return session.execute(query.toString());
         }
     }
-    
+
     public void touch(String table, int begin, int end, boolean dryRun) {
         StringBuilder sb = begin();
-        for(int i=begin;i<end;++i) {
+        for(int i=begin; i<end; ++i) {
             sb.append("UPDATE cache SET touched=dateof(now()) WHERE name='");
             sb.append(table);
             sb.append("' AND seg=");
@@ -118,11 +122,11 @@ public class CQLBatch {
         }
         execute(dryRun);
     }
-    
-    public void sleep(int j) {
+
+    public void sleep(long j) {
         sleep = j*1000;
     }
-    
+
     public String toString() {
         return sb.toString();
     }