Github user jburwell commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1799#discussion_r90315376
  
    --- Diff: server/src/org/apache/cloudstack/network/lb/CertServiceImpl.java 
---
    @@ -111,37 +116,37 @@ public CertServiceImpl() {
         @DB
         @Override
         @ActionEvent(eventType = EventTypes.EVENT_LB_CERT_UPLOAD, 
eventDescription = "Uploading a certificate to cloudstack", async = false)
    -    public SslCertResponse uploadSslCert(UploadSslCertCmd certCmd) {
    +    public SslCertResponse uploadSslCert(final UploadSslCertCmd certCmd) {
             try {
    -            String cert = certCmd.getCert();
    -            String key = certCmd.getKey();
    -            String password = certCmd.getPassword();
    -            String chain = certCmd.getChain();
    +            final String cert = certCmd.getCert();
    +            final String key = certCmd.getKey();
    +            final String password = certCmd.getPassword();
    +            final String chain = certCmd.getChain();
     
                 validate(cert, key, password, chain);
                 s_logger.debug("Certificate Validation succeeded");
     
    -            String fingerPrint = 
generateFingerPrint(parseCertificate(cert));
    +            final String fingerPrint = 
generateFingerPrint(parseCertificate(cert));
     
    -            CallContext ctx = CallContext.current();
    -            Account caller = ctx.getCallingAccount();
    +            final CallContext ctx = CallContext.current();
    +            final Account caller = ctx.getCallingAccount();
     
                 Account owner = null;
    -            if ((certCmd.getAccountName() != null && certCmd.getDomainId() 
!= null) || certCmd.getProjectId() != null) {
    +            if (certCmd.getAccountName() != null && certCmd.getDomainId() 
!= null || certCmd.getProjectId() != null) {
                     owner = _accountMgr.finalizeOwner(caller, 
certCmd.getAccountName(), certCmd.getDomainId(), certCmd.getProjectId());
                 } else {
                     owner = caller;
                 }
     
    -            Long accountId = owner.getId();
    -            Long domainId = owner.getDomainId();
    +            final Long accountId = owner.getId();
    +            final Long domainId = owner.getDomainId();
     
    -            SslCertVO certVO = new SslCertVO(cert, key, password, chain, 
accountId, domainId, fingerPrint);
    +            final SslCertVO certVO = new SslCertVO(cert, key, password, 
chain, accountId, domainId, fingerPrint);
                 _sslCertDao.persist(certVO);
     
                 return createCertResponse(certVO, null);
     
    -        } catch (Exception e) {
    +        } catch (final Exception e) {
    --- End diff --
    
    Why are we catching all checked and unchecked exceptions here?  Wrapping 
unchecked exceptions in `CloudRuntimeException` seems to add a layer 
indirection without adding value.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to