{"action":"created","comment":{"url":"https://api.github.com/repos/dotCMS/core/pulls/comments/139975091","pull_request_review_id":63981478,"id":139975091,"diff_hunk":"@@ -99,36 +98,41 @@ public String uuidIfy(String shorty) {\n   @CloseDBIfOpened\n   ShortyId viaDb(final String shorty) {\n \n-    this.dbHits++;\n-    ShortyId shortyId = noShorty(shorty);\n-\n-\n-    DotConnect db = new DotConnect();\n-    db.setSQL(ShortyIdSql.SELECT_SHORTY_SQL);\n-    String uuid = uuidIfy(shorty);\n-    db.addParam(uuid + \"%\");\n-    db.addParam(uuid + \"%\");\n-\n-\n-    List<Map<String, Object>> results;\n-    try {\n-      results = db.loadObjectResults();\n-\n-      if (results.size() > 1) {\n-        throw new ShortyException(\"Shorty ID collision:\" + uuid);\n-      } else if (results.size() == 1) {\n-        String id = (String) results.get(0).get(\"id\");\n-        String type = (String) results.get(0).get(\"type\");\n-        String subType = (String) results.get(0).get(\"subtype\");\n-\n-        shortyId = new ShortyId(shorty, id, ShortType.fromString(type), ShortType.fromString(subType));\n+      this.dbHits++;\n+      ShortyId shortyId = noShorty(shorty);\n+\n+      DotConnect db = new DotConnect();\n+      db.setSQL(ShortyIdSql.SELECT_SHORTY_SQL);\n+      String uuid = uuidIfy(shorty);\n+      db.addParam(uuid + \"%\");\n+      db.addParam(uuid + \"%\");\n+\n+      List<Map<String, Object>> results;\n+      try {\n+\n+          boolean found = false;\n+          results = db.loadObjectResults();\n+\n+          for (Map<String, Object> map : results){\n+              if (uuid.equals((String)map.get(\"id\"))){\n+                  found = true;\n+                  String id = (String) map.get(\"id\");","path":"dotCMS/src/main/java/com/dotcms/uuid/shorty/ShortyIdAPIImpl.java","position":55,"original_position":55,"commit_id":"52bf75327d7a631dae41204b35f99f1a5a61b0cc","original_commit_id":"52bf75327d7a631dae41204b35f99f1a5a61b0cc","user":{"login":"codacy-bot","id":19940114,"avatar_url":"https://avatars1.githubusercontent.com/u/19940114?v=4","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://www.codacy.com/assets/images/favicon.png) Issue found: [Local variable 'id' could be declared final](https://www.codacy.com/app/dotCMS/core/pullRequest?prid=927820)","created_at":"2017-09-20T13:52:13Z","updated_at":"2017-09-20T13:52:13Z","html_url":"https://github.com/dotCMS/core/pull/12629#discussion_r139975091","pull_request_url":"https://api.github.com/repos/dotCMS/core/pulls/12629","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/dotCMS/core/pulls/comments/139975091"},"html":{"href":"https://github.com/dotCMS/core/pull/12629#discussion_r139975091"},"pull_request":{"href":"https://api.github.com/repos/dotCMS/core/pulls/12629"}}},"pull_request":{"url":"https://api.github.com/repos/dotCMS/core/pulls/12629","id":142101572,"html_url":"https://github.com/dotCMS/core/pull/12629","diff_url":"https://github.com/dotCMS/core/pull/12629.diff","patch_url":"https://github.com/dotCMS/core/pull/12629.patch","issue_url":"https://api.github.com/repos/dotCMS/core/issues/12629","number":12629,"state":"open","locked":false,"title":"enable support legacy ids #12627","user":{"login":"joseorsini","id":1717110,"avatar_url":"https://avatars1.githubusercontent.com/u/1717110?v=4","gravatar_id":"","url":"https://api.github.com/users/joseorsini","html_url":"https://github.com/joseorsini","followers_url":"https://api.github.com/users/joseorsini/followers","following_url":"https://api.github.com/users/joseorsini/following{/other_user}","gists_url":"https://api.github.com/users/joseorsini/gists{/gist_id}","starred_url":"https://api.github.com/users/joseorsini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joseorsini/subscriptions","organizations_url":"https://api.github.com/users/joseorsini/orgs","repos_url":"https://api.github.com/users/joseorsini/repos","events_url":"https://api.github.com/users/joseorsini/events{/privacy}","received_events_url":"https://api.github.com/users/joseorsini/received_events","type":"User","site_admin":false},"body":"Tested on current master using upgraded data from customer and after migrating Legacy Files to contents.\r\n\r\nPlease see #12627 for more details.","created_at":"2017-09-20T13:37:21Z","updated_at":"2017-09-20T13:52:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bc1fd33abde9e51769d4fa53bcea9237ec3b302e","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotCMS/core/pulls/12629/commits","review_comments_url":"https://api.github.com/repos/dotCMS/core/pulls/12629/comments","review_comment_url":"https://api.github.com/repos/dotCMS/core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotCMS/core/issues/12629/comments","statuses_url":"https://api.github.com/repos/dotCMS/core/statuses/52bf75327d7a631dae41204b35f99f1a5a61b0cc","head":{"label":"dotCMS:issue-12627-support-legacyids-shortyidapi-try-2","ref":"issue-12627-support-legacyids-shortyidapi-try-2","sha":"52bf75327d7a631dae41204b35f99f1a5a61b0cc","user":{"login":"dotCMS","id":1005263,"avatar_url":"https://avatars3.githubusercontent.com/u/1005263?v=4","gravatar_id":"","url":"https://api.github.com/users/dotCMS","html_url":"https://github.com/dotCMS","followers_url":"https://api.github.com/users/dotCMS/followers","following_url":"https://api.github.com/users/dotCMS/following{/other_user}","gists_url":"https://api.github.com/users/dotCMS/gists{/gist_id}","starred_url":"https://api.github.com/users/dotCMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotCMS/subscriptions","organizations_url":"https://api.github.com/users/dotCMS/orgs","repos_url":"https://api.github.com/users/dotCMS/repos","events_url":"https://api.github.com/users/dotCMS/events{/privacy}","received_events_url":"https://api.github.com/users/dotCMS/received_events","type":"Organization","site_admin":false},"repo":{"id":3729629,"name":"core","full_name":"dotCMS/core","owner":{"login":"dotCMS","id":1005263,"avatar_url":"https://avatars3.githubusercontent.com/u/1005263?v=4","gravatar_id":"","url":"https://api.github.com/users/dotCMS","html_url":"https://github.com/dotCMS","followers_url":"https://api.github.com/users/dotCMS/followers","following_url":"https://api.github.com/users/dotCMS/following{/other_user}","gists_url":"https://api.github.com/users/dotCMS/gists{/gist_id}","starred_url":"https://api.github.com/users/dotCMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotCMS/subscriptions","organizations_url":"https://api.github.com/users/dotCMS/orgs","repos_url":"https://api.github.com/users/dotCMS/repos","events_url":"https://api.github.com/users/dotCMS/events{/privacy}","received_events_url":"https://api.github.com/users/dotCMS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotCMS/core","description":"Source Code for dotCMS Java Enterprise Content Management System","fork":false,"url":"https://api.github.com/repos/dotCMS/core","forks_url":"https://api.github.com/repos/dotCMS/core/forks","keys_url":"https://api.github.com/repos/dotCMS/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotCMS/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotCMS/core/teams","hooks_url":"https://api.github.com/repos/dotCMS/core/hooks","issue_events_url":"https://api.github.com/repos/dotCMS/core/issues/events{/number}","events_url":"https://api.github.com/repos/dotCMS/core/events","assignees_url":"https://api.github.com/repos/dotCMS/core/assignees{/user}","branches_url":"https://api.github.com/repos/dotCMS/core/branches{/branch}","tags_url":"https://api.github.com/repos/dotCMS/core/tags","blobs_url":"https://api.github.com/repos/dotCMS/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotCMS/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotCMS/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotCMS/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotCMS/core/statuses/{sha}","languages_url":"https://api.github.com/repos/dotCMS/core/languages","stargazers_url":"https://api.github.com/repos/dotCMS/core/stargazers","contributors_url":"https://api.github.com/repos/dotCMS/core/contributors","subscribers_url":"https://api.github.com/repos/dotCMS/core/subscribers","subscription_url":"https://api.github.com/repos/dotCMS/core/subscription","commits_url":"https://api.github.com/repos/dotCMS/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotCMS/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotCMS/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotCMS/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotCMS/core/contents/{+path}","compare_url":"https://api.github.com/repos/dotCMS/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotCMS/core/merges","archive_url":"https://api.github.com/repos/dotCMS/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotCMS/core/downloads","issues_url":"https://api.github.com/repos/dotCMS/core/issues{/number}","pulls_url":"https://api.github.com/repos/dotCMS/core/pulls{/number}","milestones_url":"https://api.github.com/repos/dotCMS/core/milestones{/number}","notifications_url":"https://api.github.com/repos/dotCMS/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotCMS/core/labels{/name}","releases_url":"https://api.github.com/repos/dotCMS/core/releases{/id}","deployments_url":"https://api.github.com/repos/dotCMS/core/deployments","created_at":"2012-03-15T15:24:14Z","updated_at":"2017-09-15T23:18:38Z","pushed_at":"2017-09-20T13:45:10Z","git_url":"git://github.com/dotCMS/core.git","ssh_url":"git@github.com:dotCMS/core.git","clone_url":"https://github.com/dotCMS/core.git","svn_url":"https://github.com/dotCMS/core","homepage":"http://dotcms.com","size":285445,"stargazers_count":322,"watchers_count":322,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":290,"mirror_url":null,"open_issues_count":1729,"forks":290,"open_issues":1729,"watchers":322,"default_branch":"master"}},"base":{"label":"dotCMS:master","ref":"master","sha":"effde18af8b02087cecc26b092f9dab8596e1ae7","user":{"login":"dotCMS","id":1005263,"avatar_url":"https://avatars3.githubusercontent.com/u/1005263?v=4","gravatar_id":"","url":"https://api.github.com/users/dotCMS","html_url":"https://github.com/dotCMS","followers_url":"https://api.github.com/users/dotCMS/followers","following_url":"https://api.github.com/users/dotCMS/following{/other_user}","gists_url":"https://api.github.com/users/dotCMS/gists{/gist_id}","starred_url":"https://api.github.com/users/dotCMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotCMS/subscriptions","organizations_url":"https://api.github.com/users/dotCMS/orgs","repos_url":"https://api.github.com/users/dotCMS/repos","events_url":"https://api.github.com/users/dotCMS/events{/privacy}","received_events_url":"https://api.github.com/users/dotCMS/received_events","type":"Organization","site_admin":false},"repo":{"id":3729629,"name":"core","full_name":"dotCMS/core","owner":{"login":"dotCMS","id":1005263,"avatar_url":"https://avatars3.githubusercontent.com/u/1005263?v=4","gravatar_id":"","url":"https://api.github.com/users/dotCMS","html_url":"https://github.com/dotCMS","followers_url":"https://api.github.com/users/dotCMS/followers","following_url":"https://api.github.com/users/dotCMS/following{/other_user}","gists_url":"https://api.github.com/users/dotCMS/gists{/gist_id}","starred_url":"https://api.github.com/users/dotCMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotCMS/subscriptions","organizations_url":"https://api.github.com/users/dotCMS/orgs","repos_url":"https://api.github.com/users/dotCMS/repos","events_url":"https://api.github.com/users/dotCMS/events{/privacy}","received_events_url":"https://api.github.com/users/dotCMS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotCMS/core","description":"Source Code for dotCMS Java Enterprise Content Management System","fork":false,"url":"https://api.github.com/repos/dotCMS/core","forks_url":"https://api.github.com/repos/dotCMS/core/forks","keys_url":"https://api.github.com/repos/dotCMS/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotCMS/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotCMS/core/teams","hooks_url":"https://api.github.com/repos/dotCMS/core/hooks","issue_events_url":"https://api.github.com/repos/dotCMS/core/issues/events{/number}","events_url":"https://api.github.com/repos/dotCMS/core/events","assignees_url":"https://api.github.com/repos/dotCMS/core/assignees{/user}","branches_url":"https://api.github.com/repos/dotCMS/core/branches{/branch}","tags_url":"https://api.github.com/repos/dotCMS/core/tags","blobs_url":"https://api.github.com/repos/dotCMS/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotCMS/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotCMS/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotCMS/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotCMS/core/statuses/{sha}","languages_url":"https://api.github.com/repos/dotCMS/core/languages","stargazers_url":"https://api.github.com/repos/dotCMS/core/stargazers","contributors_url":"https://api.github.com/repos/dotCMS/core/contributors","subscribers_url":"https://api.github.com/repos/dotCMS/core/subscribers","subscription_url":"https://api.github.com/repos/dotCMS/core/subscription","commits_url":"https://api.github.com/repos/dotCMS/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotCMS/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotCMS/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotCMS/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotCMS/core/contents/{+path}","compare_url":"https://api.github.com/repos/dotCMS/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotCMS/core/merges","archive_url":"https://api.github.com/repos/dotCMS/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotCMS/core/downloads","issues_url":"https://api.github.com/repos/dotCMS/core/issues{/number}","pulls_url":"https://api.github.com/repos/dotCMS/core/pulls{/number}","milestones_url":"https://api.github.com/repos/dotCMS/core/milestones{/number}","notifications_url":"https://api.github.com/repos/dotCMS/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotCMS/core/labels{/name}","releases_url":"https://api.github.com/repos/dotCMS/core/releases{/id}","deployments_url":"https://api.github.com/repos/dotCMS/core/deployments","created_at":"2012-03-15T15:24:14Z","updated_at":"2017-09-15T23:18:38Z","pushed_at":"2017-09-20T13:45:10Z","git_url":"git://github.com/dotCMS/core.git","ssh_url":"git@github.com:dotCMS/core.git","clone_url":"https://github.com/dotCMS/core.git","svn_url":"https://github.com/dotCMS/core","homepage":"http://dotcms.com","size":285445,"stargazers_count":322,"watchers_count":322,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":290,"mirror_url":null,"open_issues_count":1729,"forks":290,"open_issues":1729,"watchers":322,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotCMS/core/pulls/12629"},"html":{"href":"https://github.com/dotCMS/core/pull/12629"},"issue":{"href":"https://api.github.com/repos/dotCMS/core/issues/12629"},"comments":{"href":"https://api.github.com/repos/dotCMS/core/issues/12629/comments"},"review_comments":{"href":"https://api.github.com/repos/dotCMS/core/pulls/12629/comments"},"review_comment":{"href":"https://api.github.com/repos/dotCMS/core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotCMS/core/pulls/12629/commits"},"statuses":{"href":"https://api.github.com/repos/dotCMS/core/statuses/52bf75327d7a631dae41204b35f99f1a5a61b0cc"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"codacy-bot"}}