Sonar Fixes, Formatting
[aaf/authz.git] / cadi / aaf / src / main / java / org / onap / aaf / cadi / olur / OLur.java
index c67f986..5b78585 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -56,13 +56,13 @@ public class OLur extends AbsOTafLur implements Lur {
     @Override
     public boolean fish(Principal bait, Permission ... pond) {
         TokenPerm tp;
-        if(bait instanceof OAuth2Principal) {
+        if (bait instanceof OAuth2Principal) {
             OAuth2Principal oa2p = (OAuth2Principal)bait;
             tp = oa2p.tokenPerm();
         } else {
             tp=null;
         }
-        if(tp==null) { 
+        if (tp==null) {
             // if no Token Perm preset, get
             try {
                 Pooled<TokenClient> tcp = tokenClientPool.get();
@@ -73,18 +73,18 @@ public class OLur extends AbsOTafLur implements Lur {
                     scopeSet.add(tc.defaultScope());
                     AAFPermission ap;
                     for (Permission p : pond) {
-                        if(p instanceof AAFPermission) {
+                        if (p instanceof AAFPermission) {
                             ap = (AAFPermission)p;
                             scopeSet.add(ap.getNS());
                         }
                     }
                     String[] scopes = new String[scopeSet.size()];
                     scopeSet.toArray(scopes);
-                    
+
                     Result<TimedToken> rtt = tc.getToken(Kind.getKind(bait),scopes);
-                    if(rtt.isOK()) {
+                    if (rtt.isOK()) {
                         Result<TokenPerm> rtp = tkMgr.get(rtt.value.getAccessToken(), bait.getName().getBytes());
-                        if(rtp.isOK()) {
+                        if (rtp.isOK()) {
                             tp = rtp.value;
                         }
                     }
@@ -95,18 +95,18 @@ public class OLur extends AbsOTafLur implements Lur {
                 access.log(e, "Unable to Get a Token");
             }
         }
-        
+
         boolean rv = false;
-        if(tp!=null) {
-            if(tkMgr.access.willLog(Level.DEBUG)) {
+        if (tp!=null) {
+            if (tkMgr.access.willLog(Level.DEBUG)) {
                 StringBuilder sb = new StringBuilder("AAF Permissions for user ");
                 sb.append(bait.getName());
-                sb.append(", from token ");            
+                sb.append(", from token ");
                 sb.append(tp.get().getAccessToken());
                 for (AAFPermission p : tp.perms()) {
                     sb.append("\n\t[");
                     sb.append(p.getNS());
-                    sb.append(']');                    
+                    sb.append(']');
                     sb.append(p.getType());
                     sb.append('|');
                     sb.append(p.getInstance());
@@ -117,7 +117,7 @@ public class OLur extends AbsOTafLur implements Lur {
                 access.log(Level.DEBUG, sb);
             }
             for (Permission p : pond) {
-                if(rv) {
+                if (rv) {
                     break;
                 }
                 for (AAFPermission perm : tp.perms()) {
@@ -135,11 +135,11 @@ public class OLur extends AbsOTafLur implements Lur {
      */
     @Override
     public void fishAll(Principal bait, List<Permission> permissions) {
-        if(bait instanceof OAuth2Principal) {
+        if (bait instanceof OAuth2Principal) {
             for (AAFPermission p : ((OAuth2Principal)bait).tokenPerm().perms()) {
                 permissions.add(p);
             }
-        }        
+        }
     }
 
     /* (non-Javadoc)