Project: AspectJ
Bug 117681 VerifyError when using annotations to define inter-type annotation
Reported: 2005-11-23 04:27:13 | Status: resolved fixed

Using Sun JDK1.5.0_04 Audit.java public interface Audit { public String getLastUpdatedBy(); public void setLastUpdatedBy(String un); } AuditImpl.java public class AuditImpl implements Audit { private String lastUpdatedBy; public String getLastUpdatedBy() { return lastUpdatedBy; } public void setLastUpdatedBy(String un) { lastUpdatedBy = un; } } TestAspect.java import org.aspectj.lang.annotation.*; Test.java @Aspect public class TestAspect { @DeclareParents("Test") public static Audit introduced = new AuditImpl(); } public class Test { public static void main(String[] args) { Test t = new Test(); Audit a = (Audit)t; a.setLastUpdatedBy("username"); System.out.println("Username ="+a.getLastUpdatedBy()); } } files.lst Audit.java AuditImpl.java TestAspect.java Test.java Compiled using the following command d:\aspectj1.5\bin\ajc -classpath "d:\aspectj1.5\lib\aspectjrt.jar" -argfi le files.lst -1.5 d:\aspectj1.5\bin\aj5 Test Exception in thread "main" java.lang.VerifyError: (class: Test, method: setLastUpdatedBy signature: (Ljava/lang/String;)V) Incompatible argument to function d:\aspectj1.5\bin\aj5 -noverify Test Username=

Files changed in fix:
tests/bugs150/pr117681/Audit.java tests/bugs150/pr117681/AuditImpl.java tests/bugs150/pr117681/MoodIndicator.java tests/bugs150/pr117681/Test.java tests/bugs150/pr117681/TestAspect.java tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java