Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] declare parents problem with non-public classes?


Hi Keven,

I believe this is fixed in the current AspectJ codebase (we hope to release it as AspectJ 1.2.1 shortly).
I tried your program, got the warning on 1.2 and then no warning on the latest build of AJ.

If you want to download it now, we always keep the most recent good build at:

http://download.eclipse.org/technology/ajdt/dev/aspectj-DEVELOPMENT.jar

The build at this location has always passed the entire test suite for AspectJ, the most recent is from
13:46 today.

regards,
Andy.
---
Andy Clement
AspectJ/AJDT



Keven Ring <keven@xxxxxxxxx>
Sent by: aspectj-dev-admin@xxxxxxxxxxx

15/10/2004 16:46

Please respond to
aspectj-dev@xxxxxxxxxxx

To
aspectj-dev@xxxxxxxxxxx
cc
Subject
[aspectj-dev] declare parents problem with non-public classes?





I'm running into problems using declare parents on non-public classes.  
When the code below is compiled, it runs fine (as expected).  If,
however, the package declaration is uncommented, and the declares parent
is changed to the currently commented out line, then AJC reports the
following:

RunnableAspect.aj:2 warning no match for this type name:
mypackage$MyClass$MyInnerClass [Xlint:invalidAbsoluteTypeName]
     [ajc] declare parents: mypackage.MyClass$MyInnerClass implements
Runnable;
     [ajc]                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^


If the inner-class is defined as "public", then there is no problem with
the compilation.

If the inner-class is moved outside of "MyClass", but defined in the
same java file, the compilation fails as well.

This suggests that there is a problem with declare parents and
non-public classes.  Is this known/expected?  If not, I'll be happy to
file a bug report.  I'm using the AspectJ 1.2.

Thanks!

<MyClass.java>

// package mypackage;

public class MyClass {
 public MyClass() {
   MyInnerClass mic = new MyClass.MyInnerClass();
   if (mic instanceof Runnable)
     mic.run();
 }

 class MyInnerClass {
   public void run() {
     System.out.println("In MyInnerClass.run()!!");
   }
 }

 public static void main(String args[]) {
   new MyClass();
 }
}

</MyClass.java>

<RunnableAspect.aj>
public aspect RunnableAspect {
 declare parents: MyClass$MyInnerClass implements Runnable;
 // declare parents: mypackage.MyClass$MyInnerClass implements Runnable;
}
</RunnableAspect.aj>

--
Keven Ring               | "Oh no,  Not Again..."
The MITRE Corporation    |   Bowl of Petunias -
7515 Colshire Drive      |   The Hitchhikers Guide to the Galaxy
McLean VA 22102-7508     |
PH: (703)883-7026        |



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


Back to the top