when I try to import one of the JRE classes (in my case: java.lang.String) by reflection, I'll get the following RuntimeException:
Caused by: java.lang.IllegalAccessException: Class recoder.bytecode.ReflectionImport can not access a member of class java.lang.String with modifiers "private static final"
Looking in the source code yields that the exception is fired by a code snippet which is prefixed by the comment "this should never happen!" - obviously it does. ;-) It seems that getClassFile doesn't make the fields accessible by calling setAccessible(). Is this the way to solve the problem? It did I do something wrong?
Best regards,
Christian
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, that should do the trick. Will be fixed in the next release. However, note that reflection import has not been updated to support Java 5 language features, so you won't get the same information as from reading the bytecode classes.
/Tobias
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello there,
when I try to import one of the JRE classes (in my case: java.lang.String) by reflection, I'll get the following RuntimeException:
Caused by: java.lang.IllegalAccessException: Class recoder.bytecode.ReflectionImport can not access a member of class java.lang.String with modifiers "private static final"
Looking in the source code yields that the exception is fired by a code snippet which is prefixed by the comment "this should never happen!" - obviously it does. ;-) It seems that getClassFile doesn't make the fields accessible by calling setAccessible(). Is this the way to solve the problem? It did I do something wrong?
Best regards,
Christian
Hi,
Yes, that should do the trick. Will be fixed in the next release. However, note that reflection import has not been updated to support Java 5 language features, so you won't get the same information as from reading the bytecode classes.
/Tobias