Eric,
It should be possible to implement a constant pool sorter that will work directly with internal ClassWriter's structures.
Naive and inefficient implementation can sort constant pool on visitEnd() method and put result into new ClassWriter instance together with key hashes, then run collected class bytecode trough parse/write using that new ClassWriter instance with prebuilt constant pool.
regards, Eugene
BRUNETON Eric RD-MAPS-GRE wrote:
Henri Yandell wrote:
I like it, a bold statement :)
So, questions to the BCEL community.
1) Does BCEL have use-cases over ASM? I think Eugene's statement is a healthy, competitive one and it'd be good to hear if there's disagreement.
I think BCEL is needed only if you require very fine control over the constant pool (for example to sort these constants or to implement a kind of watermarking for Java class by arranging the constant pool in some specific way), since ASM does not provide access to it, by design. But these are really specific needs, and even then, there are indirect ways to do this with ASM (see links below).
For all other cases I agree with Eugene.
Eric
http://cvs.forge.objectweb.org/cgi-bin/viewcvs.cgi/asm/asm/src/org/objec tweb/asm/optimizer/
http://cvs.forge.objectweb.org/cgi-bin/viewcvs.cgi/asm/asm/src/org/objec tweb/asm/optimizer/Shrinker.java?rev=1.4&content-type=text/vnd.viewcvs-m arkup
------------------------------------------------------------------------
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]