From b126c6c5f625432722405538692184f5c74edaad Mon Sep 17 00:00:00 2001 From: Instrumental Date: Thu, 29 Mar 2018 21:40:16 -0500 Subject: Clean up Sonar results 3 Issue-ID: AAF-206 Change-Id: I4494990e8e0bd702b475bbbfb140eaadd566d2a0 Signed-off-by: Instrumental --- auth/auth-batch/src/main/java/org/onap/aaf/auth/actions/Email.java | 2 +- auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Cred.java | 2 +- .../src/main/java/org/onap/aaf/auth/helpers/InputIterator.java | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'auth/auth-batch') diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/actions/Email.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/actions/Email.java index 0687364b..25e2ffca 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/actions/Email.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/actions/Email.java @@ -167,7 +167,7 @@ public class Email implements Action{ try { Thread.sleep(wait); } catch (InterruptedException e) { - return exec(trans,org,sb); + Thread.currentThread().interrupt(); } } return exec(trans,org,sb); diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Cred.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Cred.java index 58af03b5..1131aca7 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Cred.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Cred.java @@ -264,7 +264,7 @@ public class Cred { } public long authCount(int idx) { - return basic_auth[idx]+basic_auth_256[idx]; + return (long)basic_auth[idx]+basic_auth_256[idx]; } public long x509Count(int idx) { diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/InputIterator.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/InputIterator.java index cb0bfa6a..0afcac27 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/InputIterator.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/InputIterator.java @@ -25,6 +25,7 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.PrintStream; import java.util.Iterator; +import java.util.NoSuchElementException; public class InputIterator implements Iterable { private BufferedReader in; @@ -57,6 +58,9 @@ public class InputIterator implements Iterable { @Override public String next() { + if(!hasNext()) { + throw new NoSuchElementException(); + } return input; } -- cgit 1.2.3-korg