{"action":"created","issue":{"url":"https://api.github.com/repos/stapler/stapler/issues/54","labels_url":"https://api.github.com/repos/stapler/stapler/issues/54/labels{/name}","comments_url":"https://api.github.com/repos/stapler/stapler/issues/54/comments","events_url":"https://api.github.com/repos/stapler/stapler/issues/54/events","html_url":"https://github.com/stapler/stapler/pull/54","id":97438361,"number":54,"title":"Model may capture synthetic methods during export","user":{"login":"aldaris","id":206692,"avatar_url":"https://avatars.githubusercontent.com/u/206692?v=3","gravatar_id":"","url":"https://api.github.com/users/aldaris","html_url":"https://github.com/aldaris","followers_url":"https://api.github.com/users/aldaris/followers","following_url":"https://api.github.com/users/aldaris/following{/other_user}","gists_url":"https://api.github.com/users/aldaris/gists{/gist_id}","starred_url":"https://api.github.com/users/aldaris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldaris/subscriptions","organizations_url":"https://api.github.com/users/aldaris/orgs","repos_url":"https://api.github.com/users/aldaris/repos","events_url":"https://api.github.com/users/aldaris/events{/privacy}","received_events_url":"https://api.github.com/users/aldaris/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-07-27T11:04:14Z","updated_at":"2015-10-16T12:59:03Z","closed_at":"2015-10-16T12:59:03Z","pull_request":{"url":"https://api.github.com/repos/stapler/stapler/pulls/54","html_url":"https://github.com/stapler/stapler/pull/54","diff_url":"https://github.com/stapler/stapler/pull/54.diff","patch_url":"https://github.com/stapler/stapler/pull/54.patch"},"body":"It all starts with the following test failure on Jenkins:\r\n\r\n    wrappedMultipleItems(hudson.model.ApiTest)  Time elapsed: 15.874 sec  <<< FAILURE!\r\n    org.junit.ComparisonFailure: expected:<...><name>test1</name><[]/root>> but was:<...><name>test1</name><[name>test0</name><name>test1</name><]/root>>\r\n\tat org.junit.Assert.assertEquals(Assert.java:115)\r\n\tat org.junit.Assert.assertEquals(Assert.java:144)\r\n\tat hudson.model.ApiTest.wrappedMultipleItems(ApiTest.java:100)\r\n\r\nAfter looking through the Api class it became apparent that something must be going wrong during:\r\n\r\n    p.writeTo(bean,pruner,Flavor.XML.createDataWriter(bean,sw));\r\n\r\nThis was printing the test0 and test1 jobs twice into StringWriter, so I've started to investigate the recursive logic of writeNestedObject and after a few iterations it turned out that the model itself is incorrectly generated: Jenkins had two MethodProperty with name \"jobs\", one was referencing a List&lt;TopLevelItem> getItems method, the other was referring to a Collection getItems method.\r\n\r\nWhen debugging the model generation I could see both methods, but I could see that one method had modifier of 1 (public), whilst the other had 4161 (synthetic public volatile). Now I'm not that good at JVM internals, but I can only guess that this synthetic method is only there to make life easier for the JVM.\r\n\r\nAnyways: the following little change appears to resolve the test failure in Jenkins. So far I could only see this test failing on OSX, so this test failure may be platform dependent, but I feel having this fix in place could simplify life for developers on OSX."},"comment":{"url":"https://api.github.com/repos/stapler/stapler/issues/comments/148710297","html_url":"https://github.com/stapler/stapler/pull/54#issuecomment-148710297","issue_url":"https://api.github.com/repos/stapler/stapler/issues/54","id":148710297,"user":{"login":"aldaris","id":206692,"avatar_url":"https://avatars.githubusercontent.com/u/206692?v=3","gravatar_id":"","url":"https://api.github.com/users/aldaris","html_url":"https://github.com/aldaris","followers_url":"https://api.github.com/users/aldaris/followers","following_url":"https://api.github.com/users/aldaris/following{/other_user}","gists_url":"https://api.github.com/users/aldaris/gists{/gist_id}","starred_url":"https://api.github.com/users/aldaris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldaris/subscriptions","organizations_url":"https://api.github.com/users/aldaris/orgs","repos_url":"https://api.github.com/users/aldaris/repos","events_url":"https://api.github.com/users/aldaris/events{/privacy}","received_events_url":"https://api.github.com/users/aldaris/received_events","type":"User","site_admin":false},"created_at":"2015-10-16T12:59:03Z","updated_at":"2015-10-16T12:59:03Z","body":"The #55 PR looks more appropriate to me, and has unit test as well, I'm closing this PR in the hopes that somebody will merge #55 (soon)."}}