QDox
  1. QDox
  2. QDOX-153

Qdox fails to parse enums inside class

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9.1
    • Component/s: Parser
    • Labels:
      None
    • Number of attachments :
      0

      Description

      This bug is related to QDOX-144.

      The stack trace is this:

      [ERROR] FATAL ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] syntax error @[57,54] in file:/C:/GSOC/workspace/myfaces/current12-1/core
      /impl/src/main/java/org/apache/myfaces/el/unified/resolver/FacesCompositeELResol
      ver.java
      [INFO] ------------------------------------------------------------------------
      [INFO] Trace
      com.thoughtworks.qdox.parser.ParseException: syntax error @[57,54] in file:/C:/G
      SOC/workspace/myfaces/current12-1/core/impl/src/main/java/org/apache/myfaces/el/
      unified/resolver/FacesCompositeELResolver.java
      at com.thoughtworks.qdox.parser.impl.Parser.yyerror(Parser.java:987)
      at com.thoughtworks.qdox.parser.impl.Parser.yyparse(Parser.java:1293)
      at com.thoughtworks.qdox.parser.impl.Parser.parse(Parser.java:968)
      at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:31
      7)
      at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:34
      9)
      at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:34
      5)
      at com.thoughtworks.qdox.JavaDocBuilder$2.visitFile(JavaDocBuilder.java:
      435)
      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(Directory
      Scanner.java:43)
      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(Directory
      Scanner.java:34)
      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(Directory
      Scanner.java:34)
      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(Directory
      Scanner.java:34)
      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(Directory
      Scanner.java:34)
      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(Directory
      Scanner.java:34)
      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(Directory
      Scanner.java:34)
      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(Directory
      Scanner.java:34)
      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.scan(Directory
      Scanner.java:52)
      at com.thoughtworks.qdox.JavaDocBuilder.addSourceTree(JavaDocBuilder.jav
      a:432)
      at com.thoughtworks.qdox.JavaDocBuilder.addSourceTree(JavaDocBuilder.jav
      a:421)
      at org.apache.myfaces.buildtools.maven2.plugin.builder.qdox.QdoxModelBui
      lder.buildModel(QdoxModelBuilder.java:323)
      at org.apache.myfaces.buildtools.maven2.plugin.builder.qdox.QdoxModelBui
      lder.buildModel(QdoxModelBuilder.java:135)
      at org.apache.myfaces.buildtools.maven2.plugin.builder.BuildMetaDataMojo
      .buildModel(BuildMetaDataMojo.java:386)
      at org.apache.myfaces.buildtools.maven2.plugin.builder.BuildMetaDataMojo
      .execute(BuildMetaDataMojo.java:290)
      at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
      nManager.java:451)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
      ultLifecycleExecutor.java:558)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
      fecycle(DefaultLifecycleExecutor.java:499)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
      ltLifecycleExecutor.java:478)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
      dleFailures(DefaultLifecycleExecutor.java:330)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
      ts(DefaultLifecycleExecutor.java:291)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
      fecycleExecutor.java:142)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      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)
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 34 seconds
      [INFO] Finished at: Fri Mar 06 19:06:01 COT 2009
      [INFO] Final Memory: 41M/254M
      [INFO] ------------------------------------------------------------------------

      The file looks like this (just the important parts are included):

      package org.apache.myfaces.el.unified.resolver;

      public final class FacesCompositeELResolver extends org.apache.myfaces.el.CompositeELResolver
      {
      private final Scope _scope;

      public enum Scope

      { Faces, JSP }

      public FacesCompositeELResolver(final Scope scope)
      {
      if (scope == null)

      { throw new IllegalArgumentException("scope must not be one of " + Arrays.toString(Scope.values())); }

      _scope = scope;
      }

      ........

      Inner enums used inside the class fails. But this code:

      public final class FacesCompositeELResolver extends org.apache.myfaces.el.CompositeELResolver
      {
      private final Scope _scope;

      public enum Scope
      {

      { Faces, JSP }

      }

      Works correctly. It seems to be something wrong with the parser.

        Activity

        Hide
        Robert Scholte added a comment -

        Seems you found another issue considering the position of the enum and/or missing semicolon.
        Workarounds are: moving the enum to the bottom of the class or adding a semi-colon after JSP
        I've added a test for this issue in enumsTest

        Show
        Robert Scholte added a comment - Seems you found another issue considering the position of the enum and/or missing semicolon. Workarounds are: moving the enum to the bottom of the class or adding a semi-colon after JSP I've added a test for this issue in enumsTest
        Hide
        Robert Scholte added a comment -

        brace-resolving strategy has been improved. issue is now fixed.

        Show
        Robert Scholte added a comment - brace-resolving strategy has been improved. issue is now fixed.
        Robert Scholte made changes -
        Field Original Value New Value
        Fix Version/s 1.10 [ 15020 ]
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Paul Hammant made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Paul Hammant made changes -
        Resolution Fixed [ 1 ]
        Fix Version/s 1.9.1 [ 15252 ]
        Status Reopened [ 4 ] Closed [ 6 ]
        Fix Version/s 1.10 [ 15020 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Leonardo Uribe
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: