{"action":"created","comment":{"url":"https://api.github.com/repos/checkstyle/checkstyle/pulls/comments/27780299","id":27780299,"diff_hunk":"@@ -145,4 +145,25 @@ protected void postprocessHeaderLines()\n         }\n     }\n \n+    /**\n+     * Validates the {@code header} by compiling it with\n+     * {@link Pattern#compile(java.lang.String) } and throws\n+     * {@link PatternSyntaxException} if {@code header} isn't a valid pattern.\n+     * @param header the header value to validate and set (in that order)\n+     */\n+    @Override\n+    public void setHeader(String header)\n+    {\n+        if (header == null || header.trim().length() == 0) {\n+            return;\n+        }\n+        try {\n+            Pattern.compile(header);","path":"src/main/java/com/puppycrawl/tools/checkstyle/checks/header/RegexpHeaderCheck.java","position":17,"original_position":17,"commit_id":"1fd96db191367f97f741500bd3d1ecdc7651aed2","original_commit_id":"1fd96db191367f97f741500bd3d1ecdc7651aed2","user":{"login":"mkordas","id":5467276,"avatar_url":"https://avatars.githubusercontent.com/u/5467276?v=3","gravatar_id":"","url":"https://api.github.com/users/mkordas","html_url":"https://github.com/mkordas","followers_url":"https://api.github.com/users/mkordas/followers","following_url":"https://api.github.com/users/mkordas/following{/other_user}","gists_url":"https://api.github.com/users/mkordas/gists{/gist_id}","starred_url":"https://api.github.com/users/mkordas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkordas/subscriptions","organizations_url":"https://api.github.com/users/mkordas/orgs","repos_url":"https://api.github.com/users/mkordas/repos","events_url":"https://api.github.com/users/mkordas/events{/privacy}","received_events_url":"https://api.github.com/users/mkordas/received_events","type":"User","site_admin":false},"body":"We have util for exactly this code - please check in `Utils`","created_at":"2015-04-05T20:36:59Z","updated_at":"2015-04-05T20:36:59Z","html_url":"https://github.com/checkstyle/checkstyle/pull/897#discussion_r27780299","pull_request_url":"https://api.github.com/repos/checkstyle/checkstyle/pulls/897","_links":{"self":{"href":"https://api.github.com/repos/checkstyle/checkstyle/pulls/comments/27780299"},"html":{"href":"https://github.com/checkstyle/checkstyle/pull/897#discussion_r27780299"},"pull_request":{"href":"https://api.github.com/repos/checkstyle/checkstyle/pulls/897"}}},"pull_request":{"url":"https://api.github.com/repos/checkstyle/checkstyle/pulls/897","id":32652212,"html_url":"https://github.com/checkstyle/checkstyle/pull/897","diff_url":"https://github.com/checkstyle/checkstyle/pull/897.diff","patch_url":"https://github.com/checkstyle/checkstyle/pull/897.patch","issue_url":"https://api.github.com/repos/checkstyle/checkstyle/issues/897","number":897,"state":"open","locked":false,"title":"added validation for header in setHeader in RegexpHeaderCheck.java","user":{"login":"krichter722","id":4369372,"avatar_url":"https://avatars.githubusercontent.com/u/4369372?v=3","gravatar_id":"","url":"https://api.github.com/users/krichter722","html_url":"https://github.com/krichter722","followers_url":"https://api.github.com/users/krichter722/followers","following_url":"https://api.github.com/users/krichter722/following{/other_user}","gists_url":"https://api.github.com/users/krichter722/gists{/gist_id}","starred_url":"https://api.github.com/users/krichter722/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krichter722/subscriptions","organizations_url":"https://api.github.com/users/krichter722/orgs","repos_url":"https://api.github.com/users/krichter722/repos","events_url":"https://api.github.com/users/krichter722/events{/privacy}","received_events_url":"https://api.github.com/users/krichter722/received_events","type":"User","site_admin":false},"body":" to provide better feedback when an invalid Pattern is specified (was InvocationTargetException only before)","created_at":"2015-04-05T18:19:32Z","updated_at":"2015-04-05T20:36:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4e6a87c32f37b2bdaa58b65c2cd8a818de6fea3b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/checkstyle/checkstyle/pulls/897/commits","review_comments_url":"https://api.github.com/repos/checkstyle/checkstyle/pulls/897/comments","review_comment_url":"https://api.github.com/repos/checkstyle/checkstyle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/checkstyle/checkstyle/issues/897/comments","statuses_url":"https://api.github.com/repos/checkstyle/checkstyle/statuses/1fd96db191367f97f741500bd3d1ecdc7651aed2","head":{"label":"krichter722:regexp_valid1","ref":"regexp_valid1","sha":"1fd96db191367f97f741500bd3d1ecdc7651aed2","user":{"login":"krichter722","id":4369372,"avatar_url":"https://avatars.githubusercontent.com/u/4369372?v=3","gravatar_id":"","url":"https://api.github.com/users/krichter722","html_url":"https://github.com/krichter722","followers_url":"https://api.github.com/users/krichter722/followers","following_url":"https://api.github.com/users/krichter722/following{/other_user}","gists_url":"https://api.github.com/users/krichter722/gists{/gist_id}","starred_url":"https://api.github.com/users/krichter722/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krichter722/subscriptions","organizations_url":"https://api.github.com/users/krichter722/orgs","repos_url":"https://api.github.com/users/krichter722/repos","events_url":"https://api.github.com/users/krichter722/events{/privacy}","received_events_url":"https://api.github.com/users/krichter722/received_events","type":"User","site_admin":false},"repo":{"id":33449844,"name":"checkstyle","full_name":"krichter722/checkstyle","owner":{"login":"krichter722","id":4369372,"avatar_url":"https://avatars.githubusercontent.com/u/4369372?v=3","gravatar_id":"","url":"https://api.github.com/users/krichter722","html_url":"https://github.com/krichter722","followers_url":"https://api.github.com/users/krichter722/followers","following_url":"https://api.github.com/users/krichter722/following{/other_user}","gists_url":"https://api.github.com/users/krichter722/gists{/gist_id}","starred_url":"https://api.github.com/users/krichter722/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krichter722/subscriptions","organizations_url":"https://api.github.com/users/krichter722/orgs","repos_url":"https://api.github.com/users/krichter722/repos","events_url":"https://api.github.com/users/krichter722/events{/privacy}","received_events_url":"https://api.github.com/users/krichter722/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/krichter722/checkstyle","description":"Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard. By default it supports the Google Java Style Guide and Sun Code Conventions, but is highly configurable. It can be invoked with an ANT task and a command line program.","fork":true,"url":"https://api.github.com/repos/krichter722/checkstyle","forks_url":"https://api.github.com/repos/krichter722/checkstyle/forks","keys_url":"https://api.github.com/repos/krichter722/checkstyle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/krichter722/checkstyle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/krichter722/checkstyle/teams","hooks_url":"https://api.github.com/repos/krichter722/checkstyle/hooks","issue_events_url":"https://api.github.com/repos/krichter722/checkstyle/issues/events{/number}","events_url":"https://api.github.com/repos/krichter722/checkstyle/events","assignees_url":"https://api.github.com/repos/krichter722/checkstyle/assignees{/user}","branches_url":"https://api.github.com/repos/krichter722/checkstyle/branches{/branch}","tags_url":"https://api.github.com/repos/krichter722/checkstyle/tags","blobs_url":"https://api.github.com/repos/krichter722/checkstyle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/krichter722/checkstyle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/krichter722/checkstyle/git/refs{/sha}","trees_url":"https://api.github.com/repos/krichter722/checkstyle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/krichter722/checkstyle/statuses/{sha}","languages_url":"https://api.github.com/repos/krichter722/checkstyle/languages","stargazers_url":"https://api.github.com/repos/krichter722/checkstyle/stargazers","contributors_url":"https://api.github.com/repos/krichter722/checkstyle/contributors","subscribers_url":"https://api.github.com/repos/krichter722/checkstyle/subscribers","subscription_url":"https://api.github.com/repos/krichter722/checkstyle/subscription","commits_url":"https://api.github.com/repos/krichter722/checkstyle/commits{/sha}","git_commits_url":"https://api.github.com/repos/krichter722/checkstyle/git/commits{/sha}","comments_url":"https://api.github.com/repos/krichter722/checkstyle/comments{/number}","issue_comment_url":"https://api.github.com/repos/krichter722/checkstyle/issues/comments{/number}","contents_url":"https://api.github.com/repos/krichter722/checkstyle/contents/{+path}","compare_url":"https://api.github.com/repos/krichter722/checkstyle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/krichter722/checkstyle/merges","archive_url":"https://api.github.com/repos/krichter722/checkstyle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/krichter722/checkstyle/downloads","issues_url":"https://api.github.com/repos/krichter722/checkstyle/issues{/number}","pulls_url":"https://api.github.com/repos/krichter722/checkstyle/pulls{/number}","milestones_url":"https://api.github.com/repos/krichter722/checkstyle/milestones{/number}","notifications_url":"https://api.github.com/repos/krichter722/checkstyle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/krichter722/checkstyle/labels{/name}","releases_url":"https://api.github.com/repos/krichter722/checkstyle/releases{/id}","created_at":"2015-04-05T18:02:48Z","updated_at":"2015-04-05T18:02:51Z","pushed_at":"2015-04-05T18:04:12Z","git_url":"git://github.com/krichter722/checkstyle.git","ssh_url":"git@github.com:krichter722/checkstyle.git","clone_url":"https://github.com/krichter722/checkstyle.git","svn_url":"https://github.com/krichter722/checkstyle","homepage":"http://checkstyle.sourceforge.net/","size":51832,"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":"checkstyle:master","ref":"master","sha":"914bf53cd079008971634897b457480a7ca1f669","user":{"login":"checkstyle","id":5179750,"avatar_url":"https://avatars.githubusercontent.com/u/5179750?v=3","gravatar_id":"","url":"https://api.github.com/users/checkstyle","html_url":"https://github.com/checkstyle","followers_url":"https://api.github.com/users/checkstyle/followers","following_url":"https://api.github.com/users/checkstyle/following{/other_user}","gists_url":"https://api.github.com/users/checkstyle/gists{/gist_id}","starred_url":"https://api.github.com/users/checkstyle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/checkstyle/subscriptions","organizations_url":"https://api.github.com/users/checkstyle/orgs","repos_url":"https://api.github.com/users/checkstyle/repos","events_url":"https://api.github.com/users/checkstyle/events{/privacy}","received_events_url":"https://api.github.com/users/checkstyle/received_events","type":"Organization","site_admin":false},"repo":{"id":12499251,"name":"checkstyle","full_name":"checkstyle/checkstyle","owner":{"login":"checkstyle","id":5179750,"avatar_url":"https://avatars.githubusercontent.com/u/5179750?v=3","gravatar_id":"","url":"https://api.github.com/users/checkstyle","html_url":"https://github.com/checkstyle","followers_url":"https://api.github.com/users/checkstyle/followers","following_url":"https://api.github.com/users/checkstyle/following{/other_user}","gists_url":"https://api.github.com/users/checkstyle/gists{/gist_id}","starred_url":"https://api.github.com/users/checkstyle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/checkstyle/subscriptions","organizations_url":"https://api.github.com/users/checkstyle/orgs","repos_url":"https://api.github.com/users/checkstyle/repos","events_url":"https://api.github.com/users/checkstyle/events{/privacy}","received_events_url":"https://api.github.com/users/checkstyle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/checkstyle/checkstyle","description":"Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard. By default it supports the Google Java Style Guide and Sun Code Conventions, but is highly configurable. It can be invoked with an ANT task and a command line program.","fork":false,"url":"https://api.github.com/repos/checkstyle/checkstyle","forks_url":"https://api.github.com/repos/checkstyle/checkstyle/forks","keys_url":"https://api.github.com/repos/checkstyle/checkstyle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/checkstyle/checkstyle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/checkstyle/checkstyle/teams","hooks_url":"https://api.github.com/repos/checkstyle/checkstyle/hooks","issue_events_url":"https://api.github.com/repos/checkstyle/checkstyle/issues/events{/number}","events_url":"https://api.github.com/repos/checkstyle/checkstyle/events","assignees_url":"https://api.github.com/repos/checkstyle/checkstyle/assignees{/user}","branches_url":"https://api.github.com/repos/checkstyle/checkstyle/branches{/branch}","tags_url":"https://api.github.com/repos/checkstyle/checkstyle/tags","blobs_url":"https://api.github.com/repos/checkstyle/checkstyle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/checkstyle/checkstyle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/checkstyle/checkstyle/git/refs{/sha}","trees_url":"https://api.github.com/repos/checkstyle/checkstyle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/checkstyle/checkstyle/statuses/{sha}","languages_url":"https://api.github.com/repos/checkstyle/checkstyle/languages","stargazers_url":"https://api.github.com/repos/checkstyle/checkstyle/stargazers","contributors_url":"https://api.github.com/repos/checkstyle/checkstyle/contributors","subscribers_url":"https://api.github.com/repos/checkstyle/checkstyle/subscribers","subscription_url":"https://api.github.com/repos/checkstyle/checkstyle/subscription","commits_url":"https://api.github.com/repos/checkstyle/checkstyle/commits{/sha}","git_commits_url":"https://api.github.com/repos/checkstyle/checkstyle/git/commits{/sha}","comments_url":"https://api.github.com/repos/checkstyle/checkstyle/comments{/number}","issue_comment_url":"https://api.github.com/repos/checkstyle/checkstyle/issues/comments{/number}","contents_url":"https://api.github.com/repos/checkstyle/checkstyle/contents/{+path}","compare_url":"https://api.github.com/repos/checkstyle/checkstyle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/checkstyle/checkstyle/merges","archive_url":"https://api.github.com/repos/checkstyle/checkstyle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/checkstyle/checkstyle/downloads","issues_url":"https://api.github.com/repos/checkstyle/checkstyle/issues{/number}","pulls_url":"https://api.github.com/repos/checkstyle/checkstyle/pulls{/number}","milestones_url":"https://api.github.com/repos/checkstyle/checkstyle/milestones{/number}","notifications_url":"https://api.github.com/repos/checkstyle/checkstyle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/checkstyle/checkstyle/labels{/name}","releases_url":"https://api.github.com/repos/checkstyle/checkstyle/releases{/id}","created_at":"2013-08-31T02:05:05Z","updated_at":"2015-04-05T14:23:24Z","pushed_at":"2015-04-05T18:19:32Z","git_url":"git://github.com/checkstyle/checkstyle.git","ssh_url":"git@github.com:checkstyle/checkstyle.git","clone_url":"https://github.com/checkstyle/checkstyle.git","svn_url":"https://github.com/checkstyle/checkstyle","homepage":"http://checkstyle.sourceforge.net/","size":51832,"stargazers_count":282,"watchers_count":282,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":180,"mirror_url":null,"open_issues_count":109,"forks":180,"open_issues":109,"watchers":282,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/checkstyle/checkstyle/pulls/897"},"html":{"href":"https://github.com/checkstyle/checkstyle/pull/897"},"issue":{"href":"https://api.github.com/repos/checkstyle/checkstyle/issues/897"},"comments":{"href":"https://api.github.com/repos/checkstyle/checkstyle/issues/897/comments"},"review_comments":{"href":"https://api.github.com/repos/checkstyle/checkstyle/pulls/897/comments"},"review_comment":{"href":"https://api.github.com/repos/checkstyle/checkstyle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/checkstyle/checkstyle/pulls/897/commits"},"statuses":{"href":"https://api.github.com/repos/checkstyle/checkstyle/statuses/1fd96db191367f97f741500bd3d1ecdc7651aed2"}}}}