{"action":"created","comment":{"url":"https://api.github.com/repos/wso2/product-mdm/pulls/comments/27015465","id":27015465,"diff_hunk":"@@ -0,0 +1,90 @@\n+/*\n+ * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.\n+ * \n+ * WSO2 Inc. licenses this file to you under the Apache License,\n+ * Version 2.0 (the \"License\"); you may not use this file except\n+ * in compliance with the License.\n+ * You may obtain a copy of the License at\n+ * \n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ * \n+ * Unless required by applicable law or agreed to in writing,\n+ * software distributed under the License is distributed on an\n+ * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+ * KIND, either express or implied. See the License for the\n+ * specific language governing permissions and limitations\n+ * under the License.\n+ */\n+package org.wso2.mdm.agent.proxy.beans;\n+\n+import java.text.DateFormat;\n+import java.text.SimpleDateFormat;\n+import java.util.Date;\n+import java.util.Locale;\n+\n+/**\n+ * Persists refresh token to obtain new access token and id token to retrieve\n+ * login user claims\n+ */\n+public final class Token {\n+\tprivate String refreshToken = null;\n+\tprivate String idToken = null;\n+\tprivate String accessToken = null;\n+\tprivate Date receivedDate = null;\n+\t@SuppressWarnings(\"unused\")\n+\tprivate boolean expired = false;\n+\n+\tpublic Date getDate() {\n+\t\treturn receivedDate;\n+\t}\n+\n+\tpublic void setDate() {\n+\t\tDateFormat dateFormat = new SimpleDateFormat(\"MM/dd/yyyy HH:mm:ss\", Locale.getDefault());\n+\t\tDate date = new Date();\n+\t\tString strDate = dateFormat.format(date);\n+\t\tSimpleDateFormat format = new SimpleDateFormat(\"MM/dd/yyyy HH:mm:ss\", Locale.getDefault());\n+\t\ttry {\n+\t\t\treceivedDate = format.parse(strDate);\n+\t\t} catch (Exception e) {\n+\t\t\te.printStackTrace();\n+\t\t}\n+\t}\n+\n+\tpublic void setDate(String date) {\n+\t\tSimpleDateFormat format = new SimpleDateFormat(\"MM/dd/yyyy HH:mm:ss\", Locale.getDefault());\n+\t\ttry {\n+\t\t\treceivedDate = format.parse(date);\n+\t\t} catch (Exception e) {\n+\t\t\te.printStackTrace();","path":"modules/mobile-agents/android/client/plugins/IDPProxy/src/org/wso2/mdm/agent/proxy/beans/Token.java","position":58,"original_position":58,"commit_id":"b87a795895dd26d2ab6c6cb9df98bfa885697c95","original_commit_id":"b87a795895dd26d2ab6c6cb9df98bfa885697c95","user":{"login":"prabathabey","id":6664125,"avatar_url":"https://avatars.githubusercontent.com/u/6664125?v=3","gravatar_id":"","url":"https://api.github.com/users/prabathabey","html_url":"https://github.com/prabathabey","followers_url":"https://api.github.com/users/prabathabey/followers","following_url":"https://api.github.com/users/prabathabey/following{/other_user}","gists_url":"https://api.github.com/users/prabathabey/gists{/gist_id}","starred_url":"https://api.github.com/users/prabathabey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prabathabey/subscriptions","organizations_url":"https://api.github.com/users/prabathabey/orgs","repos_url":"https://api.github.com/users/prabathabey/repos","events_url":"https://api.github.com/users/prabathabey/events{/privacy}","received_events_url":"https://api.github.com/users/prabathabey/received_events","type":"User","site_admin":false},"body":"We need to get rid of the line \"e.printStackTrace()\" and use proper logging. Consider throwing the exception upwards if applicable. Also, if it was intentional that we've caught \"Exception\" in the catch block, please add a comment mentioning why it was done that way. Else, please fix it appropriately.","created_at":"2015-03-24T10:19:54Z","updated_at":"2015-03-24T10:19:54Z","html_url":"https://github.com/wso2/product-mdm/pull/25#discussion_r27015465","pull_request_url":"https://api.github.com/repos/wso2/product-mdm/pulls/25","_links":{"self":{"href":"https://api.github.com/repos/wso2/product-mdm/pulls/comments/27015465"},"html":{"href":"https://github.com/wso2/product-mdm/pull/25#discussion_r27015465"},"pull_request":{"href":"https://api.github.com/repos/wso2/product-mdm/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/wso2/product-mdm/pulls/25","id":30491953,"html_url":"https://github.com/wso2/product-mdm/pull/25","diff_url":"https://github.com/wso2/product-mdm/pull/25.diff","patch_url":"https://github.com/wso2/product-mdm/pull/25.patch","issue_url":"https://api.github.com/repos/wso2/product-mdm/issues/25","number":25,"state":"open","locked":false,"title":"CDM Android Agent code cleanup","user":{"login":"kasundananjaya","id":4506898,"avatar_url":"https://avatars.githubusercontent.com/u/4506898?v=3","gravatar_id":"","url":"https://api.github.com/users/kasundananjaya","html_url":"https://github.com/kasundananjaya","followers_url":"https://api.github.com/users/kasundananjaya/followers","following_url":"https://api.github.com/users/kasundananjaya/following{/other_user}","gists_url":"https://api.github.com/users/kasundananjaya/gists{/gist_id}","starred_url":"https://api.github.com/users/kasundananjaya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasundananjaya/subscriptions","organizations_url":"https://api.github.com/users/kasundananjaya/orgs","repos_url":"https://api.github.com/users/kasundananjaya/repos","events_url":"https://api.github.com/users/kasundananjaya/events{/privacy}","received_events_url":"https://api.github.com/users/kasundananjaya/received_events","type":"User","site_admin":false},"body":"Cleaning up and formatting the CDM Android Agent code.","created_at":"2015-03-04T18:41:02Z","updated_at":"2015-03-24T10:19:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"feea65bc2e2f34d9c188ff7ebef98654145fb6d2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wso2/product-mdm/pulls/25/commits","review_comments_url":"https://api.github.com/repos/wso2/product-mdm/pulls/25/comments","review_comment_url":"https://api.github.com/repos/wso2/product-mdm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wso2/product-mdm/issues/25/comments","statuses_url":"https://api.github.com/repos/wso2/product-mdm/statuses/b87a795895dd26d2ab6c6cb9df98bfa885697c95","head":{"label":"kasundananjaya:master","ref":"master","sha":"b87a795895dd26d2ab6c6cb9df98bfa885697c95","user":{"login":"kasundananjaya","id":4506898,"avatar_url":"https://avatars.githubusercontent.com/u/4506898?v=3","gravatar_id":"","url":"https://api.github.com/users/kasundananjaya","html_url":"https://github.com/kasundananjaya","followers_url":"https://api.github.com/users/kasundananjaya/followers","following_url":"https://api.github.com/users/kasundananjaya/following{/other_user}","gists_url":"https://api.github.com/users/kasundananjaya/gists{/gist_id}","starred_url":"https://api.github.com/users/kasundananjaya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasundananjaya/subscriptions","organizations_url":"https://api.github.com/users/kasundananjaya/orgs","repos_url":"https://api.github.com/users/kasundananjaya/repos","events_url":"https://api.github.com/users/kasundananjaya/events{/privacy}","received_events_url":"https://api.github.com/users/kasundananjaya/received_events","type":"User","site_admin":false},"repo":{"id":31051082,"name":"product-mdm","full_name":"kasundananjaya/product-mdm","owner":{"login":"kasundananjaya","id":4506898,"avatar_url":"https://avatars.githubusercontent.com/u/4506898?v=3","gravatar_id":"","url":"https://api.github.com/users/kasundananjaya","html_url":"https://github.com/kasundananjaya","followers_url":"https://api.github.com/users/kasundananjaya/followers","following_url":"https://api.github.com/users/kasundananjaya/following{/other_user}","gists_url":"https://api.github.com/users/kasundananjaya/gists{/gist_id}","starred_url":"https://api.github.com/users/kasundananjaya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasundananjaya/subscriptions","organizations_url":"https://api.github.com/users/kasundananjaya/orgs","repos_url":"https://api.github.com/users/kasundananjaya/repos","events_url":"https://api.github.com/users/kasundananjaya/events{/privacy}","received_events_url":"https://api.github.com/users/kasundananjaya/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kasundananjaya/product-mdm","description":"","fork":true,"url":"https://api.github.com/repos/kasundananjaya/product-mdm","forks_url":"https://api.github.com/repos/kasundananjaya/product-mdm/forks","keys_url":"https://api.github.com/repos/kasundananjaya/product-mdm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kasundananjaya/product-mdm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kasundananjaya/product-mdm/teams","hooks_url":"https://api.github.com/repos/kasundananjaya/product-mdm/hooks","issue_events_url":"https://api.github.com/repos/kasundananjaya/product-mdm/issues/events{/number}","events_url":"https://api.github.com/repos/kasundananjaya/product-mdm/events","assignees_url":"https://api.github.com/repos/kasundananjaya/product-mdm/assignees{/user}","branches_url":"https://api.github.com/repos/kasundananjaya/product-mdm/branches{/branch}","tags_url":"https://api.github.com/repos/kasundananjaya/product-mdm/tags","blobs_url":"https://api.github.com/repos/kasundananjaya/product-mdm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kasundananjaya/product-mdm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kasundananjaya/product-mdm/git/refs{/sha}","trees_url":"https://api.github.com/repos/kasundananjaya/product-mdm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kasundananjaya/product-mdm/statuses/{sha}","languages_url":"https://api.github.com/repos/kasundananjaya/product-mdm/languages","stargazers_url":"https://api.github.com/repos/kasundananjaya/product-mdm/stargazers","contributors_url":"https://api.github.com/repos/kasundananjaya/product-mdm/contributors","subscribers_url":"https://api.github.com/repos/kasundananjaya/product-mdm/subscribers","subscription_url":"https://api.github.com/repos/kasundananjaya/product-mdm/subscription","commits_url":"https://api.github.com/repos/kasundananjaya/product-mdm/commits{/sha}","git_commits_url":"https://api.github.com/repos/kasundananjaya/product-mdm/git/commits{/sha}","comments_url":"https://api.github.com/repos/kasundananjaya/product-mdm/comments{/number}","issue_comment_url":"https://api.github.com/repos/kasundananjaya/product-mdm/issues/comments{/number}","contents_url":"https://api.github.com/repos/kasundananjaya/product-mdm/contents/{+path}","compare_url":"https://api.github.com/repos/kasundananjaya/product-mdm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kasundananjaya/product-mdm/merges","archive_url":"https://api.github.com/repos/kasundananjaya/product-mdm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kasundananjaya/product-mdm/downloads","issues_url":"https://api.github.com/repos/kasundananjaya/product-mdm/issues{/number}","pulls_url":"https://api.github.com/repos/kasundananjaya/product-mdm/pulls{/number}","milestones_url":"https://api.github.com/repos/kasundananjaya/product-mdm/milestones{/number}","notifications_url":"https://api.github.com/repos/kasundananjaya/product-mdm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kasundananjaya/product-mdm/labels{/name}","releases_url":"https://api.github.com/repos/kasundananjaya/product-mdm/releases{/id}","created_at":"2015-02-20T04:34:13Z","updated_at":"2015-03-24T09:21:32Z","pushed_at":"2015-03-24T09:21:32Z","git_url":"git://github.com/kasundananjaya/product-mdm.git","ssh_url":"git@github.com:kasundananjaya/product-mdm.git","clone_url":"https://github.com/kasundananjaya/product-mdm.git","svn_url":"https://github.com/kasundananjaya/product-mdm","homepage":null,"size":9927,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"wso2:master","ref":"master","sha":"d40ab7361bd415cb533ed7b4dce92a55db28cbe4","user":{"login":"wso2","id":533043,"avatar_url":"https://avatars.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"repo":{"id":29459213,"name":"product-mdm","full_name":"wso2/product-mdm","owner":{"login":"wso2","id":533043,"avatar_url":"https://avatars.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wso2/product-mdm","description":"","fork":false,"url":"https://api.github.com/repos/wso2/product-mdm","forks_url":"https://api.github.com/repos/wso2/product-mdm/forks","keys_url":"https://api.github.com/repos/wso2/product-mdm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wso2/product-mdm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wso2/product-mdm/teams","hooks_url":"https://api.github.com/repos/wso2/product-mdm/hooks","issue_events_url":"https://api.github.com/repos/wso2/product-mdm/issues/events{/number}","events_url":"https://api.github.com/repos/wso2/product-mdm/events","assignees_url":"https://api.github.com/repos/wso2/product-mdm/assignees{/user}","branches_url":"https://api.github.com/repos/wso2/product-mdm/branches{/branch}","tags_url":"https://api.github.com/repos/wso2/product-mdm/tags","blobs_url":"https://api.github.com/repos/wso2/product-mdm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wso2/product-mdm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wso2/product-mdm/git/refs{/sha}","trees_url":"https://api.github.com/repos/wso2/product-mdm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wso2/product-mdm/statuses/{sha}","languages_url":"https://api.github.com/repos/wso2/product-mdm/languages","stargazers_url":"https://api.github.com/repos/wso2/product-mdm/stargazers","contributors_url":"https://api.github.com/repos/wso2/product-mdm/contributors","subscribers_url":"https://api.github.com/repos/wso2/product-mdm/subscribers","subscription_url":"https://api.github.com/repos/wso2/product-mdm/subscription","commits_url":"https://api.github.com/repos/wso2/product-mdm/commits{/sha}","git_commits_url":"https://api.github.com/repos/wso2/product-mdm/git/commits{/sha}","comments_url":"https://api.github.com/repos/wso2/product-mdm/comments{/number}","issue_comment_url":"https://api.github.com/repos/wso2/product-mdm/issues/comments{/number}","contents_url":"https://api.github.com/repos/wso2/product-mdm/contents/{+path}","compare_url":"https://api.github.com/repos/wso2/product-mdm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wso2/product-mdm/merges","archive_url":"https://api.github.com/repos/wso2/product-mdm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wso2/product-mdm/downloads","issues_url":"https://api.github.com/repos/wso2/product-mdm/issues{/number}","pulls_url":"https://api.github.com/repos/wso2/product-mdm/pulls{/number}","milestones_url":"https://api.github.com/repos/wso2/product-mdm/milestones{/number}","notifications_url":"https://api.github.com/repos/wso2/product-mdm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wso2/product-mdm/labels{/name}","releases_url":"https://api.github.com/repos/wso2/product-mdm/releases{/id}","created_at":"2015-01-19T07:36:01Z","updated_at":"2015-03-24T05:20:49Z","pushed_at":"2015-03-24T09:21:32Z","git_url":"git://github.com/wso2/product-mdm.git","ssh_url":"git@github.com:wso2/product-mdm.git","clone_url":"https://github.com/wso2/product-mdm.git","svn_url":"https://github.com/wso2/product-mdm","homepage":null,"size":11388,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":1,"forks":9,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wso2/product-mdm/pulls/25"},"html":{"href":"https://github.com/wso2/product-mdm/pull/25"},"issue":{"href":"https://api.github.com/repos/wso2/product-mdm/issues/25"},"comments":{"href":"https://api.github.com/repos/wso2/product-mdm/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/wso2/product-mdm/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/wso2/product-mdm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wso2/product-mdm/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/wso2/product-mdm/statuses/b87a795895dd26d2ab6c6cb9df98bfa885697c95"}}}}