QDox
  1. QDox
  2. QDOX-97

Parser fails on attribute with annotations

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.6
    • Component/s: Parser
    • Labels:
      None
    • Testcase included:
      yes
    • Number of attachments :
      2

      Description

      The parser does not handle annotated attributes like the following

      public interface Foo {
      String echo(@WebParam java.lang.String msg);
      }

      1. Enum3.java
        2 kB
        Geert Schuring
      2. qdox.patch
        2 kB
        Guillaume Nodet

        Activity

        Hide
        Joe Walnes added a comment -

        Committed. Thanks.

        Show
        Joe Walnes added a comment - Committed. Thanks.
        Joe Walnes made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Samanth added a comment -

        I am using QDox 1.6. I am facing the similar kind of issue with hibernate annotations..

        /**

        • @hibernate.key-property column="policynumber" length="14"
          */
          @NotNull
          @Length(min=1, max=14)
          public String getPolicyNumber() { return this.policyNumber; }
        Show
        Samanth added a comment - I am using QDox 1.6. I am facing the similar kind of issue with hibernate annotations.. /** @hibernate.key-property column="policynumber" length="14" */ @NotNull @Length(min=1, max=14) public String getPolicyNumber() { return this.policyNumber; }
        Hide
        Geert Schuring added a comment -

        I've attached a file that the parses generates the following exception for:

        com.thoughtworks.qdox.parser.ParseException: syntax error @[30,45] in file:/C:/Users/geert/workspace/nl.interact911.ipds.ipds-connector-visystem/src/main/java/vigateway/Enum3.java
        at com.thoughtworks.qdox.parser.impl.Parser.yyerror(Parser.java:999)
        at com.thoughtworks.qdox.parser.impl.Parser.yyparse(Parser.java:1305)
        at com.thoughtworks.qdox.parser.impl.Parser.parse(Parser.java:980)
        at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:330)
        at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:362)
        at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:358)
        at com.thoughtworks.qdox.JavaDocBuilder$2.visitFile(JavaDocBuilder.java:448)
        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.scan(DirectoryScanner.java:52)
        at com.thoughtworks.qdox.JavaDocBuilder.addSourceTree(JavaDocBuilder.java:445)
        at com.thoughtworks.qdox.JavaDocBuilder.addSourceTree(JavaDocBuilder.java:434)
        at org.apache.felix.scrplugin.tags.JavaClassDescriptorManager.<init>(JavaClassDescriptorManager.java:155)
        at org.apache.felix.scrplugin.SCRDescriptorMojo.execute(SCRDescriptorMojo.java:155)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        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: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)

        Show
        Geert Schuring added a comment - I've attached a file that the parses generates the following exception for: com.thoughtworks.qdox.parser.ParseException: syntax error @ [30,45] in file:/C:/Users/geert/workspace/nl.interact911.ipds.ipds-connector-visystem/src/main/java/vigateway/Enum3.java at com.thoughtworks.qdox.parser.impl.Parser.yyerror(Parser.java:999) at com.thoughtworks.qdox.parser.impl.Parser.yyparse(Parser.java:1305) at com.thoughtworks.qdox.parser.impl.Parser.parse(Parser.java:980) at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:330) at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:362) at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:358) at com.thoughtworks.qdox.JavaDocBuilder$2.visitFile(JavaDocBuilder.java:448) 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.scan(DirectoryScanner.java:52) at com.thoughtworks.qdox.JavaDocBuilder.addSourceTree(JavaDocBuilder.java:445) at com.thoughtworks.qdox.JavaDocBuilder.addSourceTree(JavaDocBuilder.java:434) at org.apache.felix.scrplugin.tags.JavaClassDescriptorManager.<init>(JavaClassDescriptorManager.java:155) at org.apache.felix.scrplugin.SCRDescriptorMojo.execute(SCRDescriptorMojo.java:155) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60) 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: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)
        Geert Schuring made changes -
        Attachment Enum3.java [ 45675 ]
        Hide
        Robert Scholte added a comment -

        Like the issue says: it's already resolved. I've tested the file and qdox-1.10 has no problem with it.
        So it's more likely the srcplugin needs to upgrade to a newer version of QDox. I don't think adding this dependency to the plugin will solve it, because the model has changed a bit and isn't fully backwards compatible.
        I would suggest to create an issue at http://issues.apache.org/jira/browse/Felix

        Show
        Robert Scholte added a comment - Like the issue says: it's already resolved. I've tested the file and qdox-1.10 has no problem with it. So it's more likely the srcplugin needs to upgrade to a newer version of QDox. I don't think adding this dependency to the plugin will solve it, because the model has changed a bit and isn't fully backwards compatible. I would suggest to create an issue at http://issues.apache.org/jira/browse/Felix
        Robert Scholte made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Guillaume Nodet
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: