This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: bug in invoke + reflection patch/improvement



A bug in your ReflectionHelper class:

> ================
> ReflectionHelper:
> ================
>
>     /** True if the JDK implements Java 2 or above. If this is
> <code>true</true>, then non-public classes and members can be accessed.
>      */
>     public static boolean isJava2;
>
>     static {
>         try {
>             Class.forName("java.lang.reflect.AccessibleObject");
>         } catch (ClassNotFoundException ex) {
>             isJava2 = false;
>         }
>         isJava2 = true;
>     }

It seems to me that isJava2 = true is executed in any case. This statement
should go just after the forName call.

BTW, the javadoc comment should have </code> and not </true> ! :-)




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]