{"action":"created","comment":{"url":"https://api.github.com/repos/amplab/tachyon/pulls/comments/34012260","id":34012260,"diff_hunk":"@@ -157,26 +157,41 @@ public static ByteBuffer cloneByteBuffer(ByteBuffer buf) {\n    * Join each element in paths in order, separated by {@code TachyonURI.SEPARATOR}.\n    * <p>\n    * For example, {@code concatPath(\"/myroot/\", \"dir\", 1L, \"filename\")} returns\n-   * {@code \"/myroot/dir/1/filename\"}\n+   * {@code \"/myroot/dir/1/filename\"}, or\n+   * {@code concatPath(\"tachyon://myroot\", \"dir\", \"filename\")} returns\n+   * {@code \"tachyon://myroot/dir/filename\"}. Note that a null element in paths\n+   * is treated as empty string, i.e., \"\".\n    *\n    * @param paths to concatenate\n    * @return joined path\n+   * @throws IllegalArgumentException\n    */\n-  public static String concatPath(Object... paths) {\n+  public static String concatPath(Object... paths) throws IllegalArgumentException {\n     List<String> trimmedPathList = new ArrayList<String>();\n-    for (int k = 0; k < paths.length; k ++) {\n-      String path = paths[k].toString().trim();\n-      String trimmedPath;\n-      if (k == 0) {\n-        trimmedPath = CharMatcher.is(TachyonURI.SEPARATOR.charAt(0)).trimTrailingFrom(path);\n-      } else {\n-        trimmedPath = CharMatcher.is(TachyonURI.SEPARATOR.charAt(0)).trimFrom(path);\n-        if (trimmedPath == \"\") {\n-          continue;\n-        }\n-      }\n+    String path;\n+    String trimmedPath;\n+    if (paths == null) {\n+      throw new IllegalArgumentException(\"Can not concatenate a null set of paths.\");\n+    }","path":"common/src/main/java/tachyon/util/CommonUtils.java","position":32,"original_position":32,"commit_id":"cf94fc2cb9515d1a62c8257198cfb00c263508fd","original_commit_id":"cf94fc2cb9515d1a62c8257198cfb00c263508fd","user":{"login":"haoyuan","id":1200956,"avatar_url":"https://avatars.githubusercontent.com/u/1200956?v=3","gravatar_id":"","url":"https://api.github.com/users/haoyuan","html_url":"https://github.com/haoyuan","followers_url":"https://api.github.com/users/haoyuan/followers","following_url":"https://api.github.com/users/haoyuan/following{/other_user}","gists_url":"https://api.github.com/users/haoyuan/gists{/gist_id}","starred_url":"https://api.github.com/users/haoyuan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haoyuan/subscriptions","organizations_url":"https://api.github.com/users/haoyuan/orgs","repos_url":"https://api.github.com/users/haoyuan/repos","events_url":"https://api.github.com/users/haoyuan/events{/privacy}","received_events_url":"https://api.github.com/users/haoyuan/received_events","type":"User","site_admin":false},"body":"Please declare \r\n`\r\nString path;\r\nString trimmedPath;\r\n`\r\nhere since they would not be used before `paths == null`.\r\n","created_at":"2015-07-07T07:01:05Z","updated_at":"2015-07-07T07:01:05Z","html_url":"https://github.com/amplab/tachyon/pull/1025#discussion_r34012260","pull_request_url":"https://api.github.com/repos/amplab/tachyon/pulls/1025","_links":{"self":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/comments/34012260"},"html":{"href":"https://github.com/amplab/tachyon/pull/1025#discussion_r34012260"},"pull_request":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/1025"}}},"pull_request":{"url":"https://api.github.com/repos/amplab/tachyon/pulls/1025","id":39039162,"html_url":"https://github.com/amplab/tachyon/pull/1025","diff_url":"https://github.com/amplab/tachyon/pull/1025.diff","patch_url":"https://github.com/amplab/tachyon/pull/1025.patch","issue_url":"https://api.github.com/repos/amplab/tachyon/issues/1025","number":1025,"state":"open","locked":false,"title":"[TACHYON-565] Fix String equals bug in CommonUtils","user":{"login":"qnu","id":901792,"avatar_url":"https://avatars.githubusercontent.com/u/901792?v=3","gravatar_id":"","url":"https://api.github.com/users/qnu","html_url":"https://github.com/qnu","followers_url":"https://api.github.com/users/qnu/followers","following_url":"https://api.github.com/users/qnu/following{/other_user}","gists_url":"https://api.github.com/users/qnu/gists{/gist_id}","starred_url":"https://api.github.com/users/qnu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qnu/subscriptions","organizations_url":"https://api.github.com/users/qnu/orgs","repos_url":"https://api.github.com/users/qnu/repos","events_url":"https://api.github.com/users/qnu/events{/privacy}","received_events_url":"https://api.github.com/users/qnu/received_events","type":"User","site_admin":false},"body":"https://tachyon.atlassian.net/browse/TACHYON-565\r\nFix [TACHYON-565] Fix String equals bug in CommonUtils.\r\n\r\nPreviously proposed solution is trimmedPath.equals(\"\"), but it is not null-safe and with potential performance overhead (see http://howtodoinjava.com/2013/03/31/always-use-length-instead-of-equals-to-check-empty-string-in-java/). A null-safe solution is \"\".equals(trimmedPath), but it does not fall into \"continue\" when trimmedPath is NULL. I guess the original intention is to \"continue\" whenever trimmedPath is NULL or empty, though trimFrom(path) will always return \"\".","created_at":"2015-07-02T00:45:55Z","updated_at":"2015-07-07T07:01:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4134b483b8b7a743aceb20d769b4687e91d427c2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/amplab/tachyon/pulls/1025/commits","review_comments_url":"https://api.github.com/repos/amplab/tachyon/pulls/1025/comments","review_comment_url":"https://api.github.com/repos/amplab/tachyon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/amplab/tachyon/issues/1025/comments","statuses_url":"https://api.github.com/repos/amplab/tachyon/statuses/cf94fc2cb9515d1a62c8257198cfb00c263508fd","head":{"label":"qnu:master","ref":"master","sha":"cf94fc2cb9515d1a62c8257198cfb00c263508fd","user":{"login":"qnu","id":901792,"avatar_url":"https://avatars.githubusercontent.com/u/901792?v=3","gravatar_id":"","url":"https://api.github.com/users/qnu","html_url":"https://github.com/qnu","followers_url":"https://api.github.com/users/qnu/followers","following_url":"https://api.github.com/users/qnu/following{/other_user}","gists_url":"https://api.github.com/users/qnu/gists{/gist_id}","starred_url":"https://api.github.com/users/qnu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qnu/subscriptions","organizations_url":"https://api.github.com/users/qnu/orgs","repos_url":"https://api.github.com/users/qnu/repos","events_url":"https://api.github.com/users/qnu/events{/privacy}","received_events_url":"https://api.github.com/users/qnu/received_events","type":"User","site_admin":false},"repo":{"id":37870851,"name":"tachyon","full_name":"qnu/tachyon","owner":{"login":"qnu","id":901792,"avatar_url":"https://avatars.githubusercontent.com/u/901792?v=3","gravatar_id":"","url":"https://api.github.com/users/qnu","html_url":"https://github.com/qnu","followers_url":"https://api.github.com/users/qnu/followers","following_url":"https://api.github.com/users/qnu/following{/other_user}","gists_url":"https://api.github.com/users/qnu/gists{/gist_id}","starred_url":"https://api.github.com/users/qnu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qnu/subscriptions","organizations_url":"https://api.github.com/users/qnu/orgs","repos_url":"https://api.github.com/users/qnu/repos","events_url":"https://api.github.com/users/qnu/events{/privacy}","received_events_url":"https://api.github.com/users/qnu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/qnu/tachyon","description":" A Reliable Memory Centric Distributed Storage System","fork":true,"url":"https://api.github.com/repos/qnu/tachyon","forks_url":"https://api.github.com/repos/qnu/tachyon/forks","keys_url":"https://api.github.com/repos/qnu/tachyon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qnu/tachyon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qnu/tachyon/teams","hooks_url":"https://api.github.com/repos/qnu/tachyon/hooks","issue_events_url":"https://api.github.com/repos/qnu/tachyon/issues/events{/number}","events_url":"https://api.github.com/repos/qnu/tachyon/events","assignees_url":"https://api.github.com/repos/qnu/tachyon/assignees{/user}","branches_url":"https://api.github.com/repos/qnu/tachyon/branches{/branch}","tags_url":"https://api.github.com/repos/qnu/tachyon/tags","blobs_url":"https://api.github.com/repos/qnu/tachyon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qnu/tachyon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qnu/tachyon/git/refs{/sha}","trees_url":"https://api.github.com/repos/qnu/tachyon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qnu/tachyon/statuses/{sha}","languages_url":"https://api.github.com/repos/qnu/tachyon/languages","stargazers_url":"https://api.github.com/repos/qnu/tachyon/stargazers","contributors_url":"https://api.github.com/repos/qnu/tachyon/contributors","subscribers_url":"https://api.github.com/repos/qnu/tachyon/subscribers","subscription_url":"https://api.github.com/repos/qnu/tachyon/subscription","commits_url":"https://api.github.com/repos/qnu/tachyon/commits{/sha}","git_commits_url":"https://api.github.com/repos/qnu/tachyon/git/commits{/sha}","comments_url":"https://api.github.com/repos/qnu/tachyon/comments{/number}","issue_comment_url":"https://api.github.com/repos/qnu/tachyon/issues/comments{/number}","contents_url":"https://api.github.com/repos/qnu/tachyon/contents/{+path}","compare_url":"https://api.github.com/repos/qnu/tachyon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qnu/tachyon/merges","archive_url":"https://api.github.com/repos/qnu/tachyon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qnu/tachyon/downloads","issues_url":"https://api.github.com/repos/qnu/tachyon/issues{/number}","pulls_url":"https://api.github.com/repos/qnu/tachyon/pulls{/number}","milestones_url":"https://api.github.com/repos/qnu/tachyon/milestones{/number}","notifications_url":"https://api.github.com/repos/qnu/tachyon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qnu/tachyon/labels{/name}","releases_url":"https://api.github.com/repos/qnu/tachyon/releases{/id}","created_at":"2015-06-22T17:47:33Z","updated_at":"2015-06-22T17:47:35Z","pushed_at":"2015-07-06T22:59:36Z","git_url":"git://github.com/qnu/tachyon.git","ssh_url":"git@github.com:qnu/tachyon.git","clone_url":"https://github.com/qnu/tachyon.git","svn_url":"https://github.com/qnu/tachyon","homepage":"http://tachyon-project.org","size":14794,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"amplab:master","ref":"master","sha":"56ea0422471691d236bc2184e4b217ef5b26b57e","user":{"login":"amplab","id":1438454,"avatar_url":"https://avatars.githubusercontent.com/u/1438454?v=3","gravatar_id":"","url":"https://api.github.com/users/amplab","html_url":"https://github.com/amplab","followers_url":"https://api.github.com/users/amplab/followers","following_url":"https://api.github.com/users/amplab/following{/other_user}","gists_url":"https://api.github.com/users/amplab/gists{/gist_id}","starred_url":"https://api.github.com/users/amplab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amplab/subscriptions","organizations_url":"https://api.github.com/users/amplab/orgs","repos_url":"https://api.github.com/users/amplab/repos","events_url":"https://api.github.com/users/amplab/events{/privacy}","received_events_url":"https://api.github.com/users/amplab/received_events","type":"Organization","site_admin":false},"repo":{"id":7276954,"name":"tachyon","full_name":"amplab/tachyon","owner":{"login":"amplab","id":1438454,"avatar_url":"https://avatars.githubusercontent.com/u/1438454?v=3","gravatar_id":"","url":"https://api.github.com/users/amplab","html_url":"https://github.com/amplab","followers_url":"https://api.github.com/users/amplab/followers","following_url":"https://api.github.com/users/amplab/following{/other_user}","gists_url":"https://api.github.com/users/amplab/gists{/gist_id}","starred_url":"https://api.github.com/users/amplab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amplab/subscriptions","organizations_url":"https://api.github.com/users/amplab/orgs","repos_url":"https://api.github.com/users/amplab/repos","events_url":"https://api.github.com/users/amplab/events{/privacy}","received_events_url":"https://api.github.com/users/amplab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/amplab/tachyon","description":" A Reliable Memory Centric Distributed Storage System","fork":false,"url":"https://api.github.com/repos/amplab/tachyon","forks_url":"https://api.github.com/repos/amplab/tachyon/forks","keys_url":"https://api.github.com/repos/amplab/tachyon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amplab/tachyon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amplab/tachyon/teams","hooks_url":"https://api.github.com/repos/amplab/tachyon/hooks","issue_events_url":"https://api.github.com/repos/amplab/tachyon/issues/events{/number}","events_url":"https://api.github.com/repos/amplab/tachyon/events","assignees_url":"https://api.github.com/repos/amplab/tachyon/assignees{/user}","branches_url":"https://api.github.com/repos/amplab/tachyon/branches{/branch}","tags_url":"https://api.github.com/repos/amplab/tachyon/tags","blobs_url":"https://api.github.com/repos/amplab/tachyon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amplab/tachyon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amplab/tachyon/git/refs{/sha}","trees_url":"https://api.github.com/repos/amplab/tachyon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amplab/tachyon/statuses/{sha}","languages_url":"https://api.github.com/repos/amplab/tachyon/languages","stargazers_url":"https://api.github.com/repos/amplab/tachyon/stargazers","contributors_url":"https://api.github.com/repos/amplab/tachyon/contributors","subscribers_url":"https://api.github.com/repos/amplab/tachyon/subscribers","subscription_url":"https://api.github.com/repos/amplab/tachyon/subscription","commits_url":"https://api.github.com/repos/amplab/tachyon/commits{/sha}","git_commits_url":"https://api.github.com/repos/amplab/tachyon/git/commits{/sha}","comments_url":"https://api.github.com/repos/amplab/tachyon/comments{/number}","issue_comment_url":"https://api.github.com/repos/amplab/tachyon/issues/comments{/number}","contents_url":"https://api.github.com/repos/amplab/tachyon/contents/{+path}","compare_url":"https://api.github.com/repos/amplab/tachyon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amplab/tachyon/merges","archive_url":"https://api.github.com/repos/amplab/tachyon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amplab/tachyon/downloads","issues_url":"https://api.github.com/repos/amplab/tachyon/issues{/number}","pulls_url":"https://api.github.com/repos/amplab/tachyon/pulls{/number}","milestones_url":"https://api.github.com/repos/amplab/tachyon/milestones{/number}","notifications_url":"https://api.github.com/repos/amplab/tachyon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amplab/tachyon/labels{/name}","releases_url":"https://api.github.com/repos/amplab/tachyon/releases{/id}","created_at":"2012-12-21T17:43:46Z","updated_at":"2015-07-06T01:53:21Z","pushed_at":"2015-07-07T06:34:44Z","git_url":"git://github.com/amplab/tachyon.git","ssh_url":"git@github.com:amplab/tachyon.git","clone_url":"https://github.com/amplab/tachyon.git","svn_url":"https://github.com/amplab/tachyon","homepage":"http://tachyon-project.org","size":34278,"stargazers_count":1468,"watchers_count":1468,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":540,"mirror_url":null,"open_issues_count":27,"forks":540,"open_issues":27,"watchers":1468,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/1025"},"html":{"href":"https://github.com/amplab/tachyon/pull/1025"},"issue":{"href":"https://api.github.com/repos/amplab/tachyon/issues/1025"},"comments":{"href":"https://api.github.com/repos/amplab/tachyon/issues/1025/comments"},"review_comments":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/1025/comments"},"review_comment":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/1025/commits"},"statuses":{"href":"https://api.github.com/repos/amplab/tachyon/statuses/cf94fc2cb9515d1a62c8257198cfb00c263508fd"}}}}