Details
Description
QDox parser cannot will throw following exception when encounter annotation element value in double literal:
com.thoughtworks.qdox.parser.ParseException: syntax error @[971,96] at com.thoughtworks.qdox.parser.impl.Parser.yyerror(Parser.java:1594) ~[classes/:na] at com.thoughtworks.qdox.parser.impl.Parser.yyparse(Parser.java:1716) ~[classes/:na] at com.thoughtworks.qdox.parser.impl.Parser.parse(Parser.java:1575) ~[classes/:na] at com.thoughtworks.qdox.library.SourceLibrary.parse(SourceLibrary.java:205) ~[classes/:na] at com.thoughtworks.qdox.library.SourceLibrary.parse(SourceLibrary.java:162) ~[classes/:na] at com.thoughtworks.qdox.library.SourceLibrary.addSource(SourceLibrary.java:91) ~[classes/:na] at com.thoughtworks.qdox.library.SourceLibrary.addSource(SourceLibrary.java:86) ~[classes/:na] at com.thoughtworks.qdox.library.SortedClassLibraryBuilder.addSource(SortedClassLibraryBuilder.java:161) ~[classes/:na] at com.thoughtworks.qdox.JavaProjectBuilder.addSource(JavaProjectBuilder.java:173) ~[classes/:na] at gov.fia.tools.releaser.core.item.internal.QDoxUtils.loadJavaClass(QDoxUtils.java:66) ~[classes/:na] at gov.fia.tools.releaser.core.item.JavaItem.readMetadata(JavaItem.java:51) ~[classes/:na] ... 16 common frames omitted
Following is our code clip, the delta = 0.005 crashes QDox, while delta = 0.5 or delta = 0 will be ok:
@Field(id = "04") @Rule.List({ @Rule(code = "★171A021", asserts = "#07 != 0", matches = "#05 * #06 / #07", delta = 0.005, precondition = "@stkhAreAddMk == '1' && #07 != 0"), @Rule(code = "★171A022", asserts = "#09 != 0", matches = "#08 / #09", delta = 0.005, precondition = "@stkhAreAddMk == '2' && #09 != 0"), @Rule(code = "★171A023", asserts = "#09 != 0 && #11 != 0", matches = "(#08 / #09) + (#10 / #11)",delta = 0.005, precondition = "@stkhAreAddMk == '3' && #09 != 0 && #11 != 0") }) @Digits(fraction = 0, integer = 14) public BigDecimal getStkhAreAdd() { return prct049.getStkhAreAdd(); }
Activity
Pei-Tang Huang
made changes -
Field | Original Value | New Value |
---|---|---|
Attachment | lexer.flex.patch [ 61689 ] |
Robert Scholte
made changes -
Assignee | Robert Scholte [ rfscholte ] |
Robert Scholte
made changes -
Status | Open [ 1 ] | Resolved [ 5 ] |
Fix Version/s | 2.0 [ 15636 ] | |
Resolution | Fixed [ 1 ] |
This patch can resolve my problem.