Re: native methods and ClassLoaders

Li Gong (gong@games.eng.sun.com)
Mon, 13 Apr 1998 15:26:23 -0700

Date: Mon, 13 Apr 1998 15:26:23 -0700
Message-Id: <199804132226.PAA09416@games.eng.sun.com>
From: Li Gong <gong@games.eng.sun.com>
To: gback@fast.cs.utah.edu (Godmar Back)
Subject: Re: native methods and ClassLoaders
In-Reply-To: Godmar Back's mail of Mon, 13 April, 1998

All core/system classes are not supposed to be redefined. In other
words, in 1.1.5, everything present on CLASSPATH cannot be redefined.

Li

Godmar Back writes:
>
> Hi,
>
> this is a question concerning JDK 1.1.5.
>
> * Can a class defined by a class loader via defineClass have any
> native methods?
>
> * Clearly, some classes cannot be redefined(*): calling defineClass for
> java/lang/Object, for instance, will cause an "UnknownError" be thrown.
> Other classes, such as java.lang.Throwable cannot be redefined because
> then the verifier will find an athrow instruction doesn't throw a
> Throwable. I strongly suspect that java.lang.Class can't be
> redefined, either. Here's my question:
>
> Even though I read the JDK documentation, the language specification
> and the VM specification I could not find any statement telling me just
> exactly *what* classes can or cannot be redefined. Is this an oversight,
> or is this intentionally vague and left to the implementation?
>
> Thank you,
>
> Godmar (gback@cs.utah.edu)
>
> ps: please cc: me on the reply.
>
> (*) By "redefined" I mean to call defineClass with the bytes read from
> classes.zip.
>