Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Problems when I add a method to a class using AspectJ

Unlucky I need to add a method to get a new type of information that I have added to the bytecode.

Actually I have added this method to a new class called Method2, but add this method directly to the Method class should be a better solution.

Thanks for your help.


Dean Wampler <dean@xxxxxxxxxxxxxxxxxxxxx> ha scritto:
The meaning of this lint warning is briefly given in this thread:

http://dev.eclipse.org/mhonarc/lists/aspectj-dev/msg01420.html

In your case, AspectJ doesn't weave into the JDK libraries. This is partly because Sun's license does not permit modifications of the byte code. I'm not sure if AJ will let you "break" the license yourself by explicitly putting the "rt.jar" in the "-inpath". Even if it does, you would have to make sure that the newly-woven rt.jar is read first by the JVM when it boots.

Note that you can advise "call" joinpoints to Method's methods made from your code. Those calls don't require AJ to modify Method; your code is modified instead. Could you do that to meet your needs? (This approach won't catch other calls to Method from within other standard library code, however.)

dean

email_ricevute_da-aspectj@xxxxxxxx wrote:
I would like to add a method at the class java.lang.reflect.Method using AspectJ, but it doesn't work.
I used the following code:

    public String Method.ciao(){
        return "ciao";
    };

but I get the following warning:
   this affected type is not exposed to the weaver: java.lang.reflect.Method
   [Xlint:TypeNotExposedToWeawer]

I tryed to add a metod to a class that I have defined, and in that case it works.

I also tryed to add the .jar file with the java class to the AspectJ path, (c:\programmi\Java\jdk1.5.0_06\jre\lib\rt.jar) but I get an overflow error during the compilation.

Someone know how I can solve this problem?

Thanks for your help.

Bolletta salata? Passa a Yahoo! Messenger with Voice

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


-- 
Dean Wampler, Ph.D.
dean at aspectprogramming.com
http://www.aspectprogramming.com
http://www.contract4j.org I want my tombstone to say: Unknown Application Error in Dean Wampler.exe. Application Terminated. [Okay] [Cancel]
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Yahoo! Mail: gratis 1GB per i messaggi, antispam, antivirus, POP3

Back to the top