{"action":"created","issue":{"url":"https://api.github.com/repos/square/javapoet/issues/266","labels_url":"https://api.github.com/repos/square/javapoet/issues/266/labels{/name}","comments_url":"https://api.github.com/repos/square/javapoet/issues/266/comments","events_url":"https://api.github.com/repos/square/javapoet/issues/266/events","html_url":"https://github.com/square/javapoet/issues/266","id":71869106,"number":266,"title":"Is it possible to create static block initializers for a class?","user":{"login":"jaikiran","id":143523,"avatar_url":"https://avatars.githubusercontent.com/u/143523?v=3","gravatar_id":"","url":"https://api.github.com/users/jaikiran","html_url":"https://github.com/jaikiran","followers_url":"https://api.github.com/users/jaikiran/followers","following_url":"https://api.github.com/users/jaikiran/following{/other_user}","gists_url":"https://api.github.com/users/jaikiran/gists{/gist_id}","starred_url":"https://api.github.com/users/jaikiran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaikiran/subscriptions","organizations_url":"https://api.github.com/users/jaikiran/orgs","repos_url":"https://api.github.com/users/jaikiran/repos","events_url":"https://api.github.com/users/jaikiran/events{/privacy}","received_events_url":"https://api.github.com/users/jaikiran/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-29T13:02:01Z","updated_at":"2015-04-29T13:04:49Z","closed_at":null,"body":"I had a look at the javapoet code and even some documentation, but I haven't been able to find a way where I can add a static initializer block to a class. Something like this:\r\n\r\n       public class Foo {\r\n           private static Map<String, String> bar = new HashMap();\r\n           // creation of this block through javapoet is what I'm interested in\r\n           static {\r\n                   bar.put(\"blah\", \"hello world\");\r\n           }\r\n           .....\r\n       }\r\n\r\nP.S: Not sure if github issues is the right place to ask these questions. Couldn't find any other forum. Feel free to direct me to a relevant forum/group, if there's one.\r\n"},"comment":{"url":"https://api.github.com/repos/square/javapoet/issues/comments/97420103","html_url":"https://github.com/square/javapoet/issues/266#issuecomment-97420103","issue_url":"https://api.github.com/repos/square/javapoet/issues/266","id":97420103,"user":{"login":"tomxor","id":1352945,"avatar_url":"https://avatars.githubusercontent.com/u/1352945?v=3","gravatar_id":"","url":"https://api.github.com/users/tomxor","html_url":"https://github.com/tomxor","followers_url":"https://api.github.com/users/tomxor/followers","following_url":"https://api.github.com/users/tomxor/following{/other_user}","gists_url":"https://api.github.com/users/tomxor/gists{/gist_id}","starred_url":"https://api.github.com/users/tomxor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomxor/subscriptions","organizations_url":"https://api.github.com/users/tomxor/orgs","repos_url":"https://api.github.com/users/tomxor/repos","events_url":"https://api.github.com/users/tomxor/events{/privacy}","received_events_url":"https://api.github.com/users/tomxor/received_events","type":"User","site_admin":false},"created_at":"2015-04-29T13:04:49Z","updated_at":"2015-04-29T13:04:49Z","body":"There is a pending PR for that #257 \r\n"}}