Merge "PendingRequestsShow.java- sonar fixes"
authorJonathan Gathman <jonathan.gathman@att.com>
Wed, 6 Nov 2019 12:39:42 +0000 (12:39 +0000)
committerGerrit Code Review <gerrit@onap.org>
Wed, 6 Nov 2019 12:39:42 +0000 (12:39 +0000)
auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/AbsCassDAO.java
auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/OAuthTokenDAO.java
auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Function.java
auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java
auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/perm/Create.java

index de0efdf..c68768e 100644 (file)
@@ -73,7 +73,7 @@ public abstract class AbsCassDAO<TRANS extends TransStore,DATA> {
 //    private static Slot sessionSlot; // not used since 2015
     private static final ArrayList<AbsCassDAO<? extends TransStore,?>.PSInfo> psinfos = new ArrayList<>();
     private static final List<Object> EMPTY = new ArrayList<>(0);
-    private static final Deque<ResetRequest> resetDeque = new ConcurrentLinkedDeque<ResetRequest>();
+    private static final Deque<ResetRequest> resetDeque = new ConcurrentLinkedDeque<>();
     private static boolean resetTrigger = false;
     private static long nextAvailableReset = 0;
 
@@ -96,10 +96,6 @@ public abstract class AbsCassDAO<TRANS extends TransStore,DATA> {
         this.dataClass = dataClass;
     }
 
-// Not used since 2015
-//    public static void setSessionSlot(Slot slot) {
-//        sessionSlot = slot;
-//    }
 
     //Note: Lower case ON PURPOSE. These names used to create History Messages
     public enum CRUD {
index a84490d..bda7ef0 100644 (file)
@@ -3,6 +3,7 @@
  * org.onap.aaf
  * ===========================================================================
  * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 IBM.
  * ===========================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -100,7 +101,7 @@ public class OAuthTokenDAO extends CassDAOImpl<AuthzTrans,OAuthTokenDAO.Data> {
         }
 
         public String toString() {
-            return user.toString() + ' ' + id.toString() + ' ' + Chrono.dateTime(expires) + (active?"":"in") + "active";
+            return user + ' ' + id + ' ' + Chrono.dateTime(expires) + (active?"":"in") + "active";
         }
     }
 
index d809618..89643c4 100644 (file)
@@ -297,7 +297,8 @@ public class Function {
         }
 
         // VALIDATIONS done... Add NS
-        if ((rq = q.nsDAO().create(trans, namespace.data())).notOK()) {
+        rq = q.nsDAO().create(trans, namespace.data());
+        if (rq.notOK()) {
             return Result.err(rq);
         }
 
index 8810943..c85b4ca 100644 (file)
@@ -3,7 +3,7 @@
  * org.onap.aaf
  * ===========================================================================
  * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2018 IBM.
+ * Modifications Copyright (C) 2019 IBM.
  * ===========================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -334,12 +334,10 @@ public class CMService {
                             trans.error().log("CMService var primary is null");
                         } else {
                             String fg = fqdns.get(i);
-                            if (fg!=null && primary!=null && fg.equals(primary.getHostName())) {
-                                if (i != 0) {
+                            if ((fg!=null && primary!=null && fg.equals(primary.getHostName()))&&(i != 0)) {
                                     String tmp = fqdns.get(0);
                                     fqdns.set(0, primary.getHostName());
                                     fqdns.set(i, tmp);
-                                }
                             }
                         }
                     }
index 559ae07..c444722 100644 (file)
@@ -3,6 +3,7 @@
  * org.onap.aaf
  * ===========================================================================
  * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 IBM.
  * ===========================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -149,7 +150,8 @@ public class Create extends Cmd {
     public void detailedHelp(int _indent, StringBuilder sb) {
             int indent = _indent;
         detailLine(sb,indent,"Create a Permission with:");
-        detailLine(sb,indent+=2,"type     - A Namespace qualified identifier identifying the kind of");
+        indent=indent+2;
+        detailLine(sb,indent,"type     - A Namespace qualified identifier identifying the kind of");
         detailLine(sb,indent+11,"resource to be protected");
         detailLine(sb,indent,"instance - A name that distinguishes a particular instance of resource");
         detailLine(sb,indent,"action   - What kind of action is allowed");