Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] Some minor changes to the code?

Hi!

The test cases for the class loader aren't yet in a state for
contribution. So
in general I would contribute the classloader to the project. But today
seems to
be a bit too early. Sorry!


I'm looking forward to seeing your weaving class loader implementation.  We knew that the new bytecode weaving architecture should enable this functionality, but it will be very nice to see working code.  I'll make your small requested changes.  I might do some additional refactoring to avoid code duplication.

This mailing list is definitely the right forum for discussing these kinds of patches, so I'm very glad you brought this up here in addition to submitting the patch to bugzilla.


Okay, than here is an additional issue with the classloader that explains my implementation of "weaveWithoutDump" inside BcelWeaver (see bug no. 30794).

I can think of two different versions of a weaving class loader. The first one is simple and just weaves classes at loading time. In addition to that the second version (which is more important to me) gives me information whether a class has changed or not by the weaving process. Ideally it gives me information which aspects got woven into the class that is currently being loaded (via a hook method or some kind of observer, which might end up with a more complicated implementation to avoid recursive class loading).

So the first step for me was to implement the method "weaveWithoutDump" in a way that it returns a reference to LazyClassGen in the case the weaver has changed the class, null otherwise. This is slightly different from the original "weave" implementation where the LazyClassGen object is always returned by the method (if it is not synthetic).

A better version of the "weaveWithoutDump" method would be an implementation that provides information which aspects got woven into the class (or none if the class remains unchanged). That would allow me to announce this information within the weaving class loader which would be pretty nice.

Best regards,
Martin












Back to the top