Community
Participate
Working Groups
My problem is similar to bug #73507, but I have different request. If you make attempt to weave private methods into target classes, the method names are mangled. I understand why you'd want to mangle them (to avoid collisions), but is there a way to turn it off (possibly via system property)? We are attempting weave in a custom writeObject(ObjectOutputStream) method implementation for java serialization. The java 1.4 spec requires this method to be declared private. It looks for the existence of this private method and invokes it if it exists. Unfortunately, because the method name is mangled, it doesn't find the method by its appropriate name. We're doing something like the following: aspect X { private writeObject(ObjectOutputStream out) { } }
Sorry about that, committed prematurely. Let me finish the description: We're doing something like the following: aspect X { private writeObject(ObjectOutputStream out) { ... } } When you weave this into target classes, the name of the private methods is something like: "ajc$interMethodDispatch2 $com_wily_util_persistence_perst_PersistenceAspect$writeObject" This is clearly not recognized by the java serialization code as the writeObject method. Is there anyway to customize the mangling or to turn it off? -Shawn
As discussed on the list, you could use Externalizable in this case? AspectJ has no plans to allow customization of its internal code generation strategies in the near future (quite probably ever). Also, a private ITD means private with respect to the aspect, not private with respect to the target type. I'm going to close this report out - the Java class library design in this area should be in a public hall of shame somewhere, but we're not going to do unnatural things to AspectJ to work around it!