As you might know, CtClass#writeFile() dumps
the contents of the class file. If you want to
do source-level debugging with the code generated
by Javassist, I have to extend Javassist a bit.
What kind of source-level debugging do your users
want? Do they want to see inserted code or newly
As an example, what would be nice if Javassist would write the code-markup text to a temporary file and add line number information for its code that pointed to that file, so that a debugger (such as Eclipse) could step through the "source".
Currently, when users step into a method dynamically generated using Javassist, they get pretty much nothing ... there's no source to see!
The advantage of Javassist, that the markup text you write is very close to Java language, should be exploited for this purpose.
Oh ... and both Tapestry and HiveMind don't modify existing sources, they always create new classes entirely (often as enhanced subclasses of existing, user-provided classes). I can see that trying to do what I suggest for full-bore AOP would be a great challenge, but for new classes created from "whole cloth", I think it is approachable (but should be an runtime selectable option).
OK, that's a good (and reasonable) suggestion.
Although I would not be able to implement it
very soon, I definitely put this to my Todo list.
We need some recruits for Javassist. With JDK 1.5 coming up you're gonna need it.
For meta data and generics?
I'm in the middle of the annotation stuff for the meta data. There's not that much more to do but I've been finding it hard to fit it in over the last week.
Sorry, forgot to add that I'm not looking at the compiler part yet, just the class info side of things.
Kevin, chiba means for metadata and generics for JDK 1.5. FYI, all, Kevin is working on an doclet tag -> attribute compiler. TO put doclet tags into .class files. A.K.A jsr-175 for JDK 1.4 and lower.
Yep, I know. I was just letting him know that I am already working on some changes to javassist to support the metadata attributes in the class info stuff.
I was originally wrapping the javassist classes but decided that it made more sense to do it properly and add the support for this directly into the javassist code.