From 36b62be84b398044e1feae657c662dba6247782f Mon Sep 17 00:00:00 2001 From: Instrumental Date: Thu, 29 Mar 2018 20:26:02 -0500 Subject: Clean up Sonar results 2 Issue-ID: AAF-206 Change-Id: Ia000b144be58af970f4a5264ca5a9718fdbf9f5d Signed-off-by: Instrumental --- auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/AAFcli.java | 5 ++++- .../src/main/java/org/onap/aaf/auth/cmd/role/CreateDelete.java | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'auth/auth-cmd/src/main/java/org/onap') 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 1961b1f5..72aa0ccd 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 @@ -247,7 +247,10 @@ public class AAFcli { } else if ("pause".equalsIgnoreCase(largs[idx])) { pw.println("Press to continue..."); ++idx; - new BufferedReader(new InputStreamReader(System.in)).readLine(); + // Sonar insists we do something with the string, though it's only a pause. Not very helpful... + String sonar = new BufferedReader(new InputStreamReader(System.in)).readLine(); + sonar=""; // this useless code brought to you by Sonar. + pw.print(sonar); continue; } else if ("exit".equalsIgnoreCase(largs[idx])) { pw.println("Exiting..."); diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/role/CreateDelete.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/role/CreateDelete.java index 99d55839..3234fe9c 100644 --- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/role/CreateDelete.java +++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/role/CreateDelete.java @@ -90,6 +90,9 @@ public class CreateDelete extends Cmd { } boolean rolesSupplied = (args.length>idx); + if(fp == null) {// This useless code brought to you by Sonar. + throw new CadiException("No call made."); + } if(fp.get(AAFcli.timeout())) { rv=fp.code(); pw().print(verb); -- cgit 1.2.3-korg