Project: AspectJ
Bug 148727 Can't call synthetic aspectOf method on aspect in library jar
Reported: 2006-06-26 16:46:03 | Status: resolved fixed

Separate compilation of the following program breaks on 1.5.2rc1 because of the recent change to marking aspect methods as synthetic: public aspect Asp { } public class Client { public static void main(String argz[]) { System.out.println("Can call aspectOf? "+Asp.aspectOf()); } } C:\devel\scratch\synthetic>ajc -classpath asp.jar;%CLASSPATH% Client.java C:\devel\scratch\synthetic\Client.java:3 [error] The method aspectOf() is undefi ned for the type Asp System.out.println("Can call aspectOf? "+Asp.aspectOf()); 1 error C:\devel\scratch\synthetic>javac -classpath asp.jar;%CLASSPATH% Client.java Client.java:3: cannot find symbol symbol : method aspectOf() location: class Asp System.out.println("Can call aspectOf? "+Asp.aspectOf()); ^ 1 error Clearly it's vital that external users of a library be able to call API methods like aspectOf on library aspects. This works: C:\devel\scratch\synthetic>ajc *.aj Client.java C:\devel\scratch\synthetic>java Client Can call aspectOf? Asp@b89838 Patch with test integrated into CVS tree to follow...

Files changed in fix:
tests/bugs152/pr148727/Client.java tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java weaver/src/org/aspectj/weaver/NameMangler.java