{"action":"created","comment":{"url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/pulls/comments/240011706","pull_request_review_id":182951719,"id":240011706,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MDAxMTcwNg==","diff_hunk":"@@ -16,24 +16,25 @@\n import domain.Coupon;\n import domain.Offer;\n \n+/**\n+ * Used for saving coupons into memory on the mobile device. This will be replaced by a proper\n+ * data storage system.\n+ */\n public class SharedPreferenceRepository implements ISessionRepository {\n     private final Gson gson;\n-    private Context contextOfApplication;\n     private SharedPreferences prefs;\n \n-\n     public SharedPreferenceRepository(Context contextOfApplication) {\n-        this.contextOfApplication = contextOfApplication;\n         this.prefs = PreferenceManager.getDefaultSharedPreferences(contextOfApplication);\n         this.gson = new Gson();\n     }\n \n-    private List<Coupon> GetUserCouponsInPref(String userId){\n+    private List<Coupon> getUserCouponsInPref(String userId){\n         Type couponListType = new TypeToken<ArrayList<Coupon>>(){}.getType();\n \n         String couponsJson = prefs.getString(userId, \"\");\n \n-        if(couponsJson == null || couponsJson.isEmpty())\n+        if(couponsJson.isEmpty())","path":"app/src/main/java/session/SharedPreferenceRepository.java","position":27,"original_position":27,"commit_id":"13632a044ffef0f781d3bd3e6a6479cf07b121a3","original_commit_id":"13632a044ffef0f781d3bd3e6a6479cf07b121a3","user":{"login":"anna0207","id":10400529,"node_id":"MDQ6VXNlcjEwNDAwNTI5","avatar_url":"https://avatars0.githubusercontent.com/u/10400529?v=4","gravatar_id":"","url":"https://api.github.com/users/anna0207","html_url":"https://github.com/anna0207","followers_url":"https://api.github.com/users/anna0207/followers","following_url":"https://api.github.com/users/anna0207/following{/other_user}","gists_url":"https://api.github.com/users/anna0207/gists{/gist_id}","starred_url":"https://api.github.com/users/anna0207/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anna0207/subscriptions","organizations_url":"https://api.github.com/users/anna0207/orgs","repos_url":"https://api.github.com/users/anna0207/repos","events_url":"https://api.github.com/users/anna0207/events{/privacy}","received_events_url":"https://api.github.com/users/anna0207/received_events","type":"User","site_admin":false},"body":"If prefs.getString(userId, \"\") returns null, because the userId is wrong or doesn't exist, then couponsJson becomes null and if you call couponsJson.isEmpty it will give a null pointer exception","created_at":"2018-12-08T17:53:42Z","updated_at":"2018-12-08T17:53:42Z","html_url":"https://github.com/SuneJepsen/ShoppingOffer/pull/58#discussion_r240011706","pull_request_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/pulls/58","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/pulls/comments/240011706"},"html":{"href":"https://github.com/SuneJepsen/ShoppingOffer/pull/58#discussion_r240011706"},"pull_request":{"href":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/pulls/58"}}},"pull_request":{"url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/pulls/58","id":237079059,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM3MDc5MDU5","html_url":"https://github.com/SuneJepsen/ShoppingOffer/pull/58","diff_url":"https://github.com/SuneJepsen/ShoppingOffer/pull/58.diff","patch_url":"https://github.com/SuneJepsen/ShoppingOffer/pull/58.patch","issue_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/issues/58","number":58,"state":"open","locked":false,"title":"Admir refactoring","user":{"login":"Spiderixius","id":10165995,"node_id":"MDQ6VXNlcjEwMTY1OTk1","avatar_url":"https://avatars0.githubusercontent.com/u/10165995?v=4","gravatar_id":"","url":"https://api.github.com/users/Spiderixius","html_url":"https://github.com/Spiderixius","followers_url":"https://api.github.com/users/Spiderixius/followers","following_url":"https://api.github.com/users/Spiderixius/following{/other_user}","gists_url":"https://api.github.com/users/Spiderixius/gists{/gist_id}","starred_url":"https://api.github.com/users/Spiderixius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Spiderixius/subscriptions","organizations_url":"https://api.github.com/users/Spiderixius/orgs","repos_url":"https://api.github.com/users/Spiderixius/repos","events_url":"https://api.github.com/users/Spiderixius/events{/privacy}","received_events_url":"https://api.github.com/users/Spiderixius/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-12-08T17:08:43Z","updated_at":"2018-12-08T17:53:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6c28746934f4c1eda42cec2fc142547a3a7e14ca","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/pulls/58/commits","review_comments_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/pulls/58/comments","review_comment_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/issues/58/comments","statuses_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/statuses/13632a044ffef0f781d3bd3e6a6479cf07b121a3","head":{"label":"SuneJepsen:admirRefactoring","ref":"admirRefactoring","sha":"13632a044ffef0f781d3bd3e6a6479cf07b121a3","user":{"login":"SuneJepsen","id":5344877,"node_id":"MDQ6VXNlcjUzNDQ4Nzc=","avatar_url":"https://avatars3.githubusercontent.com/u/5344877?v=4","gravatar_id":"","url":"https://api.github.com/users/SuneJepsen","html_url":"https://github.com/SuneJepsen","followers_url":"https://api.github.com/users/SuneJepsen/followers","following_url":"https://api.github.com/users/SuneJepsen/following{/other_user}","gists_url":"https://api.github.com/users/SuneJepsen/gists{/gist_id}","starred_url":"https://api.github.com/users/SuneJepsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SuneJepsen/subscriptions","organizations_url":"https://api.github.com/users/SuneJepsen/orgs","repos_url":"https://api.github.com/users/SuneJepsen/repos","events_url":"https://api.github.com/users/SuneJepsen/events{/privacy}","received_events_url":"https://api.github.com/users/SuneJepsen/received_events","type":"User","site_admin":false},"repo":{"id":153799504,"node_id":"MDEwOlJlcG9zaXRvcnkxNTM3OTk1MDQ=","name":"ShoppingOffer","full_name":"SuneJepsen/ShoppingOffer","private":false,"owner":{"login":"SuneJepsen","id":5344877,"node_id":"MDQ6VXNlcjUzNDQ4Nzc=","avatar_url":"https://avatars3.githubusercontent.com/u/5344877?v=4","gravatar_id":"","url":"https://api.github.com/users/SuneJepsen","html_url":"https://github.com/SuneJepsen","followers_url":"https://api.github.com/users/SuneJepsen/followers","following_url":"https://api.github.com/users/SuneJepsen/following{/other_user}","gists_url":"https://api.github.com/users/SuneJepsen/gists{/gist_id}","starred_url":"https://api.github.com/users/SuneJepsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SuneJepsen/subscriptions","organizations_url":"https://api.github.com/users/SuneJepsen/orgs","repos_url":"https://api.github.com/users/SuneJepsen/repos","events_url":"https://api.github.com/users/SuneJepsen/events{/privacy}","received_events_url":"https://api.github.com/users/SuneJepsen/received_events","type":"User","site_admin":false},"html_url":"https://github.com/SuneJepsen/ShoppingOffer","description":null,"fork":false,"url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer","forks_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/forks","keys_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/teams","hooks_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/hooks","issue_events_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/issues/events{/number}","events_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/events","assignees_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/assignees{/user}","branches_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/branches{/branch}","tags_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/tags","blobs_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/git/refs{/sha}","trees_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/statuses/{sha}","languages_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/languages","stargazers_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/stargazers","contributors_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/contributors","subscribers_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/subscribers","subscription_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/subscription","commits_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/commits{/sha}","git_commits_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/git/commits{/sha}","comments_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/comments{/number}","issue_comment_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/issues/comments{/number}","contents_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/contents/{+path}","compare_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/merges","archive_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/downloads","issues_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/issues{/number}","pulls_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/pulls{/number}","milestones_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/milestones{/number}","notifications_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/labels{/name}","releases_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/releases{/id}","deployments_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/deployments","created_at":"2018-10-19T14:54:45Z","updated_at":"2018-12-08T15:22:21Z","pushed_at":"2018-12-08T17:08:44Z","git_url":"git://github.com/SuneJepsen/ShoppingOffer.git","ssh_url":"git@github.com:SuneJepsen/ShoppingOffer.git","clone_url":"https://github.com/SuneJepsen/ShoppingOffer.git","svn_url":"https://github.com/SuneJepsen/ShoppingOffer","homepage":null,"size":5002,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":6,"license":null,"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"base":{"label":"SuneJepsen:development","ref":"development","sha":"6a5f96018248eb6eeeaab99071fdb3187f79679e","user":{"login":"SuneJepsen","id":5344877,"node_id":"MDQ6VXNlcjUzNDQ4Nzc=","avatar_url":"https://avatars3.githubusercontent.com/u/5344877?v=4","gravatar_id":"","url":"https://api.github.com/users/SuneJepsen","html_url":"https://github.com/SuneJepsen","followers_url":"https://api.github.com/users/SuneJepsen/followers","following_url":"https://api.github.com/users/SuneJepsen/following{/other_user}","gists_url":"https://api.github.com/users/SuneJepsen/gists{/gist_id}","starred_url":"https://api.github.com/users/SuneJepsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SuneJepsen/subscriptions","organizations_url":"https://api.github.com/users/SuneJepsen/orgs","repos_url":"https://api.github.com/users/SuneJepsen/repos","events_url":"https://api.github.com/users/SuneJepsen/events{/privacy}","received_events_url":"https://api.github.com/users/SuneJepsen/received_events","type":"User","site_admin":false},"repo":{"id":153799504,"node_id":"MDEwOlJlcG9zaXRvcnkxNTM3OTk1MDQ=","name":"ShoppingOffer","full_name":"SuneJepsen/ShoppingOffer","private":false,"owner":{"login":"SuneJepsen","id":5344877,"node_id":"MDQ6VXNlcjUzNDQ4Nzc=","avatar_url":"https://avatars3.githubusercontent.com/u/5344877?v=4","gravatar_id":"","url":"https://api.github.com/users/SuneJepsen","html_url":"https://github.com/SuneJepsen","followers_url":"https://api.github.com/users/SuneJepsen/followers","following_url":"https://api.github.com/users/SuneJepsen/following{/other_user}","gists_url":"https://api.github.com/users/SuneJepsen/gists{/gist_id}","starred_url":"https://api.github.com/users/SuneJepsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SuneJepsen/subscriptions","organizations_url":"https://api.github.com/users/SuneJepsen/orgs","repos_url":"https://api.github.com/users/SuneJepsen/repos","events_url":"https://api.github.com/users/SuneJepsen/events{/privacy}","received_events_url":"https://api.github.com/users/SuneJepsen/received_events","type":"User","site_admin":false},"html_url":"https://github.com/SuneJepsen/ShoppingOffer","description":null,"fork":false,"url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer","forks_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/forks","keys_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/teams","hooks_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/hooks","issue_events_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/issues/events{/number}","events_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/events","assignees_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/assignees{/user}","branches_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/branches{/branch}","tags_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/tags","blobs_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/git/refs{/sha}","trees_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/statuses/{sha}","languages_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/languages","stargazers_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/stargazers","contributors_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/contributors","subscribers_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/subscribers","subscription_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/subscription","commits_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/commits{/sha}","git_commits_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/git/commits{/sha}","comments_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/comments{/number}","issue_comment_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/issues/comments{/number}","contents_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/contents/{+path}","compare_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/merges","archive_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/downloads","issues_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/issues{/number}","pulls_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/pulls{/number}","milestones_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/milestones{/number}","notifications_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/labels{/name}","releases_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/releases{/id}","deployments_url":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/deployments","created_at":"2018-10-19T14:54:45Z","updated_at":"2018-12-08T15:22:21Z","pushed_at":"2018-12-08T17:08:44Z","git_url":"git://github.com/SuneJepsen/ShoppingOffer.git","ssh_url":"git@github.com:SuneJepsen/ShoppingOffer.git","clone_url":"https://github.com/SuneJepsen/ShoppingOffer.git","svn_url":"https://github.com/SuneJepsen/ShoppingOffer","homepage":null,"size":5002,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":6,"license":null,"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/pulls/58"},"html":{"href":"https://github.com/SuneJepsen/ShoppingOffer/pull/58"},"issue":{"href":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/issues/58"},"comments":{"href":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/issues/58/comments"},"review_comments":{"href":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/pulls/58/comments"},"review_comment":{"href":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/pulls/58/commits"},"statuses":{"href":"https://api.github.com/repos/SuneJepsen/ShoppingOffer/statuses/13632a044ffef0f781d3bd3e6a6479cf07b121a3"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"anna0207"}}