As for poor documentation, I've never had too much of a problem with it. Sometimes I'm not totally sure what a method does, so I have to go look at the source (http://jakarta.apache.org/bcel/xref/index.html), which has always been pretty easy to read. Of course, you might want to read the manual (http://jakarta.apache.org/bcel/manual.html) if you're just starting out with bcel. You'll definitely also need to have a pretty good idea of what the jvm is all about or you'll have a rough time, which leads to the next point:
There's a method that's called when a class is first initialized called <clinit> (signature: "()V"). You can put your static variable initialization in there instead of putting it in every method. You can read all about this method and a whole lot of other stuff in the Sun's JVM Reference.
I'm reasonably certain that statement-level apis do not exist in bcel. We have something like them in Sandmark (www.cs.arizona.edu/sandmark), but we're not proud of that code and it doesn't work very well. It does kind of minimally work though. One way to figure out where statements end is to figure out where the stack height is 0. Sandmark also has a stack simulator that does this and a whole lot of other stuff, but i think the StackProducer and StackConsumer bcel apis might be sufficient. This is likely to do what you want for code produced by normal java compilers (although I haven't tried it), but is likely to fail badly for obfuscated/optimized code because intermediate results may be stored on the stack instead of saving to lvs and then reloading.
--
"I say to you that the VCR is to the American film
producer and the American public as the Boston
strangler is to the woman home alone."
-Jack Valenti, President, Motion Picture
Association of America, Inc., before
The House Subcommittee on Courts, Civil
Liberties, and The Administration of
Justice, August, 1982,
http://cryptome.org/hrcw-hear.htm
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
