Closed original-codematrix closed 4 years ago
This is not the annotation package bug. This is how javadoc tool works when the annotation has multiple targets including TYPE_USE. E.g. for a class like this:
import java.lang.annotation.*;
@Documented
@Target({ElementType.TYPE_USE, ElementType.METHOD})
public @interface Test {
@Test String value() default "";
}
Generating javadoc (simply by invoking javadoc Test.java
) you will see duplicated annotation:
@Test
@Test java.lang.String value
You may consider reporting an issue to OpenJDK
JSR-305 works because it doesn't provide TYPE_USE target. You may use our annotations-java5 package as an alternativem it should work as well.
I'm using this dependency:
With this maven plugin:
When I now create a Javadoc of a class that contains e. g.
NotNull
orNullable
it results looks like this in the JavaDocs:All methods overview:
Method detail:
I've also switched to another annotation library (jsr305) from that these annotations are only shown once.