Skip to main content

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

Alex,

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 (http://www.captechventures.com)
Blog (http://www.captech-soa.blogspot.com)


-----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?)
 
Hi,
   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  
myInterface;

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  
myInterface;

I obtain errors about annotations and enums, which means that the  
weaver is at least trying to weave..

   MyAspect.java:34 [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,

Alex







  
   
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users



Back to the top