You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bcel-dev@jakarta.apache.org by Matthijs Wensveen <mr...@wanadoo.nl> on 2004/10/19 09:20:32 UTC

BCEL ClassLoader

Hello,

I am not a member of the bcel-dev mailing list because I've only just 
begun using BCEL. I hope you don't mind me mailing directly to the list.

I was experimenting with the BCEL ClassLoader, trying to get it working 
as the default classloader without using a bootstrapping Main class.
It's possible to do this with the java.system.class.loader system 
property. The only thing is that the default deferTo variable of 
org.apache.bcel.util.ClassLoader is set to 
java.lang.ClassLoader.getSystemClassLoader(). This results in infinite 
recursion because java.lang.ClassLoader will try to instantiate 
org.apache.bcel.util.ClassLoader etc etc. This results in a 
IllegalStateException: recursive invokation
I think the solution is to set the default value for deferTo to 
getParent(), and have the constructors that get a deferTo parameter call 
super(deferTo) as the first statement.
Bootstrapping will still be possible but setting 
java.system.class.loader will also work correctly. I have already tested 
this and it works for me. However, I am very new to BCEL and I don't 
know what other consequences might be.

FYI, I want to use BCEL to make a AspectJ-like AOP implementation, but 
instead of defining new language constructs I want to use metadata 
annotations to define Aspects and Pointcuts. Also, I want the system to 
insert the aspect's code at runtime. I am just experimenting with some 
things right now.
If code samples are needed/wanted, I would be happy to provide them.

Best regards,
Matthijs Wensveen



---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-dev-help@jakarta.apache.org


Source code for a particular instruction

Posted by Raghu L <ra...@gmail.com>.
Hi,

  How to get source code from bytecode?. I tried
Utility.codeToString(...) but it only gives in JVM instructions. I
want source code for specific instruction(s) in the  byte code. Is
there any facility to do that without reverse engineering whole
bytecode?.

Thanx in advance.

Bye

---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-dev-help@jakarta.apache.org