QDox
  1. QDox
  2. QDOX-132

inner enum definition not handled properly by parser

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Parser
    • Labels:
      None
    • Environment:
      qdox being used within the maven-maven-plugin (version 2.3)
    • Number of attachments :
      1

      Description

      The qdox parser is not able to correctly handle the following inner enum definition:

      private static enum Position

      { START, END, BOTH }

      The reason appears to be that the parser is expecting semi-colons, which are not needed here. Adding the unnecessary semi-colons allows to work around the issue:

      private static enum Position

      { START, END, BOTH; }

      The error actually comes back 'misleading' because it is complaining about the code after this definition. But making this change to my code worked around the bug. Here is the stack for the error:

      com.thoughtworks.qdox.parser.ParseException: syntax error @[744,56] in file:/Users/steve/projects/jboss/dev/maven/maven-plugins/trunk/maven-jdocbook-plugin/src/main/java/org/jboss/jgettext/xml/XmlHandlerImpl.java
      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:316)
      at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:312)
      at com.thoughtworks.qdox.JavaDocBuilder$1.visitFile(JavaDocBuilder.java:369)
      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:43)
      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34)
      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34)
      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34)
      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34)
      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34)
      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.scan(DirectoryScanner.java:52)
      at com.thoughtworks.qdox.JavaDocBuilder.addSourceTree(JavaDocBuilder.java:366)
      at org.apache.maven.tools.plugin.extractor.java.JavaMojoDescriptorExtractor.execute(JavaMojoDescriptorExtractor.java:544)
      at org.apache.maven.tools.plugin.scanner.DefaultMojoScanner.populatePluginDescriptor(DefaultMojoScanner.java:84)
      at org.apache.maven.plugin.plugin.AbstractGeneratorMojo.execute(AbstractGeneratorMojo.java:135)
      at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:447)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
      at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

        Activity

        Hide
        Dennis Lundberg added a comment -

        Strange, The attached file doesn't parse with 1.5, but it works with 1.6 and 1.6.1. However maven-plugin-plugin-2.3 for Java plugins uses QDox 1.6.1.

        Show
        Dennis Lundberg added a comment - Strange, The attached file doesn't parse with 1.5, but it works with 1.6 and 1.6.1. However maven-plugin-plugin-2.3 for Java plugins uses QDox 1.6.1.
        Hide
        Robert Scholte added a comment -

        QDOX-138 and QDOX-144 both refer to the same problem. A fix is already pathed so I'll close this issue

        Show
        Robert Scholte added a comment - QDOX-138 and QDOX-144 both refer to the same problem. A fix is already pathed so I'll close this issue
        Robert Scholte made changes -
        Field Original Value New Value
        Resolution Duplicate [ 3 ]
        Assignee Robert Scholte [ rfscholte ]
        Status Open [ 1 ] Resolved [ 5 ]

          People

          • Assignee:
            Robert Scholte
            Reporter:
            Steve Ebersole
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: