Bug 52464

Summary: A combination of warning declaration and member introduction causes compiler to throw NullPointerException
Product: [Tools] AspectJ Reporter: Antti Karanta <Antti.Karanta>
Component: CompilerAssignee: Andrew Clement <aclement>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.1.1   
Target Milestone: 1.2   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Antti Karanta CLA 2004-02-19 05:02:21 EST
Try to compile this (causes NullPointerException with ajc 1.1.1):


public class SampleClass {
  public static void main(String[] args) {
    System.out.println("Hello");
  }
}

aspect SampleAspect {
  declare warning : args(int) : "Watch out!";
  public void SampleClass.aMethod(int x) {}
}
Comment 1 Adrian Colyer CLA 2004-02-19 10:04:49 EST
This appears to be related to the NPE in bug 51320 caused when a context based 
pointcut is used in a declare error / warning statement.
Comment 2 Andrew Clement CLA 2004-02-25 06:43:27 EST
Fixed in 51320, the test program (if entirely captured in a file 
SampleClass.java) now compiles with:

C:\Eclipse\212\eclipse\aspectj_ws\tests\bugs>ajc SampleClass.java
C:\Eclipse\212\eclipse\aspectj_ws\tests\bugs\SampleClass.java:8 args() pointcut
designator cannot be used in declare statement

1 error