{"action":"created","comment":{"url":"https://api.github.com/repos/apache/cloudstack/pulls/comments/90340513","pull_request_review_id":10831086,"id":90340513,"diff_hunk":"@@ -339,190 +348,182 @@ public SslCertResponse createCertResponse(SslCertVO cert, List<LoadBalancerCertM\n         return response;\n     }\n \n-    private void validateCert(Certificate cert, boolean chainPresent) {\n+    private void validateCert(final Certificate cert, final boolean chainPresent) {\n \n-        if (!(cert instanceof X509Certificate))\n+        if (!(cert instanceof X509Certificate)) {\n             throw new IllegalArgumentException(\"Invalid certificate format. Expected X509 certificate\");\n+        }\n \n         try {\n             ((X509Certificate)cert).checkValidity();\n-        } catch (Exception e) {\n+        } catch (final Exception e) {\n             throw new IllegalArgumentException(\"Certificate expired or not valid\", e);\n         }\n     }\n \n-    private void validateKeys(PublicKey pubKey, PrivateKey privKey) {\n+    private void validateKeys(final PublicKey pubKey, final PrivateKey privKey) {\n \n-        if (pubKey.getAlgorithm() != privKey.getAlgorithm())\n+        if (pubKey.getAlgorithm() != privKey.getAlgorithm()) {\n             throw new IllegalArgumentException(\"Public and private key have different algorithms\");\n+        }\n \n         // No encryption for DSA\n-        if (pubKey.getAlgorithm() != \"RSA\")\n+        if (pubKey.getAlgorithm() != \"RSA\") {\n             return;\n+        }\n \n         try {\n \n-            String data = \"ENCRYPT_DATA\";\n-            SecureRandom random = new SecureRandom();\n-            Cipher cipher = Cipher.getInstance(pubKey.getAlgorithm());\n+            final String data = \"ENCRYPT_DATA\";\n+            final SecureRandom random = new SecureRandom();\n+            final Cipher cipher = Cipher.getInstance(pubKey.getAlgorithm());\n             cipher.init(Cipher.ENCRYPT_MODE, privKey, random);\n-            byte[] encryptedData = cipher.doFinal(data.getBytes());\n+            final byte[] encryptedData = cipher.doFinal(data.getBytes());\n \n             cipher.init(Cipher.DECRYPT_MODE, pubKey, random);\n-            String decreptedData = new String(cipher.doFinal(encryptedData));\n-            if (!decreptedData.equals(data))\n+            final String decreptedData = new String(cipher.doFinal(encryptedData));\n+            if (!decreptedData.equals(data)) {\n                 throw new IllegalArgumentException(\"Bad public-private key\");\n+            }\n \n-        } catch (BadPaddingException e) {\n+        } catch (final BadPaddingException e) {\n             throw new IllegalArgumentException(\"Bad public-private key\", e);\n-        } catch (IllegalBlockSizeException e) {\n+        } catch (final IllegalBlockSizeException e) {\n             throw new IllegalArgumentException(\"Bad public-private key\", e);\n-        } catch (NoSuchPaddingException e) {\n+        } catch (final NoSuchPaddingException e) {\n             throw new IllegalArgumentException(\"Bad public-private key\", e);\n-        } catch (InvalidKeyException e) {\n+        } catch (final InvalidKeyException e) {\n             throw new IllegalArgumentException(\"Invalid public-private key\", e);\n-        } catch (NoSuchAlgorithmException e) {\n+        } catch (final NoSuchAlgorithmException e) {\n             throw new IllegalArgumentException(\"Invalid algorithm for public-private key\", e);\n         }\n     }\n \n-    private void validateChain(List<Certificate> chain, Certificate cert) {\n+    private void validateChain(final List<Certificate> chain, final Certificate cert) {\n \n-        List<Certificate> certs = new ArrayList<Certificate>();\n-        Set<TrustAnchor> anchors = new HashSet<TrustAnchor>();\n+        final List<Certificate> certs = new ArrayList<Certificate>();\n+        final Set<TrustAnchor> anchors = new HashSet<TrustAnchor>();\n \n         certs.add(cert); // adding for self signed certs\n         certs.addAll(chain);\n \n-        for (Certificate c : certs) {\n-            if (!(c instanceof X509Certificate))\n+        for (final Certificate c : certs) {\n+            if (!(c instanceof X509Certificate)) {\n                 throw new IllegalArgumentException(\"Invalid chain format. Expected X509 certificate\");\n+            }\n \n-            X509Certificate xCert = (X509Certificate)c;\n+            final X509Certificate xCert = (X509Certificate)c;\n \n-            Principal subject = xCert.getSubjectDN();\n-            Principal issuer = xCert.getIssuerDN();\n+            xCert.getSubjectDN();\n+            xCert.getIssuerDN();\n \n-           anchors.add(new TrustAnchor(xCert, null));\n+            anchors.add(new TrustAnchor(xCert, null));","path":"server/src/org/apache/cloudstack/network/lb/CertServiceImpl.java","position":393,"original_position":393,"commit_id":"ca189534cd42e9ff331b54bdda9e9457c33a5dec","original_commit_id":"ca189534cd42e9ff331b54bdda9e9457c33a5dec","user":{"login":"jburwell","id":285646,"avatar_url":"https://avatars.githubusercontent.com/u/285646?v=3","gravatar_id":"","url":"https://api.github.com/users/jburwell","html_url":"https://github.com/jburwell","followers_url":"https://api.github.com/users/jburwell/followers","following_url":"https://api.github.com/users/jburwell/following{/other_user}","gists_url":"https://api.github.com/users/jburwell/gists{/gist_id}","starred_url":"https://api.github.com/users/jburwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jburwell/subscriptions","organizations_url":"https://api.github.com/users/jburwell/orgs","repos_url":"https://api.github.com/users/jburwell/repos","events_url":"https://api.github.com/users/jburwell/events{/privacy}","received_events_url":"https://api.github.com/users/jburwell/received_events","type":"User","site_admin":false},"body":"Please add a check for the return of the `add` method to ensure that the element was added to `anchors`.","created_at":"2016-11-30T22:11:45Z","updated_at":"2016-11-30T22:36:58Z","html_url":"https://github.com/apache/cloudstack/pull/1799#discussion_r90340513","pull_request_url":"https://api.github.com/repos/apache/cloudstack/pulls/1799","_links":{"self":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/comments/90340513"},"html":{"href":"https://github.com/apache/cloudstack/pull/1799#discussion_r90340513"},"pull_request":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/1799"}}},"pull_request":{"url":"https://api.github.com/repos/apache/cloudstack/pulls/1799","id":95855797,"html_url":"https://github.com/apache/cloudstack/pull/1799","diff_url":"https://github.com/apache/cloudstack/pull/1799.diff","patch_url":"https://github.com/apache/cloudstack/pull/1799.patch","issue_url":"https://api.github.com/repos/apache/cloudstack/issues/1799","number":1799,"state":"open","locked":false,"title":"CLOUDSTACK-9632: Upgrade bouncy castle to version 1.55","user":{"login":"rhtyd","id":95203,"avatar_url":"https://avatars.githubusercontent.com/u/95203?v=3","gravatar_id":"","url":"https://api.github.com/users/rhtyd","html_url":"https://github.com/rhtyd","followers_url":"https://api.github.com/users/rhtyd/followers","following_url":"https://api.github.com/users/rhtyd/following{/other_user}","gists_url":"https://api.github.com/users/rhtyd/gists{/gist_id}","starred_url":"https://api.github.com/users/rhtyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhtyd/subscriptions","organizations_url":"https://api.github.com/users/rhtyd/orgs","repos_url":"https://api.github.com/users/rhtyd/repos","events_url":"https://api.github.com/users/rhtyd/events{/privacy}","received_events_url":"https://api.github.com/users/rhtyd/received_events","type":"User","site_admin":false},"body":"- Upgrades Maven dependency version to v1.55\r\n- Fixes bountycastle usages and issues\r\n- Adds timeout to jetty/annotation scanning\r\n- Picks up PR #1510 by Daan","created_at":"2016-11-30T09:32:25Z","updated_at":"2016-11-30T22:36:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d2d3da4323b5ea780b48773a6f2a79d2e4af7d1b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/cloudstack/pulls/1799/commits","review_comments_url":"https://api.github.com/repos/apache/cloudstack/pulls/1799/comments","review_comment_url":"https://api.github.com/repos/apache/cloudstack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/cloudstack/issues/1799/comments","statuses_url":"https://api.github.com/repos/apache/cloudstack/statuses/ca189534cd42e9ff331b54bdda9e9457c33a5dec","head":{"label":"shapeblue:bcprov-upgrade","ref":"bcprov-upgrade","sha":"ca189534cd42e9ff331b54bdda9e9457c33a5dec","user":{"login":"shapeblue","id":6001764,"avatar_url":"https://avatars.githubusercontent.com/u/6001764?v=3","gravatar_id":"","url":"https://api.github.com/users/shapeblue","html_url":"https://github.com/shapeblue","followers_url":"https://api.github.com/users/shapeblue/followers","following_url":"https://api.github.com/users/shapeblue/following{/other_user}","gists_url":"https://api.github.com/users/shapeblue/gists{/gist_id}","starred_url":"https://api.github.com/users/shapeblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shapeblue/subscriptions","organizations_url":"https://api.github.com/users/shapeblue/orgs","repos_url":"https://api.github.com/users/shapeblue/repos","events_url":"https://api.github.com/users/shapeblue/events{/privacy}","received_events_url":"https://api.github.com/users/shapeblue/received_events","type":"Organization","site_admin":false},"repo":{"id":35481491,"name":"cloudstack","full_name":"shapeblue/cloudstack","owner":{"login":"shapeblue","id":6001764,"avatar_url":"https://avatars.githubusercontent.com/u/6001764?v=3","gravatar_id":"","url":"https://api.github.com/users/shapeblue","html_url":"https://github.com/shapeblue","followers_url":"https://api.github.com/users/shapeblue/followers","following_url":"https://api.github.com/users/shapeblue/following{/other_user}","gists_url":"https://api.github.com/users/shapeblue/gists{/gist_id}","starred_url":"https://api.github.com/users/shapeblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shapeblue/subscriptions","organizations_url":"https://api.github.com/users/shapeblue/orgs","repos_url":"https://api.github.com/users/shapeblue/repos","events_url":"https://api.github.com/users/shapeblue/events{/privacy}","received_events_url":"https://api.github.com/users/shapeblue/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/shapeblue/cloudstack","description":"The upstream repository is at http://github.com/apache/cloudstack. This is ShapeBlue's support/patch branches and Apache CloudStack™ backup","fork":true,"url":"https://api.github.com/repos/shapeblue/cloudstack","forks_url":"https://api.github.com/repos/shapeblue/cloudstack/forks","keys_url":"https://api.github.com/repos/shapeblue/cloudstack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shapeblue/cloudstack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shapeblue/cloudstack/teams","hooks_url":"https://api.github.com/repos/shapeblue/cloudstack/hooks","issue_events_url":"https://api.github.com/repos/shapeblue/cloudstack/issues/events{/number}","events_url":"https://api.github.com/repos/shapeblue/cloudstack/events","assignees_url":"https://api.github.com/repos/shapeblue/cloudstack/assignees{/user}","branches_url":"https://api.github.com/repos/shapeblue/cloudstack/branches{/branch}","tags_url":"https://api.github.com/repos/shapeblue/cloudstack/tags","blobs_url":"https://api.github.com/repos/shapeblue/cloudstack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shapeblue/cloudstack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shapeblue/cloudstack/git/refs{/sha}","trees_url":"https://api.github.com/repos/shapeblue/cloudstack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shapeblue/cloudstack/statuses/{sha}","languages_url":"https://api.github.com/repos/shapeblue/cloudstack/languages","stargazers_url":"https://api.github.com/repos/shapeblue/cloudstack/stargazers","contributors_url":"https://api.github.com/repos/shapeblue/cloudstack/contributors","subscribers_url":"https://api.github.com/repos/shapeblue/cloudstack/subscribers","subscription_url":"https://api.github.com/repos/shapeblue/cloudstack/subscription","commits_url":"https://api.github.com/repos/shapeblue/cloudstack/commits{/sha}","git_commits_url":"https://api.github.com/repos/shapeblue/cloudstack/git/commits{/sha}","comments_url":"https://api.github.com/repos/shapeblue/cloudstack/comments{/number}","issue_comment_url":"https://api.github.com/repos/shapeblue/cloudstack/issues/comments{/number}","contents_url":"https://api.github.com/repos/shapeblue/cloudstack/contents/{+path}","compare_url":"https://api.github.com/repos/shapeblue/cloudstack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shapeblue/cloudstack/merges","archive_url":"https://api.github.com/repos/shapeblue/cloudstack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shapeblue/cloudstack/downloads","issues_url":"https://api.github.com/repos/shapeblue/cloudstack/issues{/number}","pulls_url":"https://api.github.com/repos/shapeblue/cloudstack/pulls{/number}","milestones_url":"https://api.github.com/repos/shapeblue/cloudstack/milestones{/number}","notifications_url":"https://api.github.com/repos/shapeblue/cloudstack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shapeblue/cloudstack/labels{/name}","releases_url":"https://api.github.com/repos/shapeblue/cloudstack/releases{/id}","deployments_url":"https://api.github.com/repos/shapeblue/cloudstack/deployments","created_at":"2015-05-12T10:22:21Z","updated_at":"2016-09-15T17:15:49Z","pushed_at":"2016-11-30T11:56:30Z","git_url":"git://github.com/shapeblue/cloudstack.git","ssh_url":"git@github.com:shapeblue/cloudstack.git","clone_url":"https://github.com/shapeblue/cloudstack.git","svn_url":"https://github.com/shapeblue/cloudstack","homepage":"http://shapeblue.com/packages","size":510877,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":3,"default_branch":"master"}},"base":{"label":"apache:4.9","ref":"4.9","sha":"bef2236d33007e5ca3527bce144200a5ed525a34","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":9759448,"name":"cloudstack","full_name":"apache/cloudstack","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/cloudstack","description":"Mirror of Apache Cloudstack","fork":false,"url":"https://api.github.com/repos/apache/cloudstack","forks_url":"https://api.github.com/repos/apache/cloudstack/forks","keys_url":"https://api.github.com/repos/apache/cloudstack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/cloudstack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/cloudstack/teams","hooks_url":"https://api.github.com/repos/apache/cloudstack/hooks","issue_events_url":"https://api.github.com/repos/apache/cloudstack/issues/events{/number}","events_url":"https://api.github.com/repos/apache/cloudstack/events","assignees_url":"https://api.github.com/repos/apache/cloudstack/assignees{/user}","branches_url":"https://api.github.com/repos/apache/cloudstack/branches{/branch}","tags_url":"https://api.github.com/repos/apache/cloudstack/tags","blobs_url":"https://api.github.com/repos/apache/cloudstack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/cloudstack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/cloudstack/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/cloudstack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/cloudstack/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/cloudstack/languages","stargazers_url":"https://api.github.com/repos/apache/cloudstack/stargazers","contributors_url":"https://api.github.com/repos/apache/cloudstack/contributors","subscribers_url":"https://api.github.com/repos/apache/cloudstack/subscribers","subscription_url":"https://api.github.com/repos/apache/cloudstack/subscription","commits_url":"https://api.github.com/repos/apache/cloudstack/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/cloudstack/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/cloudstack/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/cloudstack/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/cloudstack/contents/{+path}","compare_url":"https://api.github.com/repos/apache/cloudstack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/cloudstack/merges","archive_url":"https://api.github.com/repos/apache/cloudstack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/cloudstack/downloads","issues_url":"https://api.github.com/repos/apache/cloudstack/issues{/number}","pulls_url":"https://api.github.com/repos/apache/cloudstack/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/cloudstack/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/cloudstack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/cloudstack/labels{/name}","releases_url":"https://api.github.com/repos/apache/cloudstack/releases{/id}","deployments_url":"https://api.github.com/repos/apache/cloudstack/deployments","created_at":"2013-04-29T22:27:12Z","updated_at":"2016-11-28T21:49:27Z","pushed_at":"2016-11-30T22:31:13Z","git_url":"git://github.com/apache/cloudstack.git","ssh_url":"git@github.com:apache/cloudstack.git","clone_url":"https://github.com/apache/cloudstack.git","svn_url":"https://github.com/apache/cloudstack","homepage":null,"size":556781,"stargazers_count":417,"watchers_count":417,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":535,"mirror_url":"git://git.apache.org/cloudstack.git","open_issues_count":198,"forks":535,"open_issues":198,"watchers":417,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/1799"},"html":{"href":"https://github.com/apache/cloudstack/pull/1799"},"issue":{"href":"https://api.github.com/repos/apache/cloudstack/issues/1799"},"comments":{"href":"https://api.github.com/repos/apache/cloudstack/issues/1799/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/1799/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/1799/commits"},"statuses":{"href":"https://api.github.com/repos/apache/cloudstack/statuses/ca189534cd42e9ff331b54bdda9e9457c33a5dec"}}}}
{"actor":{"display_login":"jburwell"}}