Details
Description
QDox will fail with an ArrayIndexOutOfBoundsException if classes or interfaces are nested beyond 9 levels.
We were able to get around the problem by simply modifying the JFlexLexer to have a larger array size. We have provided a patch that increases this array size to 50. Perhaps it should be even larger if the size of the allocation is not very worrisome.
java.lang.ArrayIndexOutOfBoundsException: 10
at com.thoughtworks.qdox.parser.impl.JFlexLexer.pushState(JFlexLexer.java:781)
at com.thoughtworks.qdox.parser.impl.JFlexLexer.yylex(JFlexLexer.java:1350)
at com.thoughtworks.qdox.parser.impl.JFlexLexer.lex(JFlexLexer.java:769)
at com.thoughtworks.qdox.parser.impl.Parser.yylex(Parser.java:1004)
at com.thoughtworks.qdox.parser.impl.Parser.yyparse(Parser.java:1284)
at com.thoughtworks.qdox.parser.impl.Parser.parse(Parser.java:999)
at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:353)
at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:381)
at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:377)
at com.thoughtworks.qdox.JavaDocBuilder$2.visitFile(JavaDocBuilder.java:467)
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:464)
at com.thoughtworks.qdox.JavaDocBuilder.addSourceTree(JavaDocBuilder.java:453)
Activity
Field | Original Value | New Value |
---|---|---|
Status | Open [ 1 ] | Closed [ 6 ] |
Assignee | Robert Scholte [ rfscholte ] | |
Fix Version/s | 2.0 [ 15636 ] | |
Resolution | Fixed [ 1 ] |
If you need a larger depth then 10, you should really think of refactoring this code when possible (I'm wondering what Sonar would say). I don't like the idea to just push it to 50 "because you can".
I think it should be possible to add a qdox.properties on the classpath, where you can specify some values if the defaults don't work for you.