{"action":"created","comment":{"url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/comments/67829085","id":67829085,"diff_hunk":"@@ -320,10 +327,14 @@ public void testUpdateInstructorByGoogleId() throws Exception {\n             signalFailureToDetectException();\n         } catch (InvalidParametersException e) {\n             AssertHelper.assertContains(\n-                    String.format(FieldValidator.PERSON_NAME_ERROR_MESSAGE, instructorToEdit.name,\n-                                  FieldValidator.REASON_EMPTY) + Const.EOL\n-                        + String.format(FieldValidator.EMAIL_ERROR_MESSAGE, instructorToEdit.email,\n-                                        FieldValidator.REASON_INCORRECT_FORMAT),\n+                    FieldValidatorTest.getInterpolatedErrorMessage(\n+                        FieldValidator.SIZE_CAPPED_NON_EMPTY_STRING_ERROR_MESSAGE, instructorToEdit.name,\n+                        FieldValidator.PERSON_NAME_FIELD_NAME, FieldValidator.REASON_EMPTY,\n+                        FieldValidator.PERSON_NAME_MAX_LENGTH) + Const.EOL\n+                    + FieldValidatorTest.getInterpolatedErrorMessage(\n+                          FieldValidator.EMAIL_ERROR_MESSAGE, instructorToEdit.email,\n+                          FieldValidator.EMAIL_FIELD_NAME, FieldValidator.REASON_INCORRECT_FORMAT,\n+                          FieldValidator.EMAIL_MAX_LENGTH),","path":"src/test/java/teammates/test/cases/storage/InstructorsDbTest.java","position":51,"original_position":51,"commit_id":"cc6cc093f56a5000806be55a5027cb76f849ebec","original_commit_id":"cc6cc093f56a5000806be55a5027cb76f849ebec","user":{"login":"wkurniawan07","id":7261051,"avatar_url":"https://avatars.githubusercontent.com/u/7261051?v=3","gravatar_id":"","url":"https://api.github.com/users/wkurniawan07","html_url":"https://github.com/wkurniawan07","followers_url":"https://api.github.com/users/wkurniawan07/followers","following_url":"https://api.github.com/users/wkurniawan07/following{/other_user}","gists_url":"https://api.github.com/users/wkurniawan07/gists{/gist_id}","starred_url":"https://api.github.com/users/wkurniawan07/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wkurniawan07/subscriptions","organizations_url":"https://api.github.com/users/wkurniawan07/orgs","repos_url":"https://api.github.com/users/wkurniawan07/repos","events_url":"https://api.github.com/users/wkurniawan07/events{/privacy}","received_events_url":"https://api.github.com/users/wkurniawan07/received_events","type":"User","site_admin":false},"body":"The indentation here is inconsistent with the one below.","created_at":"2016-06-21T08:43:21Z","updated_at":"2016-06-21T08:43:21Z","html_url":"https://github.com/TEAMMATES/teammates/pull/5592#discussion_r67829085","pull_request_url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/5592","_links":{"self":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/comments/67829085"},"html":{"href":"https://github.com/TEAMMATES/teammates/pull/5592#discussion_r67829085"},"pull_request":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/5592"}}},"pull_request":{"url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/5592","id":73459381,"html_url":"https://github.com/TEAMMATES/teammates/pull/5592","diff_url":"https://github.com/TEAMMATES/teammates/pull/5592.diff","patch_url":"https://github.com/TEAMMATES/teammates/pull/5592.patch","issue_url":"https://api.github.com/repos/TEAMMATES/teammates/issues/5592","number":5592,"state":"open","locked":false,"title":"Reduce unnecessary arguments to String.format() in FieldValidator #5369","user":{"login":"YongJieYongJie","id":14101781,"avatar_url":"https://avatars.githubusercontent.com/u/14101781?v=3","gravatar_id":"","url":"https://api.github.com/users/YongJieYongJie","html_url":"https://github.com/YongJieYongJie","followers_url":"https://api.github.com/users/YongJieYongJie/followers","following_url":"https://api.github.com/users/YongJieYongJie/following{/other_user}","gists_url":"https://api.github.com/users/YongJieYongJie/gists{/gist_id}","starred_url":"https://api.github.com/users/YongJieYongJie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YongJieYongJie/subscriptions","organizations_url":"https://api.github.com/users/YongJieYongJie/orgs","repos_url":"https://api.github.com/users/YongJieYongJie/repos","events_url":"https://api.github.com/users/YongJieYongJie/events{/privacy}","received_events_url":"https://api.github.com/users/YongJieYongJie/received_events","type":"User","site_admin":false},"body":"Fixes #5369\r\n\r\nTurns out have to change `String.format(ERROR_MSG_TEMPLATE, EMAIL_FIELD_NAME, ...)` to something like `ERROR_MSG_TEMPLATE.replace(\"{fieldName}\", EMAIL_FIELD_NAME).replace(...`.\r\n\r\nThis is because our error message construction mechanism is rather sophisticated, and `String.format()` is not flexible enough (e.g., you cannot insert only the fieldname in one method, and insert the reason for invalidity in another)","created_at":"2016-06-11T05:24:02Z","updated_at":"2016-06-21T08:43:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8bfc04958016853805af824cbaa50446f4bb45ad","assignee":{"login":"wkurniawan07","id":7261051,"avatar_url":"https://avatars.githubusercontent.com/u/7261051?v=3","gravatar_id":"","url":"https://api.github.com/users/wkurniawan07","html_url":"https://github.com/wkurniawan07","followers_url":"https://api.github.com/users/wkurniawan07/followers","following_url":"https://api.github.com/users/wkurniawan07/following{/other_user}","gists_url":"https://api.github.com/users/wkurniawan07/gists{/gist_id}","starred_url":"https://api.github.com/users/wkurniawan07/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wkurniawan07/subscriptions","organizations_url":"https://api.github.com/users/wkurniawan07/orgs","repos_url":"https://api.github.com/users/wkurniawan07/repos","events_url":"https://api.github.com/users/wkurniawan07/events{/privacy}","received_events_url":"https://api.github.com/users/wkurniawan07/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/5592/commits","review_comments_url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/5592/comments","review_comment_url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TEAMMATES/teammates/issues/5592/comments","statuses_url":"https://api.github.com/repos/TEAMMATES/teammates/statuses/cc6cc093f56a5000806be55a5027cb76f849ebec","head":{"label":"YongJieYongJie:5369-reduce-unnecessary-string-formatting-in-fieldvalidator","ref":"5369-reduce-unnecessary-string-formatting-in-fieldvalidator","sha":"cc6cc093f56a5000806be55a5027cb76f849ebec","user":{"login":"YongJieYongJie","id":14101781,"avatar_url":"https://avatars.githubusercontent.com/u/14101781?v=3","gravatar_id":"","url":"https://api.github.com/users/YongJieYongJie","html_url":"https://github.com/YongJieYongJie","followers_url":"https://api.github.com/users/YongJieYongJie/followers","following_url":"https://api.github.com/users/YongJieYongJie/following{/other_user}","gists_url":"https://api.github.com/users/YongJieYongJie/gists{/gist_id}","starred_url":"https://api.github.com/users/YongJieYongJie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YongJieYongJie/subscriptions","organizations_url":"https://api.github.com/users/YongJieYongJie/orgs","repos_url":"https://api.github.com/users/YongJieYongJie/repos","events_url":"https://api.github.com/users/YongJieYongJie/events{/privacy}","received_events_url":"https://api.github.com/users/YongJieYongJie/received_events","type":"User","site_admin":false},"repo":{"id":53263692,"name":"teammates","full_name":"YongJieYongJie/teammates","owner":{"login":"YongJieYongJie","id":14101781,"avatar_url":"https://avatars.githubusercontent.com/u/14101781?v=3","gravatar_id":"","url":"https://api.github.com/users/YongJieYongJie","html_url":"https://github.com/YongJieYongJie","followers_url":"https://api.github.com/users/YongJieYongJie/followers","following_url":"https://api.github.com/users/YongJieYongJie/following{/other_user}","gists_url":"https://api.github.com/users/YongJieYongJie/gists{/gist_id}","starred_url":"https://api.github.com/users/YongJieYongJie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YongJieYongJie/subscriptions","organizations_url":"https://api.github.com/users/YongJieYongJie/orgs","repos_url":"https://api.github.com/users/YongJieYongJie/repos","events_url":"https://api.github.com/users/YongJieYongJie/events{/privacy}","received_events_url":"https://api.github.com/users/YongJieYongJie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/YongJieYongJie/teammates","description":"This is the project website for the TEAMMATES feedback management tool for education","fork":true,"url":"https://api.github.com/repos/YongJieYongJie/teammates","forks_url":"https://api.github.com/repos/YongJieYongJie/teammates/forks","keys_url":"https://api.github.com/repos/YongJieYongJie/teammates/keys{/key_id}","collaborators_url":"https://api.github.com/repos/YongJieYongJie/teammates/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/YongJieYongJie/teammates/teams","hooks_url":"https://api.github.com/repos/YongJieYongJie/teammates/hooks","issue_events_url":"https://api.github.com/repos/YongJieYongJie/teammates/issues/events{/number}","events_url":"https://api.github.com/repos/YongJieYongJie/teammates/events","assignees_url":"https://api.github.com/repos/YongJieYongJie/teammates/assignees{/user}","branches_url":"https://api.github.com/repos/YongJieYongJie/teammates/branches{/branch}","tags_url":"https://api.github.com/repos/YongJieYongJie/teammates/tags","blobs_url":"https://api.github.com/repos/YongJieYongJie/teammates/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/YongJieYongJie/teammates/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/YongJieYongJie/teammates/git/refs{/sha}","trees_url":"https://api.github.com/repos/YongJieYongJie/teammates/git/trees{/sha}","statuses_url":"https://api.github.com/repos/YongJieYongJie/teammates/statuses/{sha}","languages_url":"https://api.github.com/repos/YongJieYongJie/teammates/languages","stargazers_url":"https://api.github.com/repos/YongJieYongJie/teammates/stargazers","contributors_url":"https://api.github.com/repos/YongJieYongJie/teammates/contributors","subscribers_url":"https://api.github.com/repos/YongJieYongJie/teammates/subscribers","subscription_url":"https://api.github.com/repos/YongJieYongJie/teammates/subscription","commits_url":"https://api.github.com/repos/YongJieYongJie/teammates/commits{/sha}","git_commits_url":"https://api.github.com/repos/YongJieYongJie/teammates/git/commits{/sha}","comments_url":"https://api.github.com/repos/YongJieYongJie/teammates/comments{/number}","issue_comment_url":"https://api.github.com/repos/YongJieYongJie/teammates/issues/comments{/number}","contents_url":"https://api.github.com/repos/YongJieYongJie/teammates/contents/{+path}","compare_url":"https://api.github.com/repos/YongJieYongJie/teammates/compare/{base}...{head}","merges_url":"https://api.github.com/repos/YongJieYongJie/teammates/merges","archive_url":"https://api.github.com/repos/YongJieYongJie/teammates/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/YongJieYongJie/teammates/downloads","issues_url":"https://api.github.com/repos/YongJieYongJie/teammates/issues{/number}","pulls_url":"https://api.github.com/repos/YongJieYongJie/teammates/pulls{/number}","milestones_url":"https://api.github.com/repos/YongJieYongJie/teammates/milestones{/number}","notifications_url":"https://api.github.com/repos/YongJieYongJie/teammates/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/YongJieYongJie/teammates/labels{/name}","releases_url":"https://api.github.com/repos/YongJieYongJie/teammates/releases{/id}","deployments_url":"https://api.github.com/repos/YongJieYongJie/teammates/deployments","created_at":"2016-03-06T16:12:07Z","updated_at":"2016-03-06T16:12:14Z","pushed_at":"2016-06-21T01:47:20Z","git_url":"git://github.com/YongJieYongJie/teammates.git","ssh_url":"git@github.com:YongJieYongJie/teammates.git","clone_url":"https://github.com/YongJieYongJie/teammates.git","svn_url":"https://github.com/YongJieYongJie/teammates","homepage":"http://teammatesv4.appspot.com/","size":160975,"stargazers_count":0,"watchers_count":0,"language":"HTML","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":"TEAMMATES:master","ref":"master","sha":"79eaa7c703b2221c55ac55d127196f4b5655ab36","user":{"login":"TEAMMATES","id":7374810,"avatar_url":"https://avatars.githubusercontent.com/u/7374810?v=3","gravatar_id":"","url":"https://api.github.com/users/TEAMMATES","html_url":"https://github.com/TEAMMATES","followers_url":"https://api.github.com/users/TEAMMATES/followers","following_url":"https://api.github.com/users/TEAMMATES/following{/other_user}","gists_url":"https://api.github.com/users/TEAMMATES/gists{/gist_id}","starred_url":"https://api.github.com/users/TEAMMATES/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TEAMMATES/subscriptions","organizations_url":"https://api.github.com/users/TEAMMATES/orgs","repos_url":"https://api.github.com/users/TEAMMATES/repos","events_url":"https://api.github.com/users/TEAMMATES/events{/privacy}","received_events_url":"https://api.github.com/users/TEAMMATES/received_events","type":"Organization","site_admin":false},"repo":{"id":19369035,"name":"teammates","full_name":"TEAMMATES/teammates","owner":{"login":"TEAMMATES","id":7374810,"avatar_url":"https://avatars.githubusercontent.com/u/7374810?v=3","gravatar_id":"","url":"https://api.github.com/users/TEAMMATES","html_url":"https://github.com/TEAMMATES","followers_url":"https://api.github.com/users/TEAMMATES/followers","following_url":"https://api.github.com/users/TEAMMATES/following{/other_user}","gists_url":"https://api.github.com/users/TEAMMATES/gists{/gist_id}","starred_url":"https://api.github.com/users/TEAMMATES/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TEAMMATES/subscriptions","organizations_url":"https://api.github.com/users/TEAMMATES/orgs","repos_url":"https://api.github.com/users/TEAMMATES/repos","events_url":"https://api.github.com/users/TEAMMATES/events{/privacy}","received_events_url":"https://api.github.com/users/TEAMMATES/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TEAMMATES/teammates","description":"This is the project website for the TEAMMATES feedback management tool for education","fork":false,"url":"https://api.github.com/repos/TEAMMATES/teammates","forks_url":"https://api.github.com/repos/TEAMMATES/teammates/forks","keys_url":"https://api.github.com/repos/TEAMMATES/teammates/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TEAMMATES/teammates/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TEAMMATES/teammates/teams","hooks_url":"https://api.github.com/repos/TEAMMATES/teammates/hooks","issue_events_url":"https://api.github.com/repos/TEAMMATES/teammates/issues/events{/number}","events_url":"https://api.github.com/repos/TEAMMATES/teammates/events","assignees_url":"https://api.github.com/repos/TEAMMATES/teammates/assignees{/user}","branches_url":"https://api.github.com/repos/TEAMMATES/teammates/branches{/branch}","tags_url":"https://api.github.com/repos/TEAMMATES/teammates/tags","blobs_url":"https://api.github.com/repos/TEAMMATES/teammates/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TEAMMATES/teammates/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TEAMMATES/teammates/git/refs{/sha}","trees_url":"https://api.github.com/repos/TEAMMATES/teammates/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TEAMMATES/teammates/statuses/{sha}","languages_url":"https://api.github.com/repos/TEAMMATES/teammates/languages","stargazers_url":"https://api.github.com/repos/TEAMMATES/teammates/stargazers","contributors_url":"https://api.github.com/repos/TEAMMATES/teammates/contributors","subscribers_url":"https://api.github.com/repos/TEAMMATES/teammates/subscribers","subscription_url":"https://api.github.com/repos/TEAMMATES/teammates/subscription","commits_url":"https://api.github.com/repos/TEAMMATES/teammates/commits{/sha}","git_commits_url":"https://api.github.com/repos/TEAMMATES/teammates/git/commits{/sha}","comments_url":"https://api.github.com/repos/TEAMMATES/teammates/comments{/number}","issue_comment_url":"https://api.github.com/repos/TEAMMATES/teammates/issues/comments{/number}","contents_url":"https://api.github.com/repos/TEAMMATES/teammates/contents/{+path}","compare_url":"https://api.github.com/repos/TEAMMATES/teammates/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TEAMMATES/teammates/merges","archive_url":"https://api.github.com/repos/TEAMMATES/teammates/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TEAMMATES/teammates/downloads","issues_url":"https://api.github.com/repos/TEAMMATES/teammates/issues{/number}","pulls_url":"https://api.github.com/repos/TEAMMATES/teammates/pulls{/number}","milestones_url":"https://api.github.com/repos/TEAMMATES/teammates/milestones{/number}","notifications_url":"https://api.github.com/repos/TEAMMATES/teammates/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TEAMMATES/teammates/labels{/name}","releases_url":"https://api.github.com/repos/TEAMMATES/teammates/releases{/id}","deployments_url":"https://api.github.com/repos/TEAMMATES/teammates/deployments","created_at":"2014-05-02T07:43:00Z","updated_at":"2016-06-19T15:24:58Z","pushed_at":"2016-06-21T08:41:56Z","git_url":"git://github.com/TEAMMATES/teammates.git","ssh_url":"git@github.com:TEAMMATES/teammates.git","clone_url":"https://github.com/TEAMMATES/teammates.git","svn_url":"https://github.com/TEAMMATES/teammates","homepage":"http://teammatesv4.appspot.com/","size":184608,"stargazers_count":96,"watchers_count":96,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":250,"mirror_url":null,"open_issues_count":492,"forks":250,"open_issues":492,"watchers":96,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/5592"},"html":{"href":"https://github.com/TEAMMATES/teammates/pull/5592"},"issue":{"href":"https://api.github.com/repos/TEAMMATES/teammates/issues/5592"},"comments":{"href":"https://api.github.com/repos/TEAMMATES/teammates/issues/5592/comments"},"review_comments":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/5592/comments"},"review_comment":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/5592/commits"},"statuses":{"href":"https://api.github.com/repos/TEAMMATES/teammates/statuses/cc6cc093f56a5000806be55a5027cb76f849ebec"}}}}
{"actor":{"display_login":"wkurniawan07"}}