{"action":"created","issue":{"url":"https://api.github.com/repos/checkstyle/checkstyle/issues/3202","repository_url":"https://api.github.com/repos/checkstyle/checkstyle","labels_url":"https://api.github.com/repos/checkstyle/checkstyle/issues/3202/labels{/name}","comments_url":"https://api.github.com/repos/checkstyle/checkstyle/issues/3202/comments","events_url":"https://api.github.com/repos/checkstyle/checkstyle/issues/3202/events","html_url":"https://github.com/checkstyle/checkstyle/issues/3202","id":155991839,"number":3202,"title":"Allow WhitespaceAround for ARRAY_INIT token","user":{"login":"jsotuyod","id":802626,"avatar_url":"https://avatars.githubusercontent.com/u/802626?v=3","gravatar_id":"","url":"https://api.github.com/users/jsotuyod","html_url":"https://github.com/jsotuyod","followers_url":"https://api.github.com/users/jsotuyod/followers","following_url":"https://api.github.com/users/jsotuyod/following{/other_user}","gists_url":"https://api.github.com/users/jsotuyod/gists{/gist_id}","starred_url":"https://api.github.com/users/jsotuyod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsotuyod/subscriptions","organizations_url":"https://api.github.com/users/jsotuyod/orgs","repos_url":"https://api.github.com/users/jsotuyod/repos","events_url":"https://api.github.com/users/jsotuyod/events{/privacy}","received_events_url":"https://api.github.com/users/jsotuyod/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-05-20T15:39:46Z","updated_at":"2016-06-27T05:52:01Z","closed_at":null,"body":"#Using this configuration:\r\n\r\n```xml\r\n<?xml version=\"1.0\"?>\r\n<!DOCTYPE module PUBLIC\r\n        \"-//Puppy Crawl//DTD Check Configuration 1.3//EN\"\r\n        \"http://www.puppycrawl.com/dtds/configuration_1_3.dtd\">\r\n<module name=\"Checker\">\r\n    <module name=\"TreeWalker\">\r\n        <module name=\"WhitespaceAround\"/>\r\n    </module>\r\n</module>\r\n```\r\n\r\nCheckstyle won't report on the curly braces used for array declarations, such as:\r\n\r\n```java\r\npublic class Foo {\r\n    public final int[] COLORS = new int[]{Color.BLACK };\r\n    //                                   ^ doesn't report missing whitespace around {\r\n}\r\n```\r\n\r\n```bash\r\n$ java -jar ~/Downloads/checkstyle-6.18/checkstyle-6.18-all.jar -c config.xml Foo.java\r\nStarting audit...\r\nAudit done.\r\n```\r\n\r\nThis is down to the fact that even though `WhitespaceAround` appllies to `LCURLY` and `RCURLY` tokens, when writing an array, the `{` is actually treated as an `ARRAY_INIT` token, which is not currently being processed by the check.\r\n\r\nIt would be desired if `ARRAY_INIT` was to be processed by `WhitespaceAround` in order to allow this, and have the configuration given before report on arrays' initialization.\r\n\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/34426531-allow-whitespacearound-for-array_init-token?utm_campaign=plugin&utm_content=tracker%2F500528&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F500528&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/checkstyle/checkstyle/issues/comments/228659531","html_url":"https://github.com/checkstyle/checkstyle/issues/3202#issuecomment-228659531","issue_url":"https://api.github.com/repos/checkstyle/checkstyle/issues/3202","id":228659531,"user":{"login":"romani","id":812984,"avatar_url":"https://avatars.githubusercontent.com/u/812984?v=3","gravatar_id":"","url":"https://api.github.com/users/romani","html_url":"https://github.com/romani","followers_url":"https://api.github.com/users/romani/followers","following_url":"https://api.github.com/users/romani/following{/other_user}","gists_url":"https://api.github.com/users/romani/gists{/gist_id}","starred_url":"https://api.github.com/users/romani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romani/subscriptions","organizations_url":"https://api.github.com/users/romani/orgs","repos_url":"https://api.github.com/users/romani/repos","events_url":"https://api.github.com/users/romani/events{/privacy}","received_events_url":"https://api.github.com/users/romani/received_events","type":"User","site_admin":false},"created_at":"2016-06-27T05:52:01Z","updated_at":"2016-06-27T05:52:01Z","body":"please rephrase one more time what behaviour your expect.\r\ndo you want to have ability to specify `ARRAY_INIT` in `tokens` property ? (as it is kind of analogue of `RCURLY ` and `LCURLY` ).\r\n"}}
{"actor":{"display_login":"romani"}}