Bug 71076 - Missing Javadoc comments that aren't missing
Summary: Missing Javadoc comments that aren't missing
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.2.1 M1   Edit
Hardware: PC Windows XP
: P4 minor (vote)
Target Milestone: 1.2.1   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-29 09:58 EDT by Matt Chapman CLA
Modified: 2004-10-21 04:32 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 Matt Chapman CLA 2004-07-29 09:58:13 EDT
Reported in the AJDT newsgroup:

Go to Preferences > Java > Compiler > Javadoc and set "Missing javadoc comments"
to "Warning".

You then get warnings against things you wouldn't expect, such as after advice.

/**
 * A comment
 */
public aspect World {
	pointcut greeting() : execution(* Hello.sayHello(..));
	
	/**
	 * A comment
	 */
	after() returning : greeting() {
		System.out.println("world");
	}
}

This gives two warnings, one for the aspect itself, and one for the after
returning advice. The warnings occur both with and without the existence of
Javadoc comments!
Comment 1 Matt Chapman CLA 2004-07-29 11:07:19 EDT
ajdoc correctly uses the Javadoc comments, so the warning is valid when there is
no Javadoc comment, but of course the warning should go away when the Javadoc
comment is added.
Comment 2 Luzius Meisser CLA 2004-07-30 04:35:38 EDT
This is a compiler problem, it also happens when using the comand line.

An example aspect:

package p1;

  /**
   * comment
   */
  public aspect Aspect {
	/**
	 * comment2
	 */
	public pointcut myPC(): execution(* *(..));
	
	public void test(){}
  }


And what happens when compiled on command line:

  C:\Project>ajc -warn:allJavadoc -argfile .generated.lst
  C:\Project\src\p1\Aspect.aj:6 warning Javadoc: Missing comment for pu
  blic declaration
  public aspect Aspect {
                ^^^^^
  C:\Project\src\p1\Aspect.aj:10 warning Javadoc: Missing comment for p
  ublic declaration
  public pointcut myPC(): execution(* *(..));
                  ^^^^^^^^^^^^^^^^^^^^^^^^

  2 warnings


Note that the compiler believes that "comment2" belongs to the public method 
test().
Comment 3 Adrian Colyer CLA 2004-08-09 15:27:52 EDT
marked as target 1.2.1
Comment 4 Andrew Clement CLA 2004-08-18 06:21:34 EDT
To fix this I have modified our Parser class in the various consumeXXX() methods
so that they grab the recently parsed javadoc (the bug was that it was being
grabbed by the following declaration).  This had a knock on effect as I then got
complaints that some javadoc didn't include @param tags for things like
thisJoinPoint/etc which are automatically added as arguments to some generated
methods for advice.  The fix here was to change the piece of code that polices
it (Javadoc.resolveParamTags()) so that when the selector starts 'ajc$' (so its
a bit of advice or some other construct of ours) we don't report missing @param
warnings for:
- thisJoinPoint
- thisJoinPointStaticPart
- thisEnclosingJoinPointStaticPart
- Anything starting ajc$
- Anything containing the words 'AroundClosure'

There are possibly some cases I've missed but it should behave much better now !

fix about to be checked in - will close when (if???) build succeeds.
Comment 5 Andrew Clement CLA 2004-08-18 11:36:25 EDT
Fix available:

BUILD COMPLETE -  build.345
Date of build: 08/18/2004 15:01:23
Time to build: 94 minutes 39 seconds
Last changed: 08/18/2004 14:29:30
Latest good AspectJ jar available at:
download.eclipse.org/technology/ajdt/dev/aspectj-DEVELOPMENT.jar
Comment 6 Adrian Colyer CLA 2004-10-21 04:32:38 EDT
Fix released as part of AspectJ 1.2.1