{"action":"created","issue":{"url":"https://api.github.com/repos/javalite/activeweb/issues/202","labels_url":"https://api.github.com/repos/javalite/activeweb/issues/202/labels{/name}","comments_url":"https://api.github.com/repos/javalite/activeweb/issues/202/comments","events_url":"https://api.github.com/repos/javalite/activeweb/issues/202/events","html_url":"https://github.com/javalite/activeweb/issues/202","id":54459063,"number":202,"title":"Use StringBuilder","user":{"login":"ericbn","id":4120606,"avatar_url":"https://avatars.githubusercontent.com/u/4120606?v=3","gravatar_id":"","url":"https://api.github.com/users/ericbn","html_url":"https://github.com/ericbn","followers_url":"https://api.github.com/users/ericbn/followers","following_url":"https://api.github.com/users/ericbn/following{/other_user}","gists_url":"https://api.github.com/users/ericbn/gists{/gist_id}","starred_url":"https://api.github.com/users/ericbn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericbn/subscriptions","organizations_url":"https://api.github.com/users/ericbn/orgs","repos_url":"https://api.github.com/users/ericbn/repos","events_url":"https://api.github.com/users/ericbn/events{/privacy}","received_events_url":"https://api.github.com/users/ericbn/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-01-15T15:06:01Z","updated_at":"2015-01-15T16:57:37Z","closed_at":"2015-01-15T16:55:53Z","body":"We know three different JDK classes to do String appending, but there are important differences:\r\n\r\n* `StringWriter`: implements `Writer` and delegates to an internal `StringBuffer`. This one should be used as a `Writer` implementation. Having a method that receives a `StringWriter` makes little sense, since if the method needs something to write directly to Strings, not any Writer, it is better to make a contract with any of options below. Plus, you would need to handle IOException in a context where there's really no IO...\r\n* `StringBuffer`: it is thread-safe and doesn't have better performance than the option below.\r\n* `StringBuilder`: straight String appending with no extra toppings.\r\n\r\nSo my suggestion is we use `StringBuilder` in Templator API.\r\n\r\n### References\r\n* http://stackoverflow.com/questions/2980805/string-assembly-by-stringbuilder-vs-stringwriter-and-printwriter\r\n* http://littletutorials.com/2008/07/16/stringbuffer-vs-stringbuilder-performance-comparison/\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/javalite/activeweb/issues/comments/70118805","html_url":"https://github.com/javalite/activeweb/issues/202#issuecomment-70118805","issue_url":"https://api.github.com/repos/javalite/activeweb/issues/202","id":70118805,"user":{"login":"ipolevoy","id":500941,"avatar_url":"https://avatars.githubusercontent.com/u/500941?v=3","gravatar_id":"","url":"https://api.github.com/users/ipolevoy","html_url":"https://github.com/ipolevoy","followers_url":"https://api.github.com/users/ipolevoy/followers","following_url":"https://api.github.com/users/ipolevoy/following{/other_user}","gists_url":"https://api.github.com/users/ipolevoy/gists{/gist_id}","starred_url":"https://api.github.com/users/ipolevoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipolevoy/subscriptions","organizations_url":"https://api.github.com/users/ipolevoy/orgs","repos_url":"https://api.github.com/users/ipolevoy/repos","events_url":"https://api.github.com/users/ipolevoy/events{/privacy}","received_events_url":"https://api.github.com/users/ipolevoy/received_events","type":"User","site_admin":false},"created_at":"2015-01-15T16:57:37Z","updated_at":"2015-01-15T16:57:37Z","body":"no problem, you are usually right, so I looked at code up and down! :)"}}