[ https://jira.codehaus.org/browse/QDOX-240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=296742#comment-296742 ]
Robert Scholte commented on QDOX-240: ------------------------------------- With [rev. 1492|http://fisheye.codehaus.org/changelog/qdox/?cs=1492] [rev. 1493|http://fisheye.codehaus.org/changelog/qdox/?cs=1493] the parsing problems of the testcases have been solved. I still have to make them part of the model, so sources can be regenerated. I leave this issue open until that is fixed too. > Enum constructors with new Object Instances or method calls fail with a > parser exception > ---------------------------------------------------------------------------------------- > > Key: QDOX-240 > URL: https://jira.codehaus.org/browse/QDOX-240 > Project: QDox > Issue Type: Bug > Components: Parser > Affects Versions: 2.0-alpha > Environment: Java 6, qdox-2.0-alpha-1 > Reporter: Robert Reiner > > I try to parse enumerations with constants that call a constructor/method, > but it fails with a parse error. > I'm using qdox-2.0-alpha-1. These are the two test cases that fail: > ========== > 1. Calling a constructor: > {code} > package simpleenum; > import java.util.Date; > public enum MinimalEnumExampleConstructor > { > D_CONSTRUCTOR(new Date()); // FAILS to be parsed > private final Date date; > private MinimalEnumExampleConstructor(final Date date) > { > this.date = date; > } > } > {code} > {{Parse error: com.thoughtworks.qdox.parser.ParseException: syntax error > @\[7,21\] in file\:/\[snipped\]/MinimalEnumExampleConstructor.java}} > ========== > 2. Calling a method (probably the same root cause) > {code} > package simpleenum; > import java.util.Date; > public enum MinimalEnumExampleMethod > { > D_METHOD(create()); // FAILS to be parsed > private final Date date; > private MinimalEnumExampleMethod(final Date date) > { > this.date = date; > } > public static Date create() > { > return new Date(); > } > } > {code} > {{Parse error: com.thoughtworks.qdox.parser.ParseException: syntax error > @\[7,19\] in file\:/\[snipped\]/MinimalEnumExampleMethod.java}} > ========== > If I define a constant (e.g. for the Date instance above), the parsing > completes successfully: > {code} > public enum EnumExample ... { > D_CONSTANT(X.Y); // parsing successful > ... > } > public class X { > public static final Date Y = new Date(); > } > {code} > {{SUCCESS}} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email