Issue Details (XML | Word | Printable)

Key: QDOX-94
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Paul Hammant
Reporter: Adam B
Votes: 19
Watchers: 13
Operations

If you were logged in you would be able to see more operations.
QDox

Full Support for Processing Java 5 source

Created: 02/Dec/05 08:14 AM   Updated: 09/Jul/08 09:50 AM
Component/s: Java API, Parser, QDox-Attributes
Affects Version/s: 1.5
Fix Version/s: 1.6.2

Time Tracking:
Not Specified

File Attachments: 1. Text File jdk5_anno_support.patch (30 kB)

Environment: Any
Issue Links:
Duplicate
 
Related
 
dependent
 


 Description  « Hide
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.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Jimisola Laursen added a comment - 12/Jul/06 11:27 AM
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).


Grégory Joseph added a comment - 12/Jul/06 12:12 PM
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.


Jimisola Laursen added a comment - 11/Sep/06 12:20 PM
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


Bill Michell added a comment - 13/Sep/06 04:55 AM
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.


Brett Porter added a comment - 22/Dec/06 08:59 PM
this works (even the last example) on 1.6.1

Eric Redmond added a comment - 25/Jan/07 06:07 PM
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.


Paul Hammant added a comment - 03/Apr/07 12:26 AM
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?


Paul Hammant added a comment - 03/Apr/07 12:44 AM
Applied. After the Maven2 pom.xml in QDOX-111 it was easy to add coverage. 100% before, 100% after this patch.

Dennis Lundberg added a comment - 19/Feb/08 05:48 PM
Eric's patch was released in 1.6.3, right?
So, shouldn't this issue be closed now?

Dennis Lundberg added a comment - 08/Jul/08 10:55 AM
Fixed in r461.