{"action":"created","comment":{"url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/pulls/comments/219664680","pull_request_review_id":157902693,"id":219664680,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxOTY2NDY4MA==","diff_hunk":"@@ -23,25 +23,58 @@\n  */\n package com.cloudbees.jenkins.plugins.bitbucket;\n \n-import com.google.common.base.Charsets;\n import java.io.IOException;\n import java.io.InputStream;\n import java.io.InputStreamReader;\n import java.io.Reader;\n import java.io.StringReader;\n-import java.text.SimpleDateFormat;\n-import java.util.TimeZone;\n+import java.text.ParsePosition;\n+import java.util.Date;\n+\n import org.codehaus.jackson.map.DeserializationConfig;\n import org.codehaus.jackson.map.ObjectMapper;\n+import org.codehaus.jackson.map.util.ISO8601DateFormat;\n+import org.codehaus.jackson.map.util.ISO8601Utils;\n import org.kohsuke.accmod.Restricted;\n import org.kohsuke.accmod.restrictions.NoExternalUse;\n \n+import com.google.common.base.Charsets;\n+\n /**\n  * Jackson based JSON parser\n  */\n @Restricted(NoExternalUse.class)\n public final class JsonParser {\n-    private static final String DATE_FORMAT = \"yyyy-MM-dd'T'HH:mm:ss.SSS\";\n+    /*package*/ static class BitbucketDateFormat extends ISO8601DateFormat {","path":"src/main/java/com/cloudbees/jenkins/plugins/bitbucket/JsonParser.java","position":30,"original_position":30,"commit_id":"2db89fdae555769d1a47f694a6f29168b03b36ca","original_commit_id":"2db89fdae555769d1a47f694a6f29168b03b36ca","user":{"login":"casz","id":1661688,"node_id":"MDQ6VXNlcjE2NjE2ODg=","avatar_url":"https://avatars2.githubusercontent.com/u/1661688?v=4","gravatar_id":"","url":"https://api.github.com/users/casz","html_url":"https://github.com/casz","followers_url":"https://api.github.com/users/casz/followers","following_url":"https://api.github.com/users/casz/following{/other_user}","gists_url":"https://api.github.com/users/casz/gists{/gist_id}","starred_url":"https://api.github.com/users/casz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/casz/subscriptions","organizations_url":"https://api.github.com/users/casz/orgs","repos_url":"https://api.github.com/users/casz/repos","events_url":"https://api.github.com/users/casz/events{/privacy}","received_events_url":"https://api.github.com/users/casz/received_events","type":"User","site_admin":false},"body":"Actually I think you can skip this function and just use `StdDateFormat` from Jackson which support the case your custom parser is trying to fix. The StdDateFormat allows upto 9 milliseconds anything longer it complains which I would too 😅","created_at":"2018-09-22T07:51:57Z","updated_at":"2018-09-22T07:51:57Z","html_url":"https://github.com/jenkinsci/bitbucket-branch-source-plugin/pull/139#discussion_r219664680","pull_request_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/pulls/139","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/pulls/comments/219664680"},"html":{"href":"https://github.com/jenkinsci/bitbucket-branch-source-plugin/pull/139#discussion_r219664680"},"pull_request":{"href":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/pulls/139"}},"in_reply_to_id":219664143},"pull_request":{"url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/pulls/139","id":215049839,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1MDQ5ODM5","html_url":"https://github.com/jenkinsci/bitbucket-branch-source-plugin/pull/139","diff_url":"https://github.com/jenkinsci/bitbucket-branch-source-plugin/pull/139.diff","patch_url":"https://github.com/jenkinsci/bitbucket-branch-source-plugin/pull/139.patch","issue_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/issues/139","number":139,"state":"open","locked":false,"title":"JENKINS-51063 the PushHookProcessor does not handle correctly webhook of kind tag","user":{"login":"nfalco79","id":4160180,"node_id":"MDQ6VXNlcjQxNjAxODA=","avatar_url":"https://avatars0.githubusercontent.com/u/4160180?v=4","gravatar_id":"","url":"https://api.github.com/users/nfalco79","html_url":"https://github.com/nfalco79","followers_url":"https://api.github.com/users/nfalco79/followers","following_url":"https://api.github.com/users/nfalco79/following{/other_user}","gists_url":"https://api.github.com/users/nfalco79/gists{/gist_id}","starred_url":"https://api.github.com/users/nfalco79/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfalco79/subscriptions","organizations_url":"https://api.github.com/users/nfalco79/orgs","repos_url":"https://api.github.com/users/nfalco79/repos","events_url":"https://api.github.com/users/nfalco79/events{/privacy}","received_events_url":"https://api.github.com/users/nfalco79/received_events","type":"User","site_admin":false},"body":"Manage TagSCMHead correctly when bitbucket payload webhook is of king create tag.\r\nFix parsing of ISO8601 date in BB payload. Handle also non ISO8601 standard date for updateOn field.\r\nTo avoid too regression only the new date fields are of kind Date the other one are keep as is. If changed to Date in the future they works, otherwise in case the Bitbucket date format can be enhanced to handle other cases.","created_at":"2018-09-12T18:10:03Z","updated_at":"2018-09-22T07:51:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c10b57f2f1633b3a1ace9a3c06b3fc2617e0d230","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/pulls/139/commits","review_comments_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/pulls/139/comments","review_comment_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/issues/139/comments","statuses_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/statuses/2db89fdae555769d1a47f694a6f29168b03b36ca","head":{"label":"nfalco79:feature/JENKINS-51063","ref":"feature/JENKINS-51063","sha":"2db89fdae555769d1a47f694a6f29168b03b36ca","user":{"login":"nfalco79","id":4160180,"node_id":"MDQ6VXNlcjQxNjAxODA=","avatar_url":"https://avatars0.githubusercontent.com/u/4160180?v=4","gravatar_id":"","url":"https://api.github.com/users/nfalco79","html_url":"https://github.com/nfalco79","followers_url":"https://api.github.com/users/nfalco79/followers","following_url":"https://api.github.com/users/nfalco79/following{/other_user}","gists_url":"https://api.github.com/users/nfalco79/gists{/gist_id}","starred_url":"https://api.github.com/users/nfalco79/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfalco79/subscriptions","organizations_url":"https://api.github.com/users/nfalco79/orgs","repos_url":"https://api.github.com/users/nfalco79/repos","events_url":"https://api.github.com/users/nfalco79/events{/privacy}","received_events_url":"https://api.github.com/users/nfalco79/received_events","type":"User","site_admin":false},"repo":{"id":131830999,"node_id":"MDEwOlJlcG9zaXRvcnkxMzE4MzA5OTk=","name":"bitbucket-branch-source-plugin","full_name":"nfalco79/bitbucket-branch-source-plugin","private":false,"owner":{"login":"nfalco79","id":4160180,"node_id":"MDQ6VXNlcjQxNjAxODA=","avatar_url":"https://avatars0.githubusercontent.com/u/4160180?v=4","gravatar_id":"","url":"https://api.github.com/users/nfalco79","html_url":"https://github.com/nfalco79","followers_url":"https://api.github.com/users/nfalco79/followers","following_url":"https://api.github.com/users/nfalco79/following{/other_user}","gists_url":"https://api.github.com/users/nfalco79/gists{/gist_id}","starred_url":"https://api.github.com/users/nfalco79/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfalco79/subscriptions","organizations_url":"https://api.github.com/users/nfalco79/orgs","repos_url":"https://api.github.com/users/nfalco79/repos","events_url":"https://api.github.com/users/nfalco79/events{/privacy}","received_events_url":"https://api.github.com/users/nfalco79/received_events","type":"User","site_admin":false},"html_url":"https://github.com/nfalco79/bitbucket-branch-source-plugin","description":"Bitbucket Branch Source Plugin","fork":true,"url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin","forks_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/forks","keys_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/teams","hooks_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/hooks","issue_events_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/events","assignees_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/tags","blobs_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/languages","stargazers_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/stargazers","contributors_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/contributors","subscribers_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/subscribers","subscription_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/subscription","commits_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/merges","archive_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/downloads","issues_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/labels{/name}","releases_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/nfalco79/bitbucket-branch-source-plugin/deployments","created_at":"2018-05-02T09:49:00Z","updated_at":"2018-09-10T15:59:43Z","pushed_at":"2018-09-21T16:09:00Z","git_url":"git://github.com/nfalco79/bitbucket-branch-source-plugin.git","ssh_url":"git@github.com:nfalco79/bitbucket-branch-source-plugin.git","clone_url":"https://github.com/nfalco79/bitbucket-branch-source-plugin.git","svn_url":"https://github.com/nfalco79/bitbucket-branch-source-plugin","homepage":"https://wiki.jenkins-ci.org/display/JENKINS/Bitbucket+Branch+Source+Plugin","size":960,"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,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jenkinsci:master","ref":"master","sha":"d80d434f36e43cab834765de03d83579869bfdda","user":{"login":"jenkinsci","id":107424,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNzQyNA==","avatar_url":"https://avatars0.githubusercontent.com/u/107424?v=4","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"repo":{"id":53688131,"node_id":"MDEwOlJlcG9zaXRvcnk1MzY4ODEzMQ==","name":"bitbucket-branch-source-plugin","full_name":"jenkinsci/bitbucket-branch-source-plugin","private":false,"owner":{"login":"jenkinsci","id":107424,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNzQyNA==","avatar_url":"https://avatars0.githubusercontent.com/u/107424?v=4","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/jenkinsci/bitbucket-branch-source-plugin","description":"Bitbucket Branch Source Plugin","fork":true,"url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin","forks_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/forks","keys_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/teams","hooks_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/events","assignees_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/tags","blobs_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/subscription","commits_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/merges","archive_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/downloads","issues_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/deployments","created_at":"2016-03-11T18:28:58Z","updated_at":"2018-09-22T07:15:52Z","pushed_at":"2018-09-22T07:15:47Z","git_url":"git://github.com/jenkinsci/bitbucket-branch-source-plugin.git","ssh_url":"git@github.com:jenkinsci/bitbucket-branch-source-plugin.git","clone_url":"https://github.com/jenkinsci/bitbucket-branch-source-plugin.git","svn_url":"https://github.com/jenkinsci/bitbucket-branch-source-plugin","homepage":"https://wiki.jenkins-ci.org/display/JENKINS/Bitbucket+Branch+Source+Plugin","size":957,"stargazers_count":85,"watchers_count":85,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":157,"mirror_url":null,"archived":false,"open_issues_count":17,"license":null,"forks":157,"open_issues":17,"watchers":85,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/pulls/139"},"html":{"href":"https://github.com/jenkinsci/bitbucket-branch-source-plugin/pull/139"},"issue":{"href":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/issues/139"},"comments":{"href":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/issues/139/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/pulls/139/comments"},"review_comment":{"href":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/pulls/139/commits"},"statuses":{"href":"https://api.github.com/repos/jenkinsci/bitbucket-branch-source-plugin/statuses/2db89fdae555769d1a47f694a6f29168b03b36ca"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"casz"}}