Sonar Fixes, Formatting
[aaf/authz.git] / auth / auth-certman / src / main / java / org / onap / aaf / auth / cm / mapper / Mapper1_0.java
index 1c95196..bf5665a 100644 (file)
@@ -3,13 +3,14 @@
  * 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.
  * 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.
@@ -49,7 +50,7 @@ import certman.v1_0.CertificateRequest;
 
 
 public class Mapper1_0 implements Mapper<BaseRequest,CertInfo,Artifacts,Error> {
-    
+
     @Override
     public Class<?> getClass(API api) {
         switch(api) {
@@ -123,11 +124,9 @@ public class Mapper1_0 implements Mapper<BaseRequest,CertInfo,Artifacts,Error> {
         // Certs in keystore versus Truststore.  Separate in Version 2_0
         if (cin.trustCAs()!=null) {
             for (String c : cin.trustCAs()) {
-                if (c!=null) {
-                    if (!cout.getCerts().contains(c)) {
-                        cout.getCerts().add(c);
-                    }
-                }
+                if ((c!=null)&&(!cout.getCerts().contains(c))) {
+                     cout.getCerts().add(c);
+                 }
             }
         }
         if (cin.notes()!=null) {
@@ -234,7 +233,7 @@ public class Mapper1_0 implements Mapper<BaseRequest,CertInfo,Artifacts,Error> {
             data.ns = trim(arti.getNs());
             data.renewDays = arti.getRenewDays();
             data.notify = trim(arti.getNotification());
-            
+
             // Ignored on way in for create/update
             data.sponsor = (arti.getSponsor());
             if(arti.getSans()!=null) {
@@ -280,8 +279,8 @@ public class Mapper1_0 implements Mapper<BaseRequest,CertInfo,Artifacts,Error> {
             return Result.err(lArtiDAO);
         }
     }
-    
-    
+
+
 
     private String trim(String s) {
         if(s==null) {