{"action":"created","comment":{"url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/comments/57436408","id":57436408,"diff_hunk":"@@ -516,16 +526,13 @@ public String getInvalidityInfo(FieldType fieldType, String fieldName, Object va\n     public String getValidityInfoForSizeCappedAlphanumericNonEmptyString(String fieldName, int maxLength, String value) {\n         \n         Assumption.assertTrue(\"Non-null value expected for \"+fieldName, value != null);\n-        String sanitizedValue = Sanitizer.sanitizeForHtml(value);\n         \n-        if (value.isEmpty()) {\n-            return String.format(SIZE_CAPPED_NON_EMPTY_STRING_ERROR_MESSAGE, value, fieldName, REASON_EMPTY, fieldName, maxLength);\n+        if (value.isEmpty() || value.length()>maxLength) {","path":"src/main/java/teammates/common/util/FieldValidator.java","position":395,"original_position":395,"commit_id":"cefa006cd9ebdc1fccfb08a5603e3b697d909446","original_commit_id":"cefa006cd9ebdc1fccfb08a5603e3b697d909446","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":"Conditional check is combined because I combined the error message for empty string and string too long.\r\n(As suggested in the original issue thread at [this comment][link].)\r\n\r\n[link]: https://github.com/TEAMMATES/teammates/issues/4129#issuecomment-133441150","created_at":"2016-03-25T11:09:31Z","updated_at":"2016-03-25T11:09:31Z","html_url":"https://github.com/TEAMMATES/teammates/pull/5014#discussion_r57436408","pull_request_url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/5014","_links":{"self":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/comments/57436408"},"html":{"href":"https://github.com/TEAMMATES/teammates/pull/5014#discussion_r57436408"},"pull_request":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/5014"}}},"pull_request":{"url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/5014","id":63011092,"html_url":"https://github.com/TEAMMATES/teammates/pull/5014","diff_url":"https://github.com/TEAMMATES/teammates/pull/5014.diff","patch_url":"https://github.com/TEAMMATES/teammates/pull/5014.patch","issue_url":"https://api.github.com/repos/TEAMMATES/teammates/issues/5014","number":5014,"state":"open","locked":false,"title":"Be more specific when a field is empty. #4129","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 #4129 and #3637 ","created_at":"2016-03-16T03:56:21Z","updated_at":"2016-03-25T11:09:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"57dec7fb029b0e5809d67650dc1f3d4be604e09d","assignee":{"login":"junhaoyap","id":6291947,"avatar_url":"https://avatars.githubusercontent.com/u/6291947?v=3","gravatar_id":"","url":"https://api.github.com/users/junhaoyap","html_url":"https://github.com/junhaoyap","followers_url":"https://api.github.com/users/junhaoyap/followers","following_url":"https://api.github.com/users/junhaoyap/following{/other_user}","gists_url":"https://api.github.com/users/junhaoyap/gists{/gist_id}","starred_url":"https://api.github.com/users/junhaoyap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/junhaoyap/subscriptions","organizations_url":"https://api.github.com/users/junhaoyap/orgs","repos_url":"https://api.github.com/users/junhaoyap/repos","events_url":"https://api.github.com/users/junhaoyap/events{/privacy}","received_events_url":"https://api.github.com/users/junhaoyap/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/5014/commits","review_comments_url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/5014/comments","review_comment_url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TEAMMATES/teammates/issues/5014/comments","statuses_url":"https://api.github.com/repos/TEAMMATES/teammates/statuses/cefa006cd9ebdc1fccfb08a5603e3b697d909446","head":{"label":"YongJieYongJie:4129-error-message-for-empty-field-not-specific","ref":"4129-error-message-for-empty-field-not-specific","sha":"cefa006cd9ebdc1fccfb08a5603e3b697d909446","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-03-25T10:52:23Z","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":145409,"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":"15114d8b90144ab35be29ef1caeb11107e092ee3","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-03-23T04:19:20Z","pushed_at":"2016-03-25T10:52:23Z","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":149429,"stargazers_count":73,"watchers_count":73,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":219,"mirror_url":null,"open_issues_count":521,"forks":219,"open_issues":521,"watchers":73,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/5014"},"html":{"href":"https://github.com/TEAMMATES/teammates/pull/5014"},"issue":{"href":"https://api.github.com/repos/TEAMMATES/teammates/issues/5014"},"comments":{"href":"https://api.github.com/repos/TEAMMATES/teammates/issues/5014/comments"},"review_comments":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/5014/comments"},"review_comment":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/5014/commits"},"statuses":{"href":"https://api.github.com/repos/TEAMMATES/teammates/statuses/cefa006cd9ebdc1fccfb08a5603e3b697d909446"}}}}