Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] Problem with Introduction

I compiled the attached example and it works as expected.

-----Original Message-----
From: Pawel [mailto:_1234_@xxxxxxxxxxxx]
Sent: Thursday, March 27, 2003 5:44 PM
To: aspectj-users@xxxxxxxxxxx
Subject: Re: [aspectj-users] Problem with Introduction


I can't see you:( It doesn't work.
The aspect is compiled but it doesn't affect the class C. I think that all
paths are set correctly. All sources belong to a default package so there is
no need to import anything.
Pawel


----- Original Message -----
From: "Jackson, Stephen" <Stephen.Jackson@xxxxxxxxxxxxxxxx>
To: <aspectj-users@xxxxxxxxxxx>
Sent: Thursday, March 27, 2003 10:08 PM
Subject: RE: [aspectj-users] Problem with Introduction


> Try this.  Make sure your aspects imports the necessary classes or it will
> not be able to find them.
>
> public aspect A{
>   declare parents : C implements I
>   public interface I{}
>   public String I.testThis = "You can see Me";
> }
>
> -----Original Message-----
> From: Pawel [mailto:_1234_@xxxxxxxxxxxx]
> Sent: Thursday, March 27, 2003 3:34 PM
> To: aspectj-users@xxxxxxxxxxx
> Subject: [aspectj-users] Problem with Introduction
>
>
> I use aspectj 1.1 rc1
> I have:
>
> in a directory java
>
> public class C
> {
> }
>
> public interface I
> {
> }
>
> and in a directory aspects
>
> public aspect A
> {
>  declare parents: C implements I;
> }
>
> if i compile sources with:
>
> <iajc outjar="a.jar" classpath="${aspectjrt.jar}" verbose="off">
>   <sourceRoots>
>     <pathelement path="java" />
>     <pathelement path="aspects" />
>   </sourceRoots>
> </iajc>
>
> everything is ok but if i use (intoduction to a compiled class in a
> jar-file):
>
> <javac srcdir="java" destdir="classes" debug="on" optimize="off"
> deprecation="off" />
> <jar jarfile="c.jar" basedir="classes" />
> <iajc outjar="a.jar" injars="c.jar" classpath="${aspectjrt.jar}"
> verbose="off">
>   <sourceRoots>
>     <pathelement path="aspects" />
>   </sourceRoots>
> </iajc>
>
> the class C doesn't implement the interface I.
>
> Is that a compiler bug or it is not possible to make introductions to
> compiled classes?
> Perhaps the ant script is wrong?
>
> Pawel
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>

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

Attachment: C.java
Description: Binary data

Attachment: A.java
Description: Binary data


Back to the top