{"action":"created","comment":{"url":"https://api.github.com/repos/eclipse/che/pulls/comments/62024661","id":62024661,"diff_hunk":"@@ -0,0 +1,42 @@\n+/*******************************************************************************\n+ * Copyright (c) 2012-2016 Codenvy, S.A.\n+ * All rights reserved. This program and the accompanying materials\n+ * are made available under the terms of the Eclipse Public License v1.0\n+ * which accompanies this distribution, and is available at\n+ * http://www.eclipse.org/legal/epl-v10.html\n+ *\n+ * Contributors:\n+ *   Codenvy, S.A. - initial API and implementation\n+ *******************************************************************************/\n+package org.eclipse.che.ide.util;\n+\n+import org.junit.Assert;\n+import org.junit.Test;\n+\n+/**\n+ * Test of UUID generator\n+ */\n+\n+public class UUIDTest {\n+\n+    @Test\n+    public void testUUIDLength() {\n+        String uuid = UUID.uuid(15);\n+        Assert.assertEquals(15, uuid.length());\n+    }\n+\n+    @Test\n+    public void testUUIDRadix() {\n+        String uuid1 = UUID.uuid(6,2);\n+        Assert.assertTrue(uuid1.matches(\"[0-1]{6}\"));\n+\tString uuid2 = UUID.uuid(8,10);","path":"core/commons/che-core-commons-gwt/src/test/java/org/eclipse/che/ide/util/UUIDTest.java","position":32,"original_position":32,"commit_id":"3c46fcbe45a2e25191d4099c944c743ecbd69c9d","original_commit_id":"3c46fcbe45a2e25191d4099c944c743ecbd69c9d","user":{"login":"garagatyi","id":1851863,"avatar_url":"https://avatars.githubusercontent.com/u/1851863?v=3","gravatar_id":"","url":"https://api.github.com/users/garagatyi","html_url":"https://github.com/garagatyi","followers_url":"https://api.github.com/users/garagatyi/followers","following_url":"https://api.github.com/users/garagatyi/following{/other_user}","gists_url":"https://api.github.com/users/garagatyi/gists{/gist_id}","starred_url":"https://api.github.com/users/garagatyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garagatyi/subscriptions","organizations_url":"https://api.github.com/users/garagatyi/orgs","repos_url":"https://api.github.com/users/garagatyi/repos","events_url":"https://api.github.com/users/garagatyi/events{/privacy}","received_events_url":"https://api.github.com/users/garagatyi/received_events","type":"User","site_admin":false},"body":"please align","created_at":"2016-05-04T11:37:07Z","updated_at":"2016-05-04T11:37:07Z","html_url":"https://github.com/eclipse/che/pull/1165#discussion_r62024661","pull_request_url":"https://api.github.com/repos/eclipse/che/pulls/1165","_links":{"self":{"href":"https://api.github.com/repos/eclipse/che/pulls/comments/62024661"},"html":{"href":"https://github.com/eclipse/che/pull/1165#discussion_r62024661"},"pull_request":{"href":"https://api.github.com/repos/eclipse/che/pulls/1165"}}},"pull_request":{"url":"https://api.github.com/repos/eclipse/che/pulls/1165","id":68488784,"html_url":"https://github.com/eclipse/che/pull/1165","diff_url":"https://github.com/eclipse/che/pull/1165.diff","patch_url":"https://github.com/eclipse/che/pull/1165.patch","issue_url":"https://api.github.com/repos/eclipse/che/issues/1165","number":1165,"state":"open","locked":false,"title":"Fixing random number contention","user":{"login":"Wajihulhassan","id":4715082,"avatar_url":"https://avatars.githubusercontent.com/u/4715082?v=3","gravatar_id":"","url":"https://api.github.com/users/Wajihulhassan","html_url":"https://github.com/Wajihulhassan","followers_url":"https://api.github.com/users/Wajihulhassan/followers","following_url":"https://api.github.com/users/Wajihulhassan/following{/other_user}","gists_url":"https://api.github.com/users/Wajihulhassan/gists{/gist_id}","starred_url":"https://api.github.com/users/Wajihulhassan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wajihulhassan/subscriptions","organizations_url":"https://api.github.com/users/Wajihulhassan/orgs","repos_url":"https://api.github.com/users/Wajihulhassan/repos","events_url":"https://api.github.com/users/Wajihulhassan/events{/privacy}","received_events_url":"https://api.github.com/users/Wajihulhassan/received_events","type":"User","site_admin":false},"body":"In `UUID.java`, `Math.random()` is used for random number generation and multiple threads use this UUID generator in eclipse che .\r\nAccording to [Java API](http://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#random--) , in multi-threaded environment, it is suggested that each thread has their own random number generator to reduce contention. \r\nThis pull request replaces `Math.random()` with `ThreadLocalRandom`, which has a Random instance per thread and safeguards against contention. Also, I added tests for UUID generator. \r\nLet me know if I need to change or add something.\r\n\r\nSigned-off-by: Wajih ul hassan <wajih.lums@gmail.com>","created_at":"2016-05-01T06:38:01Z","updated_at":"2016-05-04T11:37:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8f7358e38cc1d901b3579a8f2694960c4383e150","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/eclipse/che/pulls/1165/commits","review_comments_url":"https://api.github.com/repos/eclipse/che/pulls/1165/comments","review_comment_url":"https://api.github.com/repos/eclipse/che/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eclipse/che/issues/1165/comments","statuses_url":"https://api.github.com/repos/eclipse/che/statuses/3c46fcbe45a2e25191d4099c944c743ecbd69c9d","head":{"label":"Wajihulhassan:random_bug","ref":"random_bug","sha":"3c46fcbe45a2e25191d4099c944c743ecbd69c9d","user":{"login":"Wajihulhassan","id":4715082,"avatar_url":"https://avatars.githubusercontent.com/u/4715082?v=3","gravatar_id":"","url":"https://api.github.com/users/Wajihulhassan","html_url":"https://github.com/Wajihulhassan","followers_url":"https://api.github.com/users/Wajihulhassan/followers","following_url":"https://api.github.com/users/Wajihulhassan/following{/other_user}","gists_url":"https://api.github.com/users/Wajihulhassan/gists{/gist_id}","starred_url":"https://api.github.com/users/Wajihulhassan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wajihulhassan/subscriptions","organizations_url":"https://api.github.com/users/Wajihulhassan/orgs","repos_url":"https://api.github.com/users/Wajihulhassan/repos","events_url":"https://api.github.com/users/Wajihulhassan/events{/privacy}","received_events_url":"https://api.github.com/users/Wajihulhassan/received_events","type":"User","site_admin":false},"repo":{"id":55864439,"name":"che","full_name":"Wajihulhassan/che","owner":{"login":"Wajihulhassan","id":4715082,"avatar_url":"https://avatars.githubusercontent.com/u/4715082?v=3","gravatar_id":"","url":"https://api.github.com/users/Wajihulhassan","html_url":"https://github.com/Wajihulhassan","followers_url":"https://api.github.com/users/Wajihulhassan/followers","following_url":"https://api.github.com/users/Wajihulhassan/following{/other_user}","gists_url":"https://api.github.com/users/Wajihulhassan/gists{/gist_id}","starred_url":"https://api.github.com/users/Wajihulhassan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wajihulhassan/subscriptions","organizations_url":"https://api.github.com/users/Wajihulhassan/orgs","repos_url":"https://api.github.com/users/Wajihulhassan/repos","events_url":"https://api.github.com/users/Wajihulhassan/events{/privacy}","received_events_url":"https://api.github.com/users/Wajihulhassan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Wajihulhassan/che","description":"Eclipse Che: Next-generation Eclipse IDE.  Open source workspace server and cloud IDE.","fork":true,"url":"https://api.github.com/repos/Wajihulhassan/che","forks_url":"https://api.github.com/repos/Wajihulhassan/che/forks","keys_url":"https://api.github.com/repos/Wajihulhassan/che/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wajihulhassan/che/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wajihulhassan/che/teams","hooks_url":"https://api.github.com/repos/Wajihulhassan/che/hooks","issue_events_url":"https://api.github.com/repos/Wajihulhassan/che/issues/events{/number}","events_url":"https://api.github.com/repos/Wajihulhassan/che/events","assignees_url":"https://api.github.com/repos/Wajihulhassan/che/assignees{/user}","branches_url":"https://api.github.com/repos/Wajihulhassan/che/branches{/branch}","tags_url":"https://api.github.com/repos/Wajihulhassan/che/tags","blobs_url":"https://api.github.com/repos/Wajihulhassan/che/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wajihulhassan/che/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wajihulhassan/che/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wajihulhassan/che/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wajihulhassan/che/statuses/{sha}","languages_url":"https://api.github.com/repos/Wajihulhassan/che/languages","stargazers_url":"https://api.github.com/repos/Wajihulhassan/che/stargazers","contributors_url":"https://api.github.com/repos/Wajihulhassan/che/contributors","subscribers_url":"https://api.github.com/repos/Wajihulhassan/che/subscribers","subscription_url":"https://api.github.com/repos/Wajihulhassan/che/subscription","commits_url":"https://api.github.com/repos/Wajihulhassan/che/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wajihulhassan/che/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wajihulhassan/che/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wajihulhassan/che/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wajihulhassan/che/contents/{+path}","compare_url":"https://api.github.com/repos/Wajihulhassan/che/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wajihulhassan/che/merges","archive_url":"https://api.github.com/repos/Wajihulhassan/che/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wajihulhassan/che/downloads","issues_url":"https://api.github.com/repos/Wajihulhassan/che/issues{/number}","pulls_url":"https://api.github.com/repos/Wajihulhassan/che/pulls{/number}","milestones_url":"https://api.github.com/repos/Wajihulhassan/che/milestones{/number}","notifications_url":"https://api.github.com/repos/Wajihulhassan/che/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wajihulhassan/che/labels{/name}","releases_url":"https://api.github.com/repos/Wajihulhassan/che/releases{/id}","deployments_url":"https://api.github.com/repos/Wajihulhassan/che/deployments","created_at":"2016-04-09T20:02:01Z","updated_at":"2016-04-09T20:02:16Z","pushed_at":"2016-05-01T08:17:38Z","git_url":"git://github.com/Wajihulhassan/che.git","ssh_url":"git@github.com:Wajihulhassan/che.git","clone_url":"https://github.com/Wajihulhassan/che.git","svn_url":"https://github.com/Wajihulhassan/che","homepage":"http://eclipse.org/che","size":20996,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"eclipse:master","ref":"master","sha":"d8ca6b93af363b8bee003e2996bd8aae18ffdf68","user":{"login":"eclipse","id":56974,"avatar_url":"https://avatars.githubusercontent.com/u/56974?v=3","gravatar_id":"","url":"https://api.github.com/users/eclipse","html_url":"https://github.com/eclipse","followers_url":"https://api.github.com/users/eclipse/followers","following_url":"https://api.github.com/users/eclipse/following{/other_user}","gists_url":"https://api.github.com/users/eclipse/gists{/gist_id}","starred_url":"https://api.github.com/users/eclipse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclipse/subscriptions","organizations_url":"https://api.github.com/users/eclipse/orgs","repos_url":"https://api.github.com/users/eclipse/repos","events_url":"https://api.github.com/users/eclipse/events{/privacy}","received_events_url":"https://api.github.com/users/eclipse/received_events","type":"Organization","site_admin":false},"repo":{"id":32935745,"name":"che","full_name":"eclipse/che","owner":{"login":"eclipse","id":56974,"avatar_url":"https://avatars.githubusercontent.com/u/56974?v=3","gravatar_id":"","url":"https://api.github.com/users/eclipse","html_url":"https://github.com/eclipse","followers_url":"https://api.github.com/users/eclipse/followers","following_url":"https://api.github.com/users/eclipse/following{/other_user}","gists_url":"https://api.github.com/users/eclipse/gists{/gist_id}","starred_url":"https://api.github.com/users/eclipse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclipse/subscriptions","organizations_url":"https://api.github.com/users/eclipse/orgs","repos_url":"https://api.github.com/users/eclipse/repos","events_url":"https://api.github.com/users/eclipse/events{/privacy}","received_events_url":"https://api.github.com/users/eclipse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/eclipse/che","description":"Eclipse Che: Next-generation Eclipse IDE.  Open source workspace server and cloud IDE.","fork":false,"url":"https://api.github.com/repos/eclipse/che","forks_url":"https://api.github.com/repos/eclipse/che/forks","keys_url":"https://api.github.com/repos/eclipse/che/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eclipse/che/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eclipse/che/teams","hooks_url":"https://api.github.com/repos/eclipse/che/hooks","issue_events_url":"https://api.github.com/repos/eclipse/che/issues/events{/number}","events_url":"https://api.github.com/repos/eclipse/che/events","assignees_url":"https://api.github.com/repos/eclipse/che/assignees{/user}","branches_url":"https://api.github.com/repos/eclipse/che/branches{/branch}","tags_url":"https://api.github.com/repos/eclipse/che/tags","blobs_url":"https://api.github.com/repos/eclipse/che/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eclipse/che/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eclipse/che/git/refs{/sha}","trees_url":"https://api.github.com/repos/eclipse/che/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eclipse/che/statuses/{sha}","languages_url":"https://api.github.com/repos/eclipse/che/languages","stargazers_url":"https://api.github.com/repos/eclipse/che/stargazers","contributors_url":"https://api.github.com/repos/eclipse/che/contributors","subscribers_url":"https://api.github.com/repos/eclipse/che/subscribers","subscription_url":"https://api.github.com/repos/eclipse/che/subscription","commits_url":"https://api.github.com/repos/eclipse/che/commits{/sha}","git_commits_url":"https://api.github.com/repos/eclipse/che/git/commits{/sha}","comments_url":"https://api.github.com/repos/eclipse/che/comments{/number}","issue_comment_url":"https://api.github.com/repos/eclipse/che/issues/comments{/number}","contents_url":"https://api.github.com/repos/eclipse/che/contents/{+path}","compare_url":"https://api.github.com/repos/eclipse/che/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eclipse/che/merges","archive_url":"https://api.github.com/repos/eclipse/che/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eclipse/che/downloads","issues_url":"https://api.github.com/repos/eclipse/che/issues{/number}","pulls_url":"https://api.github.com/repos/eclipse/che/pulls{/number}","milestones_url":"https://api.github.com/repos/eclipse/che/milestones{/number}","notifications_url":"https://api.github.com/repos/eclipse/che/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eclipse/che/labels{/name}","releases_url":"https://api.github.com/repos/eclipse/che/releases{/id}","deployments_url":"https://api.github.com/repos/eclipse/che/deployments","created_at":"2015-03-26T15:31:01Z","updated_at":"2016-05-04T11:22:48Z","pushed_at":"2016-05-04T11:05:21Z","git_url":"git://github.com/eclipse/che.git","ssh_url":"git@github.com:eclipse/che.git","clone_url":"https://github.com/eclipse/che.git","svn_url":"https://github.com/eclipse/che","homepage":"http://eclipse.org/che","size":28525,"stargazers_count":2809,"watchers_count":2809,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":387,"mirror_url":null,"open_issues_count":77,"forks":387,"open_issues":77,"watchers":2809,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/eclipse/che/pulls/1165"},"html":{"href":"https://github.com/eclipse/che/pull/1165"},"issue":{"href":"https://api.github.com/repos/eclipse/che/issues/1165"},"comments":{"href":"https://api.github.com/repos/eclipse/che/issues/1165/comments"},"review_comments":{"href":"https://api.github.com/repos/eclipse/che/pulls/1165/comments"},"review_comment":{"href":"https://api.github.com/repos/eclipse/che/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eclipse/che/pulls/1165/commits"},"statuses":{"href":"https://api.github.com/repos/eclipse/che/statuses/3c46fcbe45a2e25191d4099c944c743ecbd69c9d"}}}}