{"action":"created","issue":{"url":"https://api.github.com/repos/greenlaw110/Rythm/issues/256","labels_url":"https://api.github.com/repos/greenlaw110/Rythm/issues/256/labels{/name}","comments_url":"https://api.github.com/repos/greenlaw110/Rythm/issues/256/comments","events_url":"https://api.github.com/repos/greenlaw110/Rythm/issues/256/events","html_url":"https://github.com/greenlaw110/Rythm/issues/256","id":65535169,"number":256,"title":"Reinit of Rythm","user":{"login":"WolfgangFahl","id":1336221,"avatar_url":"https://avatars.githubusercontent.com/u/1336221?v=3","gravatar_id":"","url":"https://api.github.com/users/WolfgangFahl","html_url":"https://github.com/WolfgangFahl","followers_url":"https://api.github.com/users/WolfgangFahl/followers","following_url":"https://api.github.com/users/WolfgangFahl/following{/other_user}","gists_url":"https://api.github.com/users/WolfgangFahl/gists{/gist_id}","starred_url":"https://api.github.com/users/WolfgangFahl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WolfgangFahl/subscriptions","organizations_url":"https://api.github.com/users/WolfgangFahl/orgs","repos_url":"https://api.github.com/users/WolfgangFahl/repos","events_url":"https://api.github.com/users/WolfgangFahl/events{/privacy}","received_events_url":"https://api.github.com/users/WolfgangFahl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-31T20:09:47Z","updated_at":"2015-03-31T21:16:10Z","closed_at":null,"body":"my JUnit TestSuite for a project fails after adding the test\r\n\r\n @Test\r\n  public void testCompact() {\r\n     String template=\"no whitespace here\\n\" + \r\n         \"@for (int i=0;i<2;i++) \\n\" + \r\n         \"{  please keep the whitespace\\n}\" + \r\n         \"\\nno whitespace here\\n\"  ;\r\n     Map<String, Object> conf = new HashMap<String, Object>();\r\n     conf.put(\"codegen.compact.enabled\",false);\r\n     Rythm.init(conf);\r\n     Map<String, Object> rootMap = new HashMap<String, Object>();\r\n     String result=Rythm.render(template,rootMap);\r\n     check(\"no whitespace here\\n\" + \r\n         \"  please keep the whitespace\\n\" + \r\n         \"  please keep the whitespace\\n\" + \r\n         \"no whitespace here\\n\",result);\r\n  }\r\n\r\nfor http://stackoverflow.com/questions/29376686/unexpected-whitespace-handling-in-rythm-removes-wanted-blanks\r\n\r\njava.lang.IllegalStateException: Rythm is already initialized\r\n\tat org.rythmengine.Rythm.init(Rythm.java:96)\r\n\tat org.sidif.wiki.TestRythm.testCompact(TestRythm.java:78)\r\n\t\r\nThis is very suprising. Why shouldn't it be possible to call the static method multiple times? Now there is a need for a uninit method which is not mentioned in the exception ..."},"comment":{"url":"https://api.github.com/repos/greenlaw110/Rythm/issues/comments/88252854","html_url":"https://github.com/greenlaw110/Rythm/issues/256#issuecomment-88252854","issue_url":"https://api.github.com/repos/greenlaw110/Rythm/issues/256","id":88252854,"user":{"login":"greenlaw110","id":216930,"avatar_url":"https://avatars.githubusercontent.com/u/216930?v=3","gravatar_id":"","url":"https://api.github.com/users/greenlaw110","html_url":"https://github.com/greenlaw110","followers_url":"https://api.github.com/users/greenlaw110/followers","following_url":"https://api.github.com/users/greenlaw110/following{/other_user}","gists_url":"https://api.github.com/users/greenlaw110/gists{/gist_id}","starred_url":"https://api.github.com/users/greenlaw110/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greenlaw110/subscriptions","organizations_url":"https://api.github.com/users/greenlaw110/orgs","repos_url":"https://api.github.com/users/greenlaw110/repos","events_url":"https://api.github.com/users/greenlaw110/events{/privacy}","received_events_url":"https://api.github.com/users/greenlaw110/received_events","type":"User","site_admin":false},"created_at":"2015-03-31T21:16:09Z","updated_at":"2015-03-31T21:16:09Z","body":"Not at all. `Rythm.init` is supposed to be called only once per JVM lifecycle. It's a very heavy object which full bunch of dependencies including class loader and resource managers.  For testing purpose, if you want to isolate Rythm for each test, call `Rythm.shutdown()` before `Rythm.init()`.\r\n\r\nAlso in real application unless it's very simple one, don't use `Rythm.xxx` directly, instead, create your own `RythmEngine` instance and use it. See http://rythmengine.org/doc/developer_guide.md#singleton_or_not for more information"}}