[Kaffe] ease of use patch.

Alex Blewitt Alex.Blewitt at ioshq.com
Wed Feb 24 08:50:57 PST 1999


On 24 Feb 1999, Alexandre Oliva wrote:

> On Feb 24, 1999, Alex Blewitt <Alex.Blewitt at ioshq.com> wrote:
> 
> > As an add-on to this argument, the Java Language Specification dictates
> > that you can't use any keywords ...
> 
> `java' is not a keyword, `class' is.  Nevertheless, this is all
> irrelevant: the question is whether `class' and `java' are valid class 
> names in terms of bytecode, not in terms of Java source.

True :-)

Actually, as far as the run-time system is concerned, it makes no
difference what the identifiers are provided that they are UNICODE
strings. They are just enterred into a hashtable and cross referenced;
provided that they are properly treated as unicode in there (which most
JVMs do) there is no problem with having bogus names.

Is this a psuedo protection for decompilers?

This is how inner classes were 'mangled' into the bytecode. They are
represented as OuterClass$InnerClass; the name is an illegal Java literal,
but works fine in the JVM itself.

Note that class names which use any unicode characters may have problems
when created as .class files, because they may not be represented on the
filing system correctly ...

Incidentally, inner classes are horrible IMHO and in order to achieve an
inner class, many 'friendly/local' variables are actually made
package-scope instead of private to allow intra-object access.

Alex.

/***************************************************************\
|*       Alex Blewitt       * Hug, and the world hugs with you *|
|*   Alex.Blewitt at iee.org   *                                  *|
|* Mobile: + 44 966 158647  *    Spread a little happiness     *|
\***************************************************************/




More information about the kaffe mailing list