QDox
  1. QDox
  2. QDOX-118

Annotation parsing fails on enum constant when javadoc present

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.9.1
    • Component/s: Parser
    • Labels:
      None
    • Environment:
      Java 1.5.0_07 on Windows XP
    • Testcase included:
      yes
    • Number of attachments :
      1

      Description

      I got a ParseException from qdox when building a maven plugin project. After some searching and fiddling, I believe to have isolated a bug in qdox v1.6.1. It seems to having trouble with parsing annotations for enum constants that are also documented using javadoc syntax.

      This code generates the ParserException:

      TestEnum.java
         public enum TestEnum
         {
             /**
              * Blah blah
              */
             @MyAnno
             TEST;
         }
      

      and the stacktrace (got from running from a standalone test program):

      Exception in thread "main" com.thoughtworks.qdox.parser.ParseException: syntax error @[6,5] in UNKNOWN SOURCE
              at com.thoughtworks.qdox.parser.impl.Parser.yyerror(Parser.java:638)
              at com.thoughtworks.qdox.parser.impl.Parser.yyparse(Parser.java:747)
              at com.thoughtworks.qdox.parser.impl.Parser.parse(Parser.java:619)
              at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:300)
              at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:290)
              at Tester.main(Tester.java:13)

      The syntax error is a the start of the annotation.

      I have attached a JUnit testcase that reproduces the error. Make sure to include qdox v1.6.1 on classpath. Hope I got all covered now

        Activity

        Hide
        Rune Flobakk added a comment -

        Bug still present in release 1.6.2
        Also tried snapshot 1.7-20070515.134713-1 with no luck.

        Show
        Rune Flobakk added a comment - Bug still present in release 1.6.2 Also tried snapshot 1.7-20070515.134713-1 with no luck.
        Hide
        Robert Scholte added a comment -

        Bug fixed. Also added a test to EnumsModelTest based on the provided case

        Show
        Robert Scholte added a comment - Bug fixed. Also added a test to EnumsModelTest based on the provided case
        Robert Scholte made changes -
        Field Original Value New Value
        Assignee Robert Scholte [ rfscholte ]
        Resolution Fixed [ 1 ]
        Fix Version/s 1.10 [ 15020 ]
        Status Open [ 1 ] Closed [ 6 ]
        Paul Hammant made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Paul Hammant made changes -
        Fix Version/s 1.9.1 [ 15252 ]
        Fix Version/s 1.10 [ 15020 ]
        Resolution Fixed [ 1 ]
        Status Reopened [ 4 ] Closed [ 6 ]

          People

          • Assignee:
            Robert Scholte
            Reporter:
            Rune Flobakk
          • Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: