Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 1.6
-
Fix Version/s: 1.8
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
It would seem QDox cannot parse a Java 5 file that has more than one annotation on a field and generics are present.
For example, this will parse fine:
import javax.xml.bind.annotation.XmlID; import java.util.List; public class Person { protected List<String> address; @XmlID protected String name; public List<String> getAddress() { return address; } public void setAddress(List<String> address) { this.address = address; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
But this will fail:
package org.openejb.alt.config.ejb; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.XmlID; import java.util.List; public class Person { protected List<String> address; @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlID protected String name; public List<String> getAddress() { return address; } public void setAddress(List<String> address) { this.address = address; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
.. with this error:
com.thoughtworks.qdox.parser.ParseException: syntax error @[16,38] in file:/Users/dblevins/work/openejb3/container/openejb-core/src/main/java/org/openejb/alt/config/ejb/Person.java
at com.thoughtworks.qdox.parser.impl.Parser.yyerror(Parser.java:607)
at com.thoughtworks.qdox.parser.impl.Parser.yyparse(Parser.java:715)
at com.thoughtworks.qdox.parser.impl.Parser.parse(Parser.java:588)
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.walk(DirectoryScanner.java:34)
at com.thoughtworks.qdox.directorywalker.DirectoryScanner.scan(DirectoryScanner.java:52)
at com.thoughtworks.qdox.JavaDocBuilder.addSourceTree(JavaDocBuilder.java:366)
Activity
Field | Original Value | New Value |
---|---|---|
Summary | Multiple annotations on one field | Multiple annotations on one field and generics |
Description | QDox cannot parse a Java 5 file that has more than one annotation on a field. |
It would seem QDox cannot parse a Java 5 file that has more than one annotation on a field and generics are present. For example, this will parse fine: {code} import javax.xml.bind.annotation.XmlID; import java.util.List; public class Person { protected List<String> address; @XmlID protected String name; public List<String> getAddress() { return address; } public void setAddress(List<String> address) { this.address = address; } public String getName() { return name; } public void setName(String name) { this.name = name; } } {code} But this will fail: {code} package org.openejb.alt.config.ejb; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.XmlID; import java.util.List; public class Person { protected List<String> address; @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlID protected String name; public List<String> getAddress() { return address; } public void setAddress(List<String> address) { this.address = address; } public String getName() { return name; } public void setName(String name) { this.name = name; } } {code} .. with this error: com.thoughtworks.qdox.parser.ParseException: syntax error @[16,38] in file:/Users/dblevins/work/openejb3/container/openejb-core/src/main/java/org/openejb/alt/config/ejb/Person.java at com.thoughtworks.qdox.parser.impl.Parser.yyerror(Parser.java:607) at com.thoughtworks.qdox.parser.impl.Parser.yyparse(Parser.java:715) at com.thoughtworks.qdox.parser.impl.Parser.parse(Parser.java:588) 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.walk(DirectoryScanner.java:34) at com.thoughtworks.qdox.directorywalker.DirectoryScanner.scan(DirectoryScanner.java:52) at com.thoughtworks.qdox.JavaDocBuilder.addSourceTree(JavaDocBuilder.java:366) |
Resolution | Fixed [ 1 ] | |
Fix Version/s | 1.8 [ 14826 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
double annotations on own seem to be ok with that in Svn presently
generics on own seem to be ok with that in Svn presently
together they make it barf.
See todo_testShouldNotChokeOnDoubleAttributeAnnotationAndGenerics() in AnnotationTestCase