Community
Participate
Working Groups
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!
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.
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().
marked as target 1.2.1
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.
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
Fix released as part of AspectJ 1.2.1