{"action":"created","issue":{"url":"https://api.github.com/repos/jOOQ/jOOR/issues/39","repository_url":"https://api.github.com/repos/jOOQ/jOOR","labels_url":"https://api.github.com/repos/jOOQ/jOOR/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/jOOQ/jOOR/issues/39/comments","events_url":"https://api.github.com/repos/jOOQ/jOOR/issues/39/events","html_url":"https://github.com/jOOQ/jOOR/issues/39","id":262953281,"number":39,"title":"Fail to set private static final variable","user":{"login":"olivierg13","id":1358863,"avatar_url":"https://avatars0.githubusercontent.com/u/1358863?v=4","gravatar_id":"","url":"https://api.github.com/users/olivierg13","html_url":"https://github.com/olivierg13","followers_url":"https://api.github.com/users/olivierg13/followers","following_url":"https://api.github.com/users/olivierg13/following{/other_user}","gists_url":"https://api.github.com/users/olivierg13/gists{/gist_id}","starred_url":"https://api.github.com/users/olivierg13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olivierg13/subscriptions","organizations_url":"https://api.github.com/users/olivierg13/orgs","repos_url":"https://api.github.com/users/olivierg13/repos","events_url":"https://api.github.com/users/olivierg13/events{/privacy}","received_events_url":"https://api.github.com/users/olivierg13/received_events","type":"User","site_admin":false},"labels":[{"id":159744230,"url":"https://api.github.com/repos/jOOQ/jOOR/labels/P:%20Medium","name":"P: Medium","color":"ffaaaa","default":false},{"id":159744426,"url":"https://api.github.com/repos/jOOQ/jOOR/labels/T:%20Defect","name":"T: Defect","color":"cccccc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/jOOQ/jOOR/milestones/3","html_url":"https://github.com/jOOQ/jOOR/milestone/3","labels_url":"https://api.github.com/repos/jOOQ/jOOR/milestones/3/labels","id":1867731,"number":3,"title":"Version 0.9.7","description":"","creator":{"login":"lukaseder","id":734593,"avatar_url":"https://avatars2.githubusercontent.com/u/734593?v=4","gravatar_id":"","url":"https://api.github.com/users/lukaseder","html_url":"https://github.com/lukaseder","followers_url":"https://api.github.com/users/lukaseder/followers","following_url":"https://api.github.com/users/lukaseder/following{/other_user}","gists_url":"https://api.github.com/users/lukaseder/gists{/gist_id}","starred_url":"https://api.github.com/users/lukaseder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukaseder/subscriptions","organizations_url":"https://api.github.com/users/lukaseder/orgs","repos_url":"https://api.github.com/users/lukaseder/repos","events_url":"https://api.github.com/users/lukaseder/events{/privacy}","received_events_url":"https://api.github.com/users/lukaseder/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":11,"state":"open","created_at":"2016-07-06T14:39:40Z","updated_at":"2017-10-10T15:21:57Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2017-10-04T22:41:33Z","updated_at":"2017-10-20T15:07:35Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\n\r\nFirst of all, thank you for the library, it's really useful :)\r\n\r\nI found an issue when I want to reflect on a private final static variable (the worst case ^^), Joor throws a:\r\n`org.joor.ReflectException: java.lang.IllegalAccessException: Can not set static final boolean field com.ogoutay.robomocki3.BuildConfig.DEBUG to java.lang.Boolean`\r\n\r\nIf I use my own Kotlin extension on top of your library, it works well:\r\n```\r\nReflect.setFinalStatic(name: String, newValue: Any) {\r\n    val field = this.get<Class<*>>().getDeclaredField(name)\r\n\r\n    field.isAccessible = true\r\n    val modifiersField = Field::class.java.getDeclaredField(\"modifiers\")\r\n    modifiersField.isAccessible = true\r\n    modifiersField.setInt(field, field.modifiers and Modifier.FINAL.inv())\r\n\r\n    field.set(null, newValue)\r\n}\r\n```\r\n\r\nDo you know where the problem could come from?\r\n\r\nThank you in advance\r\n\r\nCheers,\r\n\r\nOlivier"},"comment":{"url":"https://api.github.com/repos/jOOQ/jOOR/issues/comments/338233977","html_url":"https://github.com/jOOQ/jOOR/issues/39#issuecomment-338233977","issue_url":"https://api.github.com/repos/jOOQ/jOOR/issues/39","id":338233977,"user":{"login":"olivierg13","id":1358863,"avatar_url":"https://avatars0.githubusercontent.com/u/1358863?v=4","gravatar_id":"","url":"https://api.github.com/users/olivierg13","html_url":"https://github.com/olivierg13","followers_url":"https://api.github.com/users/olivierg13/followers","following_url":"https://api.github.com/users/olivierg13/following{/other_user}","gists_url":"https://api.github.com/users/olivierg13/gists{/gist_id}","starred_url":"https://api.github.com/users/olivierg13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olivierg13/subscriptions","organizations_url":"https://api.github.com/users/olivierg13/orgs","repos_url":"https://api.github.com/users/olivierg13/repos","events_url":"https://api.github.com/users/olivierg13/events{/privacy}","received_events_url":"https://api.github.com/users/olivierg13/received_events","type":"User","site_admin":false},"created_at":"2017-10-20T15:07:35Z","updated_at":"2017-10-20T15:07:35Z","author_association":"NONE","body":"Hello @lukaseder \r\nNo problem :)\r\nI remember while writing the solution that the order of the private / final modifiers mattered, but I'm not 100% sure that's the problem.\r\n\r\nI'm running this code as part of a Robolectric test (Android), that should use my machine JVM.\r\n`java version \"1.8.0_131\"\r\nJava(TM) SE Runtime Environment (build 1.8.0_131-b11)\r\nJava HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)`\r\n\r\nThank you for looking into it :)"}}
{"actor":{"display_login":"olivierg13"}}