Merge "Sonar Fix: ApprovalDAO.java"
[aaf/authz.git] / auth / auth-cmd / src / main / java / org / onap / aaf / auth / cmd / AAFcli.java
index edbe206..9e01d7c 100644 (file)
@@ -123,7 +123,11 @@ public class AAFcli {
         cmds.add(new Mgmt(this));
     }
 
-    public static int timeout() {
+    public AuthzEnv env() {
+               return env;
+       }
+
+       public static int timeout() {
         return TIMEOUT;
     }
 
@@ -328,7 +332,7 @@ public class AAFcli {
                             Thread.sleep((long)(delay+globalDelay));
                         }
                     } catch (Exception e) {
-                        if (expect.contains(-1)) {
+                       if (expect.contains(-1)) {
                             pw.println(e.getMessage());
                             ret = -1;
                         } else {
@@ -337,7 +341,7 @@ public class AAFcli {
                     } finally {
                         clearSingleLineProperties();
                     }
-                    rv = expect.isEmpty() ? true : expect.contains(ret);
+                    rv = expect.isEmpty() || expect.contains(ret);
                     if (verbose) {
                         if (rv) {
                             pw.println();
@@ -538,7 +542,7 @@ public class AAFcli {
                 
                                     String line;
                                     while ((line = reader.readLine()) != null) {
-                                        showDetails = (line.contains("-d"))?true:false;
+                                        showDetails = (line.contains("-d"));
                 
                                         if (line.equalsIgnoreCase("quit") || line.equalsIgnoreCase("q") || line.equalsIgnoreCase("exit")) {
                                             break;