Bug 52464 - A combination of warning declaration and member introduction causes compiler to throw NullPointerException
Summary: A combination of warning declaration and member introduction causes compiler ...
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.1.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 1.2   Edit
Assignee: Andrew Clement CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-19 05:02 EST by Antti Karanta CLA
Modified: 2004-02-25 06:43 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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