{"action":"created","comment":{"url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/pulls/comments/32096532","id":32096532,"diff_hunk":"@@ -31,6 +33,32 @@ public void v2() throws Exception {\n         assertFieldType(i, String[].class, \"y\");\n         assertFieldType(i, Object.class, \"z\");\n     }\n+    \n+    @Test\n+    public void testClassesAreOnlyReWrittenWhenNeeded() throws Exception {\n+        System.out.println(\"rewrtting tests\");\n+        final Transformer t = new Transformer();\n+        AntClassLoader cl = new AntClassLoader() {\n+            @Override\n+            protected Class<?> defineClassFromData(File container, byte[] classData, String classname) throws IOException {\n+                byte[] rewritten = t.transform(classname, classData);\n+                if (rewritten!=classData ) {\n+                    fail(classname + \" was rewritten without need\");\n+                }\n+                return super.defineClassFromData(container, rewritten, classname);\n+            }\n+        };\n+\n+        cl.addPathComponent(new File(\"target/test-classes/v2\"));","path":"src/test/java/CompatibilityTest.java","position":32,"original_position":32,"commit_id":"15c2985b2908f8b80875372d3a9e286c4872e30b","original_commit_id":"15c2985b2908f8b80875372d3a9e286c4872e30b","user":{"login":"stephenc","id":209336,"avatar_url":"https://avatars.githubusercontent.com/u/209336?v=3","gravatar_id":"","url":"https://api.github.com/users/stephenc","html_url":"https://github.com/stephenc","followers_url":"https://api.github.com/users/stephenc/followers","following_url":"https://api.github.com/users/stephenc/following{/other_user}","gists_url":"https://api.github.com/users/stephenc/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenc/subscriptions","organizations_url":"https://api.github.com/users/stephenc/orgs","repos_url":"https://api.github.com/users/stephenc/repos","events_url":"https://api.github.com/users/stephenc/events{/privacy}","received_events_url":"https://api.github.com/users/stephenc/received_events","type":"User","site_admin":false},"body":"AFAIK surefire will set the CWD *but* more important is that you cannot guarantee that the IDE's CWD will be `${basedir}` so the safer way is **strongly** recommended","created_at":"2015-06-10T08:18:28Z","updated_at":"2015-06-10T08:18:28Z","html_url":"https://github.com/jenkinsci/bytecode-compatibility-transformer/pull/3#discussion_r32096532","pull_request_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/pulls/comments/32096532"},"html":{"href":"https://github.com/jenkinsci/bytecode-compatibility-transformer/pull/3#discussion_r32096532"},"pull_request":{"href":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/pulls/3","id":37238293,"html_url":"https://github.com/jenkinsci/bytecode-compatibility-transformer/pull/3","diff_url":"https://github.com/jenkinsci/bytecode-compatibility-transformer/pull/3.diff","patch_url":"https://github.com/jenkinsci/bytecode-compatibility-transformer/pull/3.patch","issue_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/issues/3","number":3,"state":"open","locked":false,"title":"[WIP] Test case for [JENKINS-28799]","user":{"login":"jtnord","id":494726,"avatar_url":"https://avatars.githubusercontent.com/u/494726?v=3","gravatar_id":"","url":"https://api.github.com/users/jtnord","html_url":"https://github.com/jtnord","followers_url":"https://api.github.com/users/jtnord/followers","following_url":"https://api.github.com/users/jtnord/following{/other_user}","gists_url":"https://api.github.com/users/jtnord/gists{/gist_id}","starred_url":"https://api.github.com/users/jtnord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtnord/subscriptions","organizations_url":"https://api.github.com/users/jtnord/orgs","repos_url":"https://api.github.com/users/jtnord/repos","events_url":"https://api.github.com/users/jtnord/events{/privacy}","received_events_url":"https://api.github.com/users/jtnord/received_events","type":"User","site_admin":false},"body":"Adds a test case that fails if a class is needlessly transformed: [JENKINS-28799](https://issues.jenkins-ci.org/browse/JENKINS-28799)\r\n\r\nThe fact that the class has been transformed needs to be looked at and is the root cause or\r\n[JENKINS-28781](https://issues.jenkins-ci.org/issues/JENKINS-28781) and [JENKINS-19383](https://issues.jenkins-ci.org/issues/JENKINS-19383)\r\n\r\nSo do not merge until there is a fix - but was pushed to origin as this may need to be picked up by someone else.\r\n\r\n@reviewbybees","created_at":"2015-06-09T10:18:29Z","updated_at":"2015-06-10T08:18:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9eaf2ded3f3f0e883ccb7b63ad22bf20ee3b612b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/pulls/3/commits","review_comments_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/pulls/3/comments","review_comment_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/issues/3/comments","statuses_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/statuses/15c2985b2908f8b80875372d3a9e286c4872e30b","head":{"label":"jenkinsci:JENKINS-28799","ref":"JENKINS-28799","sha":"15c2985b2908f8b80875372d3a9e286c4872e30b","user":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"repo":{"id":11776720,"name":"bytecode-compatibility-transformer","full_name":"jenkinsci/bytecode-compatibility-transformer","owner":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jenkinsci/bytecode-compatibility-transformer","description":"","fork":false,"url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer","forks_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/forks","keys_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/teams","hooks_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/events","assignees_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/tags","blobs_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/subscription","commits_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/merges","archive_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/downloads","issues_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/releases{/id}","created_at":"2013-07-30T22:08:33Z","updated_at":"2014-05-24T03:10:43Z","pushed_at":"2015-06-09T10:18:31Z","git_url":"git://github.com/jenkinsci/bytecode-compatibility-transformer.git","ssh_url":"git@github.com:jenkinsci/bytecode-compatibility-transformer.git","clone_url":"https://github.com/jenkinsci/bytecode-compatibility-transformer.git","svn_url":"https://github.com/jenkinsci/bytecode-compatibility-transformer","homepage":"","size":276,"stargazers_count":5,"watchers_count":5,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":5,"default_branch":"master"}},"base":{"label":"jenkinsci:master","ref":"master","sha":"494273053c7cf844aa2170738b91f393795c1b62","user":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"repo":{"id":11776720,"name":"bytecode-compatibility-transformer","full_name":"jenkinsci/bytecode-compatibility-transformer","owner":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jenkinsci/bytecode-compatibility-transformer","description":"","fork":false,"url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer","forks_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/forks","keys_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/teams","hooks_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/events","assignees_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/tags","blobs_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/subscription","commits_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/merges","archive_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/downloads","issues_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/releases{/id}","created_at":"2013-07-30T22:08:33Z","updated_at":"2014-05-24T03:10:43Z","pushed_at":"2015-06-09T10:18:31Z","git_url":"git://github.com/jenkinsci/bytecode-compatibility-transformer.git","ssh_url":"git@github.com:jenkinsci/bytecode-compatibility-transformer.git","clone_url":"https://github.com/jenkinsci/bytecode-compatibility-transformer.git","svn_url":"https://github.com/jenkinsci/bytecode-compatibility-transformer","homepage":"","size":276,"stargazers_count":5,"watchers_count":5,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/pulls/3"},"html":{"href":"https://github.com/jenkinsci/bytecode-compatibility-transformer/pull/3"},"issue":{"href":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/issues/3"},"comments":{"href":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/jenkinsci/bytecode-compatibility-transformer/statuses/15c2985b2908f8b80875372d3a9e286c4872e30b"}}}}