jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • QDox
  • QDOX-118

Annotation parsing fails on enum constant when javadoc present

  • Log In
  • Views
    • XML
    • Word
    • Printable

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

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

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Hide
    Zip Archive
    qdox-anno-bug.zip
    24/May/07 4:19 PM
    2 kB
    Rune Flobakk
    1. File
      BogusEnum.class 0.8 kB
    2. Java Source File
      BogusEnum.java 0.1 kB
    3. File
      MyAnno.class 0.1 kB
    4. Java Source File
      MyAnno.java 0.0 kB
    5. File
      TestJavaDocBuilder.class 0.7 kB
    6. Java Source File
      TestJavaDocBuilder.java 0.6 kB
    Download Zip
    Show
    Zip Archive
    qdox-anno-bug.zip
    24/May/07 4:19 PM
    2 kB
    Rune Flobakk

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Rune Flobakk added a comment - 26/May/07 5:50 PM

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 - 26/May/07 5:50 PM Bug still present in release 1.6.2 Also tried snapshot 1.7-20070515.134713-1 with no luck.
Hide
Permalink
Robert Scholte added a comment - 10/Mar/09 5:40 PM

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

Show
Robert Scholte added a comment - 10/Mar/09 5:40 PM Bug fixed. Also added a test to EnumsModelTest based on the provided case

People

  • Assignee:
    Robert Scholte
    Reporter:
    Rune Flobakk
Vote (2)
Watch (2)

Dates

  • Created:
    24/May/07 4:19 PM
    Updated:
    05/May/09 10:25 AM
    Resolved:
    05/May/09 10:25 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.