{"action":"closed","issue":{"url":"https://api.github.com/repos/jayway/powermock/issues/369","labels_url":"https://api.github.com/repos/jayway/powermock/issues/369/labels{/name}","comments_url":"https://api.github.com/repos/jayway/powermock/issues/369/comments","events_url":"https://api.github.com/repos/jayway/powermock/issues/369/events","html_url":"https://github.com/jayway/powermock/issues/369","id":97066518,"number":369,"title":"Failed to transform class with name foo.TempTest Reason: 3 ","user":{"login":"johanhaleby","id":187029,"avatar_url":"https://avatars.githubusercontent.com/u/187029?v=3","gravatar_id":"","url":"https://api.github.com/users/johanhaleby","html_url":"https://github.com/johanhaleby","followers_url":"https://api.github.com/users/johanhaleby/followers","following_url":"https://api.github.com/users/johanhaleby/following{/other_user}","gists_url":"https://api.github.com/users/johanhaleby/gists{/gist_id}","starred_url":"https://api.github.com/users/johanhaleby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johanhaleby/subscriptions","organizations_url":"https://api.github.com/users/johanhaleby/orgs","repos_url":"https://api.github.com/users/johanhaleby/repos","events_url":"https://api.github.com/users/johanhaleby/events{/privacy}","received_events_url":"https://api.github.com/users/johanhaleby/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jayway/powermock/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/jayway/powermock/labels/imported","name":"imported","color":"FFFFFF"},{"url":"https://api.github.com/repos/jayway/powermock/labels/invalid","name":"invalid","color":"e6e6e6"},{"url":"https://api.github.com/repos/jayway/powermock/labels/Priority-Medium","name":"Priority-Medium","color":"FFFFFF"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-24T14:34:51Z","updated_at":"2015-07-24T14:35:09Z","closed_at":"2015-07-24T14:35:09Z","body":"_From [zhaoshan...@gmail.com](https://code.google.com/u/117710579479258069090/) on October 12, 2011 17:44:01_\n\nI'm getting a \"Failed to transform class with name foo.TempTest Reason: 3\" error when mocking a static method. \r\n\r\nMy test is this:\r\n\r\n@RunWith(PowerMockRunner.class)  \r\n@PrepareForTest({Utils2.class})  \r\npublic class TempTest {\r\n\r\n    @Test\r\n    public void say() {\r\n    }\r\n}\r\n\r\nAnd Utils2 class:\r\n\r\npublic class Utils2 {\r\n\tpublic static String say(String s) {\r\n\t\treturn s;\r\n\t}\r\n}\r\n\r\nThe stack trace when exception is thrown is:\r\n\r\njava.lang.IllegalStateException: Failed to transform class with name com.crossfence.service.TempTest. Reason: 3\r\n\t...\r\nCaused by: java.lang.ArrayIndexOutOfBoundsException: 3\r\n\tat javassist.bytecode.ByteArray.write16bit(ByteArray.java:40)\r\n\tat javassist.bytecode.StackMapTable$Shifter.update(StackMapTable.java:744)\r\n\t...\r\n\tat javassist.expr.FieldAccess.replace(FieldAccess.java:213)\r\n\tat org.powermock.core.transformers.impl.MainMockTransformer$PowerMockExpressionEditor.edit(MainMockTransformer.java:267)\r\n\t...\r\n\tat javassist.CtClassType.instrument(CtClassType.java:1288)\r\n\tat org.powermock.core.transformers.impl.MainMockTransformer.transform(MainMockTransformer.java:75)\r\n\tat org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.java:203)\r\n\t... 29 more\r\n\r\nI got the exception when adding this test to an existing project. However, it works fine if I create a new project with just these two classes. Therefore this could be an envrionement issue. \r\n\r\nI'm using these verions:\r\njunit 4.8.2, easymock 3.0, powermock 1.4.10, and javassist 3.12.0.GA.\r\n\r\nThe operating system is Windows 7.\r\n\r\nHow do I troubleshoot this? Are there loggings I can turn on?\r\n\r\nLet me know if you need more information.\r\n\r\nThanks!\n\n_Original issue: http://code.google.com/p/powermock/issues/detail?id=349_"}}