Bug 388779

Summary: Illegal argument exception on invalid Declare annotation
Product: [Tools] AspectJ Reporter: Andrew Eisenberg <andrew.eisenberg>
Component: IDEAssignee: aspectj inbox <aspectj-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 1.7.0   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Andrew Eisenberg CLA 2012-09-04 14:06:07 EDT
Getting an illegal argument exception for AspectJ code with a bad pointcut.  

In org.aspectj.org.eclipse.jdt.core.dom.ASTConverter.convert(ASTNode[]) around line 1020, there is a statement: 
    					typeDecl.bodyDeclarations().add(convert(false, nextMethodDeclaration));

Please change this to:

    Declare declareDecl = convert(false, nextMethodDeclaration);
    if (declareDecl != null;
      typeDecl.bodyDeclarations().add(declareDecl);
    }


Here is the aspect causing the trouble:

package asp;

public aspect Asp {
	declare @constructor : call(static public void main.Main.new(..)) : @Deprecated; 
}