Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8222091

Javadoc does not handle package annotations correctly on package-info.java

    Details

    • Subcomponent:
    • Introduced In Version:
      12
    • Resolved In Build:
      b24
    • CPU:
      x86_64
    • OS:
      linux

      Backports

        Description

        ADDITIONAL SYSTEM INFORMATION :
        Tested on linux

        A DESCRIPTION OF THE PROBLEM :
        Package annotation on package-info.java is not properly processed

        REGRESSION : Last worked in version 11

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        See complete example on github

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        Javadoc processing completed without problems. This works in java 11.
        ACTUAL -
        Javadoc is reporting two errors:

        /home/cigaly/workspace/bug12/src/main/java/test/package-info.java:1: error: unknown tag: NamedQuery
        @NamedQuery(name = "q1", query = "select something from somwhere where anything>1")
        ^
        /home/cigaly/workspace/bug12/src/main/java/test/package-info.java:1: error: bad use of '>'
        @NamedQuery(name = "q1", query = "select something from somwhere where anything>1")
                                                                                       ^
        2 errors

        ---------- BEGIN SOURCE ----------
        Complete simplified example is on github at https://github.com/cigaly/bug12

        package-info.java:

        @NamedQuery(name = "q1", query = "select something from somwhere where anything>1")
        package test;

        import test.annotation.NamedQuery;

        NamedQuery.java annotation:

        package test.annotation;

        import java.lang.annotation.Retention;
        import java.lang.annotation.Target;

        import static java.lang.annotation.ElementType.PACKAGE;
        import static java.lang.annotation.ElementType.TYPE;
        import static java.lang.annotation.RetentionPolicy.RUNTIME;

        @Target({ TYPE, PACKAGE })
        @Retention(RUNTIME)
        public @interface NamedQuery {

            String name();

            String query();

        }

        ---------- END SOURCE ----------

        FREQUENCY : always


          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  hannesw Hannes Wallnoefer
                  Reporter:
                  webbuggrp Webbug Group
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: