payload: {"action":"created","issue":{"url":"https://api.github.com/repos/FasterXML/jackson-module-kotlin/issues/231","repository_url":"https://api.github.com/repos/FasterXML/jackson-module-kotlin","labels_url":"https://api.github.com/repos/FasterXML/jackson-module-kotlin/issues/231/labels{/name}","comments_url":"https://api.github.com/repos/FasterXML/jackson-module-kotlin/issues/231/comments","events_url":"https://api.github.com/repos/FasterXML/jackson-module-kotlin/issues/231/events","html_url":"https://github.com/FasterXML/jackson-module-kotlin/issues/231","id":454313938,"node_id":"MDU6SXNzdWU0NTQzMTM5Mzg=","number":231,"title":"StackOverflow when method included that is not called","user":{"login":"latunsk4","id":9044850,"node_id":"MDQ6VXNlcjkwNDQ4NTA=","avatar_url":"https://avatars0.githubusercontent.com/u/9044850?v=4","gravatar_id":"","url":"https://api.github.com/users/latunsk4","html_url":"https://github.com/latunsk4","followers_url":"https://api.github.com/users/latunsk4/followers","following_url":"https://api.github.com/users/latunsk4/following{/other_user}","gists_url":"https://api.github.com/users/latunsk4/gists{/gist_id}","starred_url":"https://api.github.com/users/latunsk4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/latunsk4/subscriptions","organizations_url":"https://api.github.com/users/latunsk4/orgs","repos_url":"https://api.github.com/users/latunsk4/repos","events_url":"https://api.github.com/users/latunsk4/events{/privacy}","received_events_url":"https://api.github.com/users/latunsk4/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-06-10T18:46:39Z","updated_at":"2019-10-29T01:33:14Z","closed_at":"2019-10-29T01:33:14Z","author_association":"NONE","body":"I wrote this method and a corresponding unit test which passed:\r\nfun writeJson(out: OutputStream) {\r\n        val mapper = jacksonObjectMapper()\r\n        mapper.writeValue(out,this)\r\n    }\r\n\r\n\r\nI then wrote a helper method to convert to a String. Without even invoking the function anywhere this broke my code and I have no idea why. The unit test will pass if I simply comment out \" writeJson(out)\" call:\r\n\r\n    fun getJsonString(): String {\r\n\r\n        val out = ByteArrayOutputStream()\r\n\r\n        writeJson(out) \r\n\r\n        return out.toString()\r\n    }\r\n\r\nI realize that I could have simply used mapper.writeValueAsString() instead of the helper method and that I should just lift the json serialization out of the class it I serializing. However, a method that is never invoked should never break code, period. Please see the attachment for a complete unit test to recreate. I was using Kotlin 1.3.31 and jackson-module-kotlin 2.9.7 ( I tested it against several releases and always get the same problem. \r\n\r\n[TestReportedError.txt](https://github.com/FasterXML/jackson-module-kotlin/files/3273311/TestReportedError.txt)\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/FasterXML/jackson-module-kotlin/issues/comments/547216647","html_url":"https://github.com/FasterXML/jackson-module-kotlin/issues/231#issuecomment-547216647","issue_url":"https://api.github.com/repos/FasterXML/jackson-module-kotlin/issues/231","id":547216647,"node_id":"MDEyOklzc3VlQ29tbWVudDU0NzIxNjY0Nw==","user":{"login":"apatrida","id":182340,"node_id":"MDQ6VXNlcjE4MjM0MA==","avatar_url":"https://avatars3.githubusercontent.com/u/182340?v=4","gravatar_id":"","url":"https://api.github.com/users/apatrida","html_url":"https://github.com/apatrida","followers_url":"https://api.github.com/users/apatrida/followers","following_url":"https://api.github.com/users/apatrida/following{/other_user}","gists_url":"https://api.github.com/users/apatrida/gists{/gist_id}","starred_url":"https://api.github.com/users/apatrida/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apatrida/subscriptions","organizations_url":"https://api.github.com/users/apatrida/orgs","repos_url":"https://api.github.com/users/apatrida/repos","events_url":"https://api.github.com/users/apatrida/events{/privacy}","received_events_url":"https://api.github.com/users/apatrida/received_events","type":"User","site_admin":false},"created_at":"2019-10-29T01:33:14Z","updated_at":"2019-10-29T01:33:14Z","author_association":"MEMBER","body":"The problem is you have a method `getJsonString` which looks like a property, using the JavaBean specification you have created a property that would be serialized.  So Jackson sees this and ends up serializing it during serialization, which loops indefinitely.  \r\n\r\nJust don't call it `getJsonString()` instead maybe `asJsonString()`\r\n\r\nThis type of post is best for Stack Overflow site, you will get faster help answers there."}}
other: {"actor":{"display_login":"apatrida"}}