{"action":"created","comment":{"url":"https://api.github.com/repos/TEAMMATES/repo/pulls/comments/30399173","id":30399173,"diff_hunk":"@@ -65,90 +66,97 @@ public StudentProfileAttributes() {\n         this.pictureKey = \"\";\n         this.modifiedDate = null;\n     }\n-    \n+\n     public String generateUpdateMessageForStudent() {\n-        String reminder = \"\";\n-        \n         if (isMultipleFieldsEmpty()) {\n-            reminder = Const.StatusMessages.STUDENT_UPDATE_PROFILE; \n+            return Const.StatusMessages.STUDENT_UPDATE_PROFILE;\n         } else {\n             if (this.shortName.isEmpty()) {\n-                reminder = Const.StatusMessages.STUDENT_UPDATE_PROFILE_SHORTNAME; \n+                return Const.StatusMessages.STUDENT_UPDATE_PROFILE_SHORTNAME;\n             } else if (this.email.isEmpty()) {\n-                reminder = Const.StatusMessages.STUDENT_UPDATE_PROFILE_EMAIL; \n+                return Const.StatusMessages.STUDENT_UPDATE_PROFILE_EMAIL;\n             } else if (this.pictureKey.isEmpty()) {\n-                reminder = Const.StatusMessages.STUDENT_UPDATE_PROFILE_PICTURE;\n+                return Const.StatusMessages.STUDENT_UPDATE_PROFILE_PICTURE;\n             } else if (this.moreInfo.isEmpty()) {\n-                reminder = Const.StatusMessages.STUDENT_UPDATE_PROFILE_MOREINFO;\n+                return Const.StatusMessages.STUDENT_UPDATE_PROFILE_MOREINFO;\n             } else if (this.nationality.isEmpty()) {\n-                reminder = Const.StatusMessages.STUDENT_UPDATE_PROFILE_NATIONALITY;\n+                return Const.StatusMessages.STUDENT_UPDATE_PROFILE_NATIONALITY;\n             }\n+            return \"\";\n         }\n-        \n-        return reminder;\n     }\n-    \n+\n     private boolean isMultipleFieldsEmpty() {\n-        int numEmptyFields = 0;\n-        if (this.shortName.isEmpty()) {\n-            numEmptyFields ++;\n-        }\n-        if (this.email.isEmpty()) {\n-            numEmptyFields ++;\n-        }\n-        if (this.nationality.isEmpty()) {\n-            numEmptyFields ++;\n-        }\n-        if (this.moreInfo.isEmpty()) {\n-            numEmptyFields ++;\n-        }\n-        if (this.pictureKey.isEmpty()) {\n-            numEmptyFields ++;\n-        }\n-        \n+        int numEmptyFields = addCounterIfEmpty(shortName)\n+                + addCounterIfEmpty(email)\n+                + addCounterIfEmpty(nationality)\n+                + addCounterIfEmpty(moreInfo)\n+                + addCounterIfEmpty(pictureKey);\n         return numEmptyFields > 1;\n     }\n \n+    private int addCounterIfEmpty(String str) {","path":"src/main/java/teammates/common/datatransfer/StudentProfileAttributes.java","position":94,"original_position":94,"commit_id":"6f75e45a28db1b8254245dc0701ed47a8ccf3754","original_commit_id":"6f75e45a28db1b8254245dc0701ed47a8ccf3754","user":{"login":"damithc","id":1673303,"avatar_url":"https://avatars.githubusercontent.com/u/1673303?v=3","gravatar_id":"","url":"https://api.github.com/users/damithc","html_url":"https://github.com/damithc","followers_url":"https://api.github.com/users/damithc/followers","following_url":"https://api.github.com/users/damithc/following{/other_user}","gists_url":"https://api.github.com/users/damithc/gists{/gist_id}","starred_url":"https://api.github.com/users/damithc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/damithc/subscriptions","organizations_url":"https://api.github.com/users/damithc/orgs","repos_url":"https://api.github.com/users/damithc/repos","events_url":"https://api.github.com/users/damithc/events{/privacy}","received_events_url":"https://api.github.com/users/damithc/received_events","type":"User","site_admin":false},"body":"This method is not involve any 'adding' (or a 'counter'), so the method name is not appropriate. Name methods based on what it does, not how it is used. ","created_at":"2015-05-15T10:35:27Z","updated_at":"2015-05-15T10:35:27Z","html_url":"https://github.com/TEAMMATES/repo/pull/3411#discussion_r30399173","pull_request_url":"https://api.github.com/repos/TEAMMATES/repo/pulls/3411","_links":{"self":{"href":"https://api.github.com/repos/TEAMMATES/repo/pulls/comments/30399173"},"html":{"href":"https://github.com/TEAMMATES/repo/pull/3411#discussion_r30399173"},"pull_request":{"href":"https://api.github.com/repos/TEAMMATES/repo/pulls/3411"}}},"pull_request":{"url":"https://api.github.com/repos/TEAMMATES/repo/pulls/3411","id":35500157,"html_url":"https://github.com/TEAMMATES/repo/pull/3411","diff_url":"https://github.com/TEAMMATES/repo/pull/3411.diff","patch_url":"https://github.com/TEAMMATES/repo/pull/3411.patch","issue_url":"https://api.github.com/repos/TEAMMATES/repo/issues/3411","number":3411,"state":"open","locked":false,"title":"Refine StudentProfile slice #3408","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":"Fixes #3408 \r\nStill halfway through.","created_at":"2015-05-15T10:07:09Z","updated_at":"2015-05-15T10:35:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"862ca0e4c6ec7be07909db6c8986486330f7e1c2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/TEAMMATES/repo/pulls/3411/commits","review_comments_url":"https://api.github.com/repos/TEAMMATES/repo/pulls/3411/comments","review_comment_url":"https://api.github.com/repos/TEAMMATES/repo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TEAMMATES/repo/issues/3411/comments","statuses_url":"https://api.github.com/repos/TEAMMATES/repo/statuses/6f75e45a28db1b8254245dc0701ed47a8ccf3754","head":{"label":"wkurniawan07:Issue3408","ref":"Issue3408","sha":"6f75e45a28db1b8254245dc0701ed47a8ccf3754","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},"repo":{"id":32029982,"name":"repo","full_name":"wkurniawan07/repo","owner":{"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},"private":false,"html_url":"https://github.com/wkurniawan07/repo","description":"This is the project website for the TEAMMATES feedback management tool for education","fork":true,"url":"https://api.github.com/repos/wkurniawan07/repo","forks_url":"https://api.github.com/repos/wkurniawan07/repo/forks","keys_url":"https://api.github.com/repos/wkurniawan07/repo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wkurniawan07/repo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wkurniawan07/repo/teams","hooks_url":"https://api.github.com/repos/wkurniawan07/repo/hooks","issue_events_url":"https://api.github.com/repos/wkurniawan07/repo/issues/events{/number}","events_url":"https://api.github.com/repos/wkurniawan07/repo/events","assignees_url":"https://api.github.com/repos/wkurniawan07/repo/assignees{/user}","branches_url":"https://api.github.com/repos/wkurniawan07/repo/branches{/branch}","tags_url":"https://api.github.com/repos/wkurniawan07/repo/tags","blobs_url":"https://api.github.com/repos/wkurniawan07/repo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wkurniawan07/repo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wkurniawan07/repo/git/refs{/sha}","trees_url":"https://api.github.com/repos/wkurniawan07/repo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wkurniawan07/repo/statuses/{sha}","languages_url":"https://api.github.com/repos/wkurniawan07/repo/languages","stargazers_url":"https://api.github.com/repos/wkurniawan07/repo/stargazers","contributors_url":"https://api.github.com/repos/wkurniawan07/repo/contributors","subscribers_url":"https://api.github.com/repos/wkurniawan07/repo/subscribers","subscription_url":"https://api.github.com/repos/wkurniawan07/repo/subscription","commits_url":"https://api.github.com/repos/wkurniawan07/repo/commits{/sha}","git_commits_url":"https://api.github.com/repos/wkurniawan07/repo/git/commits{/sha}","comments_url":"https://api.github.com/repos/wkurniawan07/repo/comments{/number}","issue_comment_url":"https://api.github.com/repos/wkurniawan07/repo/issues/comments{/number}","contents_url":"https://api.github.com/repos/wkurniawan07/repo/contents/{+path}","compare_url":"https://api.github.com/repos/wkurniawan07/repo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wkurniawan07/repo/merges","archive_url":"https://api.github.com/repos/wkurniawan07/repo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wkurniawan07/repo/downloads","issues_url":"https://api.github.com/repos/wkurniawan07/repo/issues{/number}","pulls_url":"https://api.github.com/repos/wkurniawan07/repo/pulls{/number}","milestones_url":"https://api.github.com/repos/wkurniawan07/repo/milestones{/number}","notifications_url":"https://api.github.com/repos/wkurniawan07/repo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wkurniawan07/repo/labels{/name}","releases_url":"https://api.github.com/repos/wkurniawan07/repo/releases{/id}","created_at":"2015-03-11T17:00:24Z","updated_at":"2015-04-24T08:01:07Z","pushed_at":"2015-05-15T10:06:06Z","git_url":"git://github.com/wkurniawan07/repo.git","ssh_url":"git@github.com:wkurniawan07/repo.git","clone_url":"https://github.com/wkurniawan07/repo.git","svn_url":"https://github.com/wkurniawan07/repo","homepage":"http://teammatesv4.appspot.com/","size":117258,"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":"2b9b7ae55c9fa2cc3778ac2cc7cd029aa108ea11","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":"repo","full_name":"TEAMMATES/repo","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/repo","description":"This is the project website for the TEAMMATES feedback management tool for education","fork":false,"url":"https://api.github.com/repos/TEAMMATES/repo","forks_url":"https://api.github.com/repos/TEAMMATES/repo/forks","keys_url":"https://api.github.com/repos/TEAMMATES/repo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TEAMMATES/repo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TEAMMATES/repo/teams","hooks_url":"https://api.github.com/repos/TEAMMATES/repo/hooks","issue_events_url":"https://api.github.com/repos/TEAMMATES/repo/issues/events{/number}","events_url":"https://api.github.com/repos/TEAMMATES/repo/events","assignees_url":"https://api.github.com/repos/TEAMMATES/repo/assignees{/user}","branches_url":"https://api.github.com/repos/TEAMMATES/repo/branches{/branch}","tags_url":"https://api.github.com/repos/TEAMMATES/repo/tags","blobs_url":"https://api.github.com/repos/TEAMMATES/repo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TEAMMATES/repo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TEAMMATES/repo/git/refs{/sha}","trees_url":"https://api.github.com/repos/TEAMMATES/repo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TEAMMATES/repo/statuses/{sha}","languages_url":"https://api.github.com/repos/TEAMMATES/repo/languages","stargazers_url":"https://api.github.com/repos/TEAMMATES/repo/stargazers","contributors_url":"https://api.github.com/repos/TEAMMATES/repo/contributors","subscribers_url":"https://api.github.com/repos/TEAMMATES/repo/subscribers","subscription_url":"https://api.github.com/repos/TEAMMATES/repo/subscription","commits_url":"https://api.github.com/repos/TEAMMATES/repo/commits{/sha}","git_commits_url":"https://api.github.com/repos/TEAMMATES/repo/git/commits{/sha}","comments_url":"https://api.github.com/repos/TEAMMATES/repo/comments{/number}","issue_comment_url":"https://api.github.com/repos/TEAMMATES/repo/issues/comments{/number}","contents_url":"https://api.github.com/repos/TEAMMATES/repo/contents/{+path}","compare_url":"https://api.github.com/repos/TEAMMATES/repo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TEAMMATES/repo/merges","archive_url":"https://api.github.com/repos/TEAMMATES/repo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TEAMMATES/repo/downloads","issues_url":"https://api.github.com/repos/TEAMMATES/repo/issues{/number}","pulls_url":"https://api.github.com/repos/TEAMMATES/repo/pulls{/number}","milestones_url":"https://api.github.com/repos/TEAMMATES/repo/milestones{/number}","notifications_url":"https://api.github.com/repos/TEAMMATES/repo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TEAMMATES/repo/labels{/name}","releases_url":"https://api.github.com/repos/TEAMMATES/repo/releases{/id}","created_at":"2014-05-02T07:43:00Z","updated_at":"2015-05-08T02:52:59Z","pushed_at":"2015-05-15T10:19:08Z","git_url":"git://github.com/TEAMMATES/repo.git","ssh_url":"git@github.com:TEAMMATES/repo.git","clone_url":"https://github.com/TEAMMATES/repo.git","svn_url":"https://github.com/TEAMMATES/repo","homepage":"http://teammatesv4.appspot.com/","size":144731,"stargazers_count":42,"watchers_count":42,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":122,"mirror_url":null,"open_issues_count":366,"forks":122,"open_issues":366,"watchers":42,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TEAMMATES/repo/pulls/3411"},"html":{"href":"https://github.com/TEAMMATES/repo/pull/3411"},"issue":{"href":"https://api.github.com/repos/TEAMMATES/repo/issues/3411"},"comments":{"href":"https://api.github.com/repos/TEAMMATES/repo/issues/3411/comments"},"review_comments":{"href":"https://api.github.com/repos/TEAMMATES/repo/pulls/3411/comments"},"review_comment":{"href":"https://api.github.com/repos/TEAMMATES/repo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TEAMMATES/repo/pulls/3411/commits"},"statuses":{"href":"https://api.github.com/repos/TEAMMATES/repo/statuses/6f75e45a28db1b8254245dc0701ed47a8ccf3754"}}}}