Project: AspectJ
Bug 49657 Weaver results in rt error if affected base class not exposed
Reported: 2004-01-07 17:27:35 | Status: resolved fixed

I was weaving a 3rd party library and wrote an aspect that should affect both a base class and a derived class, but inadvertently wove only the derived class. This resulted in the following error. I would like the weaver to catch this kind of error at weave (link) time, rather than creating code that results in a rt error... I get this error in 1.1.1 final and in a fairly recent version from CVS HEAD: java.lang.AbstractMethodError at ajee.logging.LogManager.ajc$interMethodDispatch1 $ajee_logging_LogManager$ajee_logging_Loggable$getLogger(LogManager.java) at ajee.tracing.ExecutionTracer.ajc$before$ajee_tracing_ExecutionTracer$926 (ExecutionTracer.java:62) at library.Derived.<init>(Derived.java:46) This line is a call to super(); I've attached a small example that reproduces another error that I think is related: C:\devel\test\ctors\twoPass>build C:\devel\test\ctors\twoPass>call ajc -outjar fullBase.jar sample\Base.java sampl e\Derived.java Exception in thread "main" java.lang.ExceptionInInitializerError at sample.Derived.<init>(Derived.java:6) at sample.Derived.main(Derived.java:13) Caused by: org.aspectj.lang.NoAspectBoundException at sample.Trace.aspectOf(Trace.aj) at sample.Trace.<init>(Trace.aj:5) at sample.Trace.ajc$postClinit(Trace.aj) at sample.Trace.<clinit>(Trace.aj:5) ... 2 more

Files changed in fix:
org.aspectj.ajdt.core/testdata/partialHierarchy/sample/Base.java org.aspectj.ajdt.core/testdata/partialHierarchy/sample/Derived.java org.aspectj.ajdt.core/testdata/partialHierarchy/sample/Iface.java org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/AjdtBatchTests.java org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/PartiallyExposedHierarchyTestCase.java weaver/src/org/aspectj/weaver/ResolvedTypeX.java weaver/src/org/aspectj/weaver/WeaverMessages.java weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java