Bug 388779 - Illegal argument exception on invalid Declare annotation
Summary: Illegal argument exception on invalid Declare annotation
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: IDE (show other bugs)
Version: 1.7.0   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-04 14:06 EDT by Andrew Eisenberg CLA
Modified: 2012-09-04 14:06 EDT (History)
0 users

See Also:


Attachments

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