Bug 290624 - Spurious Javadoc Warnings for pointcuts
Summary: Spurious Javadoc Warnings for pointcuts
Status: RESOLVED FIXED
Alias: None
Product: AJDT
Classification: Tools
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 minor (vote)
Target Milestone: 2.0.2   Edit
Assignee: AJDT-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-26 07:50 EDT by Oliver CLA
Modified: 2009-10-06 23:23 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 Oliver CLA 2009-09-26 07:50:12 EDT
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3
Build Identifier: I20090611-1540

I had activated the "Missing Javadoc tags" in the preferences (Java > Compiler > Javadoc). I get warning about the missing javadoc in the following advice:


public aspect SopAspect extends AbstractSopAspect {

    /**
     * Look at the whole code to detect System.out violation
     * (except main methods)
     */
    public pointcut applicationCode() :
    	within(*..*)
    	&& !withincode(
    	        /** e.g. for the hello-world example System.out is ok */
    	        public static void *..*.main(String[]))
    	;

    /**
     * You can suppress the System.out warning by the annotation
     * <code>@SuppressSystemOutWarning</code>.
     */
    public pointcut allowedCode() :
    	@within(SuppressSystemOutWarning)
    	|| @withincode(SuppressSystemOutWarning)
    	;

}


I get a Javadoc warning ("Missing comment for public declaration") in the second pointcut. The problem seems to be the joinput "within(public static void main ...)". When I comment out this pointcut like


...
    public pointcut applicationCode() :
    	within(*..*)
//    	&& !withincode(
//    	        /** e.g. for the hello-world example System.out is ok */
//    	        public static void *..*.main(String[]))
    	;
...


the javadoc warning does not appear in the second pointcut.

Unfortunately the javadoc warnings cannot be disabled for aspects. If you enable the javadoc warnings for Java you see the warnings also in the aspects.

Reproducible: Always

Steps to Reproduce:
1. create an aspect with "within(public ...")
2. enable Javadoc warnings for missing comments
3.
Comment 1 Andrew Eisenberg CLA 2009-09-30 14:37:43 EDT
Move to the 2.0.2 release.
Comment 2 Andrew Eisenberg CLA 2009-10-06 22:51:23 EDT
There are two problems here.  The first is an AspectJ compiler problem (maybe a problem with the parser, I'll raise a new bug for that).  This is the bug that you originally filed, but since it is a compiler problem, it should go under AspectJ.

The other problem is that there are spurious warnings being placed on the 'pointcut' keyword when the "missing javadoc tags" option is enabled.  What is happening here is that the editor parses the pointcut as a method declaration and considers 'pointcut' to be a return type.  This shows up as an editor warning, but not in the problems view.
Comment 3 Andrew Eisenberg CLA 2009-10-06 22:55:40 EDT
See bug 291550.
Comment 4 Andrew Eisenberg CLA 2009-10-06 23:23:04 EDT
Fixed and committed changes.  Note that bug 291550 has not been addressed.