Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] IDT in JDK classes (How to enable java..* weaving?)


I forget the ultimate outcome of this, but weaving into the JDK classes in any manner is not an easy task and there are some legal type restrictions on doing so.  You might want to search the archives of this list for this very discussion.

Ron DiFrango
Cap Tech Ventures, Inc (
Blog (

-----Original Message-----
From: aspectj-users-bounces@xxxxxxxxxxx on behalf of Alex Villazon
Sent: Fri 8/8/2008 11:01 AM
To: AspectJ developer discussions
Cc: aspectj-users@xxxxxxxxxxx
Subject: [aspectj-users] IDT in JDK classes (How to enable java..* weaving?)
   I'm trying to add an marker interface to JDK classes... If I use:

     declare parents: * && !java.lang.Object implements myInterface;

then, java.* classes are not woven, which is OK for loadtime weaving  
but should be enabled for static weaving...(as we would like also to  
weave JDK classes).

Curiously, classes in javax, com.sun get woven... and also if I  
explicitely give the class name of a java.* class e.g.

     declare parents: java.lang.String implements myInterface;  //  
works !!!

Is there a way to force the weaver to weave java.* classes? I tried

     declare parents: java..* && !java.lang.Object implements  

but does not work... (it simply ignores all classes in java and  
subpackages). I don't have any error message.

Curiously, if I use:

    declare parents: java.lang.* && !java.lang.Object implements  

I obtain errors about annotations and enums, which means that the  
weaver is at least trying to weave.. [error] can't use declare parents to make  
annotation type
   java.lang.Override implemt an interface

  Could anybody tell me how to disable this restriction? (e.g. using a  
correct declare parents expression, or on which class in the sources  
of aspectj I could look at, to make a patch that disables this  
restriction for compile time weaving..)

Many thanks,


aspectj-users mailing list

Back to the top