{"action":"created","issue":{"url":"https://api.github.com/repos/cbeust/testng/issues/1996","repository_url":"https://api.github.com/repos/cbeust/testng","labels_url":"https://api.github.com/repos/cbeust/testng/issues/1996/labels{/name}","comments_url":"https://api.github.com/repos/cbeust/testng/issues/1996/comments","events_url":"https://api.github.com/repos/cbeust/testng/issues/1996/events","html_url":"https://github.com/cbeust/testng/pull/1996","id":395088676,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxNjM2NjY5","number":1996,"title":"Streamline native injection w.r.t cloning","user":{"login":"krmahadevan","id":909773,"node_id":"MDQ6VXNlcjkwOTc3Mw==","avatar_url":"https://avatars0.githubusercontent.com/u/909773?v=4","gravatar_id":"","url":"https://api.github.com/users/krmahadevan","html_url":"https://github.com/krmahadevan","followers_url":"https://api.github.com/users/krmahadevan/followers","following_url":"https://api.github.com/users/krmahadevan/following{/other_user}","gists_url":"https://api.github.com/users/krmahadevan/gists{/gist_id}","starred_url":"https://api.github.com/users/krmahadevan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krmahadevan/subscriptions","organizations_url":"https://api.github.com/users/krmahadevan/orgs","repos_url":"https://api.github.com/users/krmahadevan/repos","events_url":"https://api.github.com/users/krmahadevan/events{/privacy}","received_events_url":"https://api.github.com/users/krmahadevan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2019-01-01T14:37:56Z","updated_at":"2019-01-01T18:19:12Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/cbeust/testng/pulls/1996","html_url":"https://github.com/cbeust/testng/pull/1996","diff_url":"https://github.com/cbeust/testng/pull/1996.diff","patch_url":"https://github.com/cbeust/testng/pull/1996.patch"},"body":"Closes #1994\r\n\r\nCurrently as part of supporting native injection\r\nTestNG resorts to invoking the “clone()” method \r\non the parameter being natively injected.\r\n\r\nThis becomes a problem because XmlTest is the only\r\ninternal TestNG object that implements the Cloneable\r\ninterface wherein it resorts to something like a deep\r\ncopy and adds the cloned instance to the XmlSuite.\r\n\r\nThis causes a lot of phony XmlTest objects to be \r\nadded up to the suite and causes issues as detailed\r\nin the bug.\r\n\r\nFixed this by introducing a marker interface to \r\nindicate to TestNG to skip cloning and use the object\r\nas is. Annotated “XmlTest” with this annotation \r\nso that we dont clone xmltest but instead use it \r\nas is.\r\n\r\nYes this will expose the XmlTest object, but its \r\nalready exposed to the end user via various different\r\nmeans. So I guess we are ok here.\r\n\r\nFixes #1994 .\r\n\r\n### Did you remember to?\r\n\r\n- [X] Add test case(s)\r\n- [X] Update `CHANGES.txt`"},"comment":{"url":"https://api.github.com/repos/cbeust/testng/issues/comments/450747840","html_url":"https://github.com/cbeust/testng/pull/1996#issuecomment-450747840","issue_url":"https://api.github.com/repos/cbeust/testng/issues/1996","id":450747840,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MDc0Nzg0MA==","user":{"login":"krmahadevan","id":909773,"node_id":"MDQ6VXNlcjkwOTc3Mw==","avatar_url":"https://avatars0.githubusercontent.com/u/909773?v=4","gravatar_id":"","url":"https://api.github.com/users/krmahadevan","html_url":"https://github.com/krmahadevan","followers_url":"https://api.github.com/users/krmahadevan/followers","following_url":"https://api.github.com/users/krmahadevan/following{/other_user}","gists_url":"https://api.github.com/users/krmahadevan/gists{/gist_id}","starred_url":"https://api.github.com/users/krmahadevan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krmahadevan/subscriptions","organizations_url":"https://api.github.com/users/krmahadevan/orgs","repos_url":"https://api.github.com/users/krmahadevan/repos","events_url":"https://api.github.com/users/krmahadevan/events{/privacy}","received_events_url":"https://api.github.com/users/krmahadevan/received_events","type":"User","site_admin":false},"created_at":"2019-01-01T18:19:12Z","updated_at":"2019-01-01T18:19:12Z","author_association":"COLLABORATOR","body":"@juherr \r\n\r\n> +XmlTest result = new XmlTest(getSuite().clone());\r\n\r\nThis will break backward compatibility in terms of what we are providing as a functionality via the `clone()` method to all existing users. The current functionality guarantees that when I clone an `XmlTest` object, it would automatically also get added to the current `XmlSuite`. With the change you are suggesting, that will be broken."}}
{"actor":{"display_login":"krmahadevan"}}