Re: Reflect test

Date view Thread view Subject view Author view

From: Godmar Back (gback@cs.utah.edu)
Date: Thu Dec 31 1998 - 07:00:08 EST


>
> When I create Klasses.jar using jikes instead of javac, the Reflect.java
> test fails. This seems to be because jikes is marking (for example)
> every method in java.lang.System as final, because the whole class
> is final. Javac doesn't seem to do this.
>
> While functionally there should be no difference, in the Reflect
> test the javac compiled System class conatins non-final methods
> (which is what the test expects) while the jikes compiled System
> class contains final methods.
>
> Question then is, is there a stnadard for how the compiler is
> supposed to flag methods in a final class? And is kaffe's reflection
> code supposed to display either case the same way?
>
> That is, either one of the compilers is broken, or kaffe is broken,
> or the test itself is broken because it relies on javac.
>

 Hi,

I noticed that too and I checked the JLS, which says:

    A private method and all methods declared in a final class (8.1.2.2) are
    implicitly final, because it is impossible to override them. It is
    permitted but not required for the declarations of such methods to
    redundantly include the final keyword.

I assume that also means that it's permitted but not required for the
compiler to include a final attribute. I think the test is broken because
it assumes it one way and not the other. Maybe change it to use a non-final
class?

        - Godmar


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:57:27 EDT