{"action":"created","comment":{"url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/comments/134737063","pull_request_review_id":58062303,"id":134737063,"diff_hunk":"@@ -585,39 +585,30 @@ private StudentEnrollDetails enrollStudent(StudentAttributes validStudentAttribu\n     public List<StudentAttributes> createStudents(String lines, String courseId) throws EnrollException {\n         List<String> invalidityInfo = new ArrayList<>();\n         String[] linesArray = lines.split(Const.EOL);\n-        ArrayList<String> studentEmailList = new ArrayList<>();\n         List<StudentAttributes> studentList = new ArrayList<>();\n \n         StudentAttributesFactory saf = new StudentAttributesFactory(linesArray[0]);\n \n         for (int i = 1; i < linesArray.length; i++) {\n             String line = linesArray[i];\n             String sanitizedLine = SanitizationHelper.sanitizeForHtml(line);\n+            if (StringHelper.isWhiteSpace(line)) {\n+                continue;\n+            }\n             try {\n-                if (StringHelper.isWhiteSpace(line)) {\n-                    continue;\n-                }\n                 StudentAttributes student = saf.makeStudent(line, courseId);\n \n                 if (!student.isValid()) {\n-                    String info = StringHelper.toString(SanitizationHelper.sanitizeForHtml(student.getInvalidityInfo()),\n-                                                    \"<br>\" + Const.StatusMessages.ENROLL_LINES_PROBLEM_DETAIL_PREFIX + \" \");\n-                    invalidityInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM, sanitizedLine, info));\n+                    addInvalidStudentInfo(invalidityInfo, student, sanitizedLine);\n                 }\n-\n-                if (isStudentEmailDuplicated(student.email, studentEmailList)) {\n-                    String info =\n-                            StringHelper.toString(\n-                                    getInvalidityInfoInDuplicatedEmail(student.email, studentEmailList, linesArray),\n-                                    \"<br>\" + Const.StatusMessages.ENROLL_LINES_PROBLEM_DETAIL_PREFIX + \" \");\n-                    invalidityInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM, sanitizedLine, info));\n+                int isDuplicate = getDuplicateIndex(student.email, studentList);","path":"src/main/java/teammates/logic/core/StudentsLogic.java","position":34,"original_position":34,"commit_id":"59e66288d65a9bba421bcce1a66af1db065e552a","original_commit_id":"59e66288d65a9bba421bcce1a66af1db065e552a","user":{"login":"sujeet14108","id":9781422,"avatar_url":"https://avatars1.githubusercontent.com/u/9781422?v=4","gravatar_id":"","url":"https://api.github.com/users/sujeet14108","html_url":"https://github.com/sujeet14108","followers_url":"https://api.github.com/users/sujeet14108/followers","following_url":"https://api.github.com/users/sujeet14108/following{/other_user}","gists_url":"https://api.github.com/users/sujeet14108/gists{/gist_id}","starred_url":"https://api.github.com/users/sujeet14108/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sujeet14108/subscriptions","organizations_url":"https://api.github.com/users/sujeet14108/orgs","repos_url":"https://api.github.com/users/sujeet14108/repos","events_url":"https://api.github.com/users/sujeet14108/events{/privacy}","received_events_url":"https://api.github.com/users/sujeet14108/received_events","type":"User","site_admin":false},"body":"Is `duplicateIndex` fine or simply `index` ?","created_at":"2017-08-23T12:29:11Z","updated_at":"2017-08-23T12:29:11Z","html_url":"https://github.com/TEAMMATES/teammates/pull/7930#discussion_r134737063","pull_request_url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/7930","_links":{"self":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/comments/134737063"},"html":{"href":"https://github.com/TEAMMATES/teammates/pull/7930#discussion_r134737063"},"pull_request":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/7930"}}},"pull_request":{"url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/7930","id":135427116,"html_url":"https://github.com/TEAMMATES/teammates/pull/7930","diff_url":"https://github.com/TEAMMATES/teammates/pull/7930.diff","patch_url":"https://github.com/TEAMMATES/teammates/pull/7930.patch","issue_url":"https://api.github.com/repos/TEAMMATES/teammates/issues/7930","number":7930,"state":"open","locked":false,"title":"StudentsLogic: Simplify createStudents(String, String) #7839","user":{"login":"sujeet14108","id":9781422,"avatar_url":"https://avatars1.githubusercontent.com/u/9781422?v=4","gravatar_id":"","url":"https://api.github.com/users/sujeet14108","html_url":"https://github.com/sujeet14108","followers_url":"https://api.github.com/users/sujeet14108/followers","following_url":"https://api.github.com/users/sujeet14108/following{/other_user}","gists_url":"https://api.github.com/users/sujeet14108/gists{/gist_id}","starred_url":"https://api.github.com/users/sujeet14108/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sujeet14108/subscriptions","organizations_url":"https://api.github.com/users/sujeet14108/orgs","repos_url":"https://api.github.com/users/sujeet14108/repos","events_url":"https://api.github.com/users/sujeet14108/events{/privacy}","received_events_url":"https://api.github.com/users/sujeet14108/received_events","type":"User","site_admin":false},"body":"Fixes #7839 \r\n","created_at":"2017-08-11T22:02:27Z","updated_at":"2017-08-23T12:29:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f45719758e84e755a57a99a35735de71d4d05ba0","assignee":{"login":"whipermr5","id":6811428,"avatar_url":"https://avatars0.githubusercontent.com/u/6811428?v=4","gravatar_id":"","url":"https://api.github.com/users/whipermr5","html_url":"https://github.com/whipermr5","followers_url":"https://api.github.com/users/whipermr5/followers","following_url":"https://api.github.com/users/whipermr5/following{/other_user}","gists_url":"https://api.github.com/users/whipermr5/gists{/gist_id}","starred_url":"https://api.github.com/users/whipermr5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whipermr5/subscriptions","organizations_url":"https://api.github.com/users/whipermr5/orgs","repos_url":"https://api.github.com/users/whipermr5/repos","events_url":"https://api.github.com/users/whipermr5/events{/privacy}","received_events_url":"https://api.github.com/users/whipermr5/received_events","type":"User","site_admin":false},"assignees":[{"login":"whipermr5","id":6811428,"avatar_url":"https://avatars0.githubusercontent.com/u/6811428?v=4","gravatar_id":"","url":"https://api.github.com/users/whipermr5","html_url":"https://github.com/whipermr5","followers_url":"https://api.github.com/users/whipermr5/followers","following_url":"https://api.github.com/users/whipermr5/following{/other_user}","gists_url":"https://api.github.com/users/whipermr5/gists{/gist_id}","starred_url":"https://api.github.com/users/whipermr5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whipermr5/subscriptions","organizations_url":"https://api.github.com/users/whipermr5/orgs","repos_url":"https://api.github.com/users/whipermr5/repos","events_url":"https://api.github.com/users/whipermr5/events{/privacy}","received_events_url":"https://api.github.com/users/whipermr5/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/7930/commits","review_comments_url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/7930/comments","review_comment_url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TEAMMATES/teammates/issues/7930/comments","statuses_url":"https://api.github.com/repos/TEAMMATES/teammates/statuses/59e66288d65a9bba421bcce1a66af1db065e552a","head":{"label":"sujeet14108:7893-student-logic-refactor","ref":"7893-student-logic-refactor","sha":"59e66288d65a9bba421bcce1a66af1db065e552a","user":{"login":"sujeet14108","id":9781422,"avatar_url":"https://avatars1.githubusercontent.com/u/9781422?v=4","gravatar_id":"","url":"https://api.github.com/users/sujeet14108","html_url":"https://github.com/sujeet14108","followers_url":"https://api.github.com/users/sujeet14108/followers","following_url":"https://api.github.com/users/sujeet14108/following{/other_user}","gists_url":"https://api.github.com/users/sujeet14108/gists{/gist_id}","starred_url":"https://api.github.com/users/sujeet14108/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sujeet14108/subscriptions","organizations_url":"https://api.github.com/users/sujeet14108/orgs","repos_url":"https://api.github.com/users/sujeet14108/repos","events_url":"https://api.github.com/users/sujeet14108/events{/privacy}","received_events_url":"https://api.github.com/users/sujeet14108/received_events","type":"User","site_admin":false},"repo":{"id":52737524,"name":"teammates","full_name":"sujeet14108/teammates","owner":{"login":"sujeet14108","id":9781422,"avatar_url":"https://avatars1.githubusercontent.com/u/9781422?v=4","gravatar_id":"","url":"https://api.github.com/users/sujeet14108","html_url":"https://github.com/sujeet14108","followers_url":"https://api.github.com/users/sujeet14108/followers","following_url":"https://api.github.com/users/sujeet14108/following{/other_user}","gists_url":"https://api.github.com/users/sujeet14108/gists{/gist_id}","starred_url":"https://api.github.com/users/sujeet14108/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sujeet14108/subscriptions","organizations_url":"https://api.github.com/users/sujeet14108/orgs","repos_url":"https://api.github.com/users/sujeet14108/repos","events_url":"https://api.github.com/users/sujeet14108/events{/privacy}","received_events_url":"https://api.github.com/users/sujeet14108/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sujeet14108/teammates","description":"This is the project website for the TEAMMATES feedback management tool for education","fork":true,"url":"https://api.github.com/repos/sujeet14108/teammates","forks_url":"https://api.github.com/repos/sujeet14108/teammates/forks","keys_url":"https://api.github.com/repos/sujeet14108/teammates/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sujeet14108/teammates/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sujeet14108/teammates/teams","hooks_url":"https://api.github.com/repos/sujeet14108/teammates/hooks","issue_events_url":"https://api.github.com/repos/sujeet14108/teammates/issues/events{/number}","events_url":"https://api.github.com/repos/sujeet14108/teammates/events","assignees_url":"https://api.github.com/repos/sujeet14108/teammates/assignees{/user}","branches_url":"https://api.github.com/repos/sujeet14108/teammates/branches{/branch}","tags_url":"https://api.github.com/repos/sujeet14108/teammates/tags","blobs_url":"https://api.github.com/repos/sujeet14108/teammates/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sujeet14108/teammates/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sujeet14108/teammates/git/refs{/sha}","trees_url":"https://api.github.com/repos/sujeet14108/teammates/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sujeet14108/teammates/statuses/{sha}","languages_url":"https://api.github.com/repos/sujeet14108/teammates/languages","stargazers_url":"https://api.github.com/repos/sujeet14108/teammates/stargazers","contributors_url":"https://api.github.com/repos/sujeet14108/teammates/contributors","subscribers_url":"https://api.github.com/repos/sujeet14108/teammates/subscribers","subscription_url":"https://api.github.com/repos/sujeet14108/teammates/subscription","commits_url":"https://api.github.com/repos/sujeet14108/teammates/commits{/sha}","git_commits_url":"https://api.github.com/repos/sujeet14108/teammates/git/commits{/sha}","comments_url":"https://api.github.com/repos/sujeet14108/teammates/comments{/number}","issue_comment_url":"https://api.github.com/repos/sujeet14108/teammates/issues/comments{/number}","contents_url":"https://api.github.com/repos/sujeet14108/teammates/contents/{+path}","compare_url":"https://api.github.com/repos/sujeet14108/teammates/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sujeet14108/teammates/merges","archive_url":"https://api.github.com/repos/sujeet14108/teammates/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sujeet14108/teammates/downloads","issues_url":"https://api.github.com/repos/sujeet14108/teammates/issues{/number}","pulls_url":"https://api.github.com/repos/sujeet14108/teammates/pulls{/number}","milestones_url":"https://api.github.com/repos/sujeet14108/teammates/milestones{/number}","notifications_url":"https://api.github.com/repos/sujeet14108/teammates/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sujeet14108/teammates/labels{/name}","releases_url":"https://api.github.com/repos/sujeet14108/teammates/releases{/id}","deployments_url":"https://api.github.com/repos/sujeet14108/teammates/deployments","created_at":"2016-02-28T18:54:06Z","updated_at":"2017-04-07T20:05:40Z","pushed_at":"2017-08-23T12:24:53Z","git_url":"git://github.com/sujeet14108/teammates.git","ssh_url":"git@github.com:sujeet14108/teammates.git","clone_url":"https://github.com/sujeet14108/teammates.git","svn_url":"https://github.com/sujeet14108/teammates","homepage":"http://teammatesv4.appspot.com/","size":188973,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"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":"aec172a829bc4951e5046fa97f466c91a90b8398","user":{"login":"TEAMMATES","id":7374810,"avatar_url":"https://avatars2.githubusercontent.com/u/7374810?v=4","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://avatars2.githubusercontent.com/u/7374810?v=4","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":"2017-08-17T20:16:30Z","pushed_at":"2017-08-23T12:24: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":"https://teammatesv4.appspot.com/","size":191229,"stargazers_count":402,"watchers_count":402,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":940,"mirror_url":null,"open_issues_count":299,"forks":940,"open_issues":299,"watchers":402,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/7930"},"html":{"href":"https://github.com/TEAMMATES/teammates/pull/7930"},"issue":{"href":"https://api.github.com/repos/TEAMMATES/teammates/issues/7930"},"comments":{"href":"https://api.github.com/repos/TEAMMATES/teammates/issues/7930/comments"},"review_comments":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/7930/comments"},"review_comment":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/7930/commits"},"statuses":{"href":"https://api.github.com/repos/TEAMMATES/teammates/statuses/59e66288d65a9bba421bcce1a66af1db065e552a"}}}}
{"actor":{"display_login":"sujeet14108"}}