Merge "CMService.java-Merge if statement"
authorJonathan Gathman <jonathan.gathman@att.com>
Wed, 6 Nov 2019 13:39:19 +0000 (13:39 +0000)
committerGerrit Code Review <gerrit@onap.org>
Wed, 6 Nov 2019 13:39:19 +0000 (13:39 +0000)
1  2 
auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java

@@@ -3,7 -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,10 -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);
 -                                }
                              }
                          }
                      }
                              Collection<? extends Certificate> certs = Factory.toX509Certificate(cdd.x509);
                              for(Iterator<? extends Certificate> iter = certs.iterator(); iter.hasNext();) {
                                  X509Certificate x509 = (X509Certificate)iter.next();
-                                 if(x509.getNotAfter().after(now) && x509.getSubjectDN().getName().contains(cn)) {
-                                     if(++count>max_509s) {
+                                 if((x509.getNotAfter().after(now) && x509.getSubjectDN().getName().contains(cn))&&(++count>max_509s)) {
                                          break;
-                                     }
-                                 }
+                                      }
                              }
                          }
                          if(count>max_509s) {