QDox
  1. QDox
  2. QDOX-94

Full Support for Processing Java 5 source

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: 1.6.2
    • Labels:
      None
    • Environment:
      Any
    • Number of attachments :
      1

      Description

      After lots of searching through the qdox documentation and issue tracker, I can't find any plans to support Java 5 source files. This is definitely a major need since more and more organizations are switching to Java 5. Since qdox is the foundation for other important tools (such as xdoclet2), it seems to me that qdox has to provide full parsing support for Java 5 soon so that other tools can be updated.

      Having full support for the Java 5 model would mean a fair amount of similarity/duplication with Sun's Annotation Processing Tool and eventually JSR-269. Perhaps qdox could eventually be an implementation of JSR-269?

      The biggest need I see is to be able to access Java 5 Annotations. Perhaps there can also be an abstraction over Java 5 annotations and qdox annotations. That way tools like xdoclet2 could provide a simpler migration for end users by supporting both styles of annotation.

      I apologize if this is a duplicate issue. However, I couldn't find any references to plans for full Java 5 support.

        Issue Links

          Activity

          Carlos Sanchez made changes -
          Field Original Value New Value
          Link This issue is related to MPLUGIN-1 [ MPLUGIN-1 ]
          Hide
          Jimisola Laursen added a comment -

          This one hit me today as well.. Quite frustrating though.. Is there are work-around?

          If I understood the dependencies right XDoclet uses QDox and I know that there is a patch for XDoclet to handle Java 1.5 (annotations, generics etc).

          Show
          Jimisola Laursen added a comment - This one hit me today as well.. Quite frustrating though.. Is there are work-around? If I understood the dependencies right XDoclet uses QDox and I know that there is a patch for XDoclet to handle Java 1.5 (annotations, generics etc).
          Hide
          Grégory Joseph added a comment -

          FYI, XDoclet2 uses a specific snapshot dated from 20051211.114207
          ( http://dist.codehaus.org/generama/jars/qdox-20051211.114207.jar ) which has only partial support for java5. (It does not support enums with constructors and/or methods for instance)

          I don't think it'd be much work to add support for it for someone with experience with grammars - which is not me atm - as long as we don't need it in the model. Adding "real" support in the qdox model would probably be more difficult.

          Show
          Grégory Joseph added a comment - FYI, XDoclet2 uses a specific snapshot dated from 20051211.114207 ( http://dist.codehaus.org/generama/jars/qdox-20051211.114207.jar ) which has only partial support for java5. (It does not support enums with constructors and/or methods for instance) I don't think it'd be much work to add support for it for someone with experience with grammars - which is not me atm - as long as we don't need it in the model. Adding "real" support in the qdox model would probably be more difficult.
          Hide
          Jimisola Laursen added a comment -

          Thought that it would be of interest here - QDOX 1.6 has been released!

          http://joe.truemesh.com/blog//000642.html

          1.6 released

          This new release is a stop-gap release. Highlights include:

          • Switched to Apache 2.0 license.
          • Parser can now deal with Java 5 source code (annotations, generics, enums, var args, etc).
          • Numerous bugfixes.

          This should be enough for existing projects to carry on using it with Java 5 code.

          The next release will focus on making Java 5 specific features available in the API. Stay tuned.

          August 15, 2006

          Show
          Jimisola Laursen added a comment - Thought that it would be of interest here - QDOX 1.6 has been released! http://joe.truemesh.com/blog//000642.html 1.6 released This new release is a stop-gap release. Highlights include: Switched to Apache 2.0 license. Parser can now deal with Java 5 source code (annotations, generics, enums, var args, etc). Numerous bugfixes. This should be enough for existing projects to carry on using it with Java 5 code. The next release will focus on making Java 5 specific features available in the API. Stay tuned. http://qdox.codehaus.org/ qdox-1.6.jar Getting started August 15, 2006
          Hide
          Bill Michell added a comment -

          Looks like support isn't perfect.

          The following annotation is used as a sample in the annotations tutorial at http://java.sun.com/docs/books/tutorial/java/javaOO/annotations.html

          @SuppressWarnings(

          {"unchecked", "deprecation"}

          )

          However, if you use it in a source file, you get a com.thoughtworks.qdox.parser.ParseException: syntax error

          Looks like the comma is upsetting it.

          Show
          Bill Michell added a comment - Looks like support isn't perfect. The following annotation is used as a sample in the annotations tutorial at http://java.sun.com/docs/books/tutorial/java/javaOO/annotations.html @SuppressWarnings( {"unchecked", "deprecation"} ) However, if you use it in a source file, you get a com.thoughtworks.qdox.parser.ParseException: syntax error Looks like the comma is upsetting it.
          Hide
          Brett Porter added a comment -

          this works (even the last example) on 1.6.1

          Show
          Brett Porter added a comment - this works (even the last example) on 1.6.1
          Hide
          Eric Redmond added a comment -

          This patch adds Java 5+ annotation support. It adds support for parsing as well as creating/extracting the annotations, annotation types and the parameter names and their values (just returnes a String, assumes the set values are constants... types - e.g. String.class must be converted manually by the consumer).

          I also updated the lexer, parser, and annotation tests.

          Show
          Eric Redmond added a comment - This patch adds Java 5+ annotation support. It adds support for parsing as well as creating/extracting the annotations, annotation types and the parameter names and their values (just returnes a String, assumes the set values are constants... types - e.g. String.class must be converted manually by the consumer). I also updated the lexer, parser, and annotation tests.
          Eric Redmond made changes -
          Attachment jdk5_anno_support.patch [ 25401 ]
          Hide
          Paul Hammant added a comment -

          The patch is pretty extensive. It does have changes to Junit tests, thus is far more likely to be applied.

          However, we have no coverage reports, and I think this is essential prior to applying something this big.

          Joe?

          Show
          Paul Hammant added a comment - The patch is pretty extensive. It does have changes to Junit tests, thus is far more likely to be applied. However, we have no coverage reports, and I think this is essential prior to applying something this big. Joe?
          Hide
          Paul Hammant added a comment -

          Applied. After the Maven2 pom.xml in QDOX-111 it was easy to add coverage. 100% before, 100% after this patch.

          Show
          Paul Hammant added a comment - Applied. After the Maven2 pom.xml in QDOX-111 it was easy to add coverage. 100% before, 100% after this patch.
          Hide
          Dennis Lundberg added a comment -

          Eric's patch was released in 1.6.3, right?
          So, shouldn't this issue be closed now?

          Show
          Dennis Lundberg added a comment - Eric's patch was released in 1.6.3, right? So, shouldn't this issue be closed now?
          Hide
          Dennis Lundberg added a comment -

          Fixed in r461.

          Show
          Dennis Lundberg added a comment - Fixed in r461.
          Dennis Lundberg made changes -
          Assignee Paul Hammant [ paul ]
          Fix Version/s 1.6.2 [ 14091 ]
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]
          Dennis Lundberg made changes -
          Link This issue is duplicated by QDOX-108 [ QDOX-108 ]
          Benjamin Bentmann made changes -
          Link This issue is depended upon by MDOCCK-12 [ MDOCCK-12 ]

            People

            • Assignee:
              Paul Hammant
              Reporter:
              Adam B
            • Votes:
              19 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: