diff options
Diffstat (limited to 'auth/auth-cmd/src/main')
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()); |