[dna-issues] [JBoss JIRA] Updated: (DNA-526) IllegalStateException calling TokenStream.canConsume(String str) after consuming all tokens via canConsume(String[])
Randall Hauch (JIRA)
jira-events at lists.jboss.org
Wed Nov 25 10:07:30 EST 2009
[ https://jira.jboss.org/jira/browse/DNA-526?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Randall Hauch updated DNA-526:
------------------------------
Fix Version/s: 0.7
Affects Version/s: 0.7
Assignee: Barry LaFond
> IllegalStateException calling TokenStream.canConsume(String str) after consuming all tokens via canConsume(String[])
> --------------------------------------------------------------------------------------------------------------------
>
> Key: DNA-526
> URL: https://jira.jboss.org/jira/browse/DNA-526
> Project: DNA
> Issue Type: Bug
> Components: Common
> Affects Versions: 0.7
> Reporter: Barry LaFond
> Assignee: Barry LaFond
> Fix For: 0.7
>
> Attachments: dna-common_DNA_526.patch
>
>
> While parsing, I wished to call canConsume() for multiple "optional" properties. Some are "multi-string" using canConsume("xxxx", "xxxx", ....)
> If a previous canConsume() had finished parsing the tokens (i.e. currentToken == NULL), then a subsequent canConsume("xxxx") would result in the following exception:
> java.lang.IllegalStateException: The 'start()' method must be called before tokens can be consumed or matched
> at org.jboss.dna.common.text.TokenStream.currentToken(TokenStream.java:1160)
> at org.jboss.dna.common.text.TokenStream.matches(TokenStream.java:866)
> at org.jboss.dna.common.text.TokenStream.canConsume(TokenStream.java:609)
> at ....
> It appears that the canConsume( <MULTIPLE> ) methods do NOT call moveToNextToken() which is currently the only method that sets this.completed = TRUE.
> Fix would be to add: this.completed = this.currentToken == NULL before returning on the canConsume( <MULTIPLE> ) methods.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the dna-issues
mailing list