jakarta-bcel-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Schneider" <schne...@lathanda.de>
Subject RE: strange line of code in ObjectType constructor
Date Fri, 25 Oct 2002 21:12:27 GMT

> -----Original Message-----
> From: David Hovemeyer [mailto:daveho@cs.umd.edu] 
> Sent: Friday, October 25, 2002 10:28 PM
> To: bcel-user@jakarta.apache.org
> Subject: strange line of code in ObjectType constructor
[...]
> class_name.replace('.', '/') + ";");
[...]
> What is the meaning of the second line of code?  It looks
> useless, because '/' is not a legal character in a class name.
> Or am I missing something?
BCEL is a bytecode editing package and the bytecode classname contain
'/'.
for example Object is refered as 
	Ljava/lang/Object;

Other mail:
Class names always include the full qualified package.
As long as we are talking about bytecode there is nothing ambigous about
it.

Innerclasses are refered with $. The '.' notation is only for
sourcecode.
The point is, that inner classes don't exist on bytecode level anymore.
Inner classes are transformed to a normal class with $ in it's name.
If A has an inner class B the name of B in bytecode is
A$B. The access rights that inner classes need are realized by adding
access methods with protected access rights.

I'm quiet sure you never will be able to load an inner class with A.B.
It will not be found.

Peter


--
To unsubscribe, e-mail:   <mailto:bcel-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:bcel-user-help@jakarta.apache.org>


Mime
View raw message