summaryrefslogtreecommitdiffstats
path: root/auth/auth-cmd/src/main/java/org
diff options
context:
space:
mode:
authorInstrumental <jcgmisc@stl.gathman.org>2018-03-29 19:02:24 -0500
committerInstrumental <jcgmisc@stl.gathman.org>2018-03-29 19:02:44 -0500
commitd86dd644e1543743cfcbc83b230bd4f2cb2e5d4e (patch)
tree698e12f7c0142441cd494cd68da03437e510d0b0 /auth/auth-cmd/src/main/java/org
parent17ca744723bd652f15d59d6c8555824f6e49018d (diff)
Clean up Sonar results 1
Issue-ID: AAF-206 Change-Id: If1fced5b528490a52691508fb1e30962dbe28856 Signed-off-by: Instrumental <jcgmisc@stl.gathman.org>
Diffstat (limited to 'auth/auth-cmd/src/main/java/org')
-rw-r--r--auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/AAFcli.java2
-rw-r--r--auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/Attrib.java16
-rw-r--r--auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/Cred.java3
-rw-r--r--auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/List.java2
4 files changed, 14 insertions, 9 deletions
diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/AAFcli.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/AAFcli.java
index e8069b8e..1961b1f5 100644
--- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/AAFcli.java
+++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/AAFcli.java
@@ -324,7 +324,7 @@ public class AAFcli {
try {
ret = c.exec(++idx, largs);
if (delay+globalDelay > 0) {
- Thread.sleep(delay+globalDelay);
+ Thread.sleep((long)(delay+globalDelay));
}
} catch (Exception e) {
if (expect.contains(-1)) {
diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/Attrib.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/Attrib.java
index cc0d2586..19caa4f4 100644
--- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/Attrib.java
+++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/Attrib.java
@@ -83,15 +83,17 @@ public class Attrib extends BaseCmd<NS> {
default:
throw new CadiException("Bad Argument");
};
-
- if(fp.get(AAFcli.timeout())) {
- pw().println(message);
+ if(fp==null) {
+ return 500;
} else {
- error(fp);
- return fp.code();
+ if(fp.get(AAFcli.timeout())) {
+ pw().println(message);
+ } else {
+ error(fp);
+ }
+
+ return fp.code();
}
-
- return fp==null?500:fp.code();
}
});
}
diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/Cred.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/Cred.java
index 4bb2ae30..10333091 100644
--- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/Cred.java
+++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/Cred.java
@@ -109,6 +109,9 @@ public class Cred extends Cmd {
// case 4:
// return clean.exec(cleanIDX, args);
}
+ if(fp==null) {
+ return null; // get by Sonar check.
+ }
if(fp.get(AAFcli.timeout())) {
pw().print(verb);
pw().print(cr.getId());
diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/List.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/List.java
index 5c87f906..a977431c 100644
--- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/List.java
+++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/List.java
@@ -53,7 +53,7 @@ public class List extends BaseCmd<User> {
Collections.sort(sorted, new Comparator<aaf.v2_0.Users.User>() {
@Override
public int compare(aaf.v2_0.Users.User u1, aaf.v2_0.Users.User u2) {
- if(u2==null || u2 == null) {
+ if(u1==null || u2 == null) {
return -1;
}
return u1.getId().compareTo(u2.getId());