Not so.  '$' is a legal identifier character, so I can compile a non-inner
class as follows:

class X$Y {}

In order to detect inner classes in the VM (or in a compiler when reading
.class files), you MUST read the attributes, rather than relying on the
naming convention in the inner class specification.

It would be nice if Sun would give compilers a guaranteed namespace that
cannot conflict with user identifiers, but that has not happened yet...


Original message:
 Thu, 2 Aug 2001 11:22:54 +0200 (MET DST)

The inner class "Y" of class "X" is compiled as "X$Y".
So if a class name contains "$", it must be an innerclass.


This is documentend in the Innerclass specification,
http://java.sun.com/products/jdk/1.1/docs/guide/innerclasses/spec/innerclass
es.doc.html
in section "Class Name Transformation"
http://java.sun.com/products/jdk/1.1/docs/guide/innerclasses/spec/innerclass
es.doc7.html

-Patrik

--
Eric Blake, Elixent, Castlemead, Lwr Castle St., Bristol BS1 3AG, UK
[EMAIL PROTECTED]   tel:+44(0)117 917 5611


_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath

Reply via email to