[
https://issues.apache.org/jira/browse/XERCESJ-1573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13417371#comment-13417371
]
Jorge L. Williams commented on XERCESJ-1573:
--------------------------------------------
While it's true that a Validator is not thread safe, that doesn't mean that
you can't reuse one within a single thread of execution. In fact, Validators
are designed to be re-used as Michael stated in a previous email.
from the JavaDocs above -- in the definition of "reset"
"Validator is reset to the same state as when it was created with
Schema.newValidator(). reset() is designed to allow the reuse of existing
Validators thus saving resources associated with the creation of new
Validators."
I would also note that there are no thread safety issues with the example of
the validator being initialized outside of the loop -- since there is only a
single thread of execution.
> Possible memory leak when using assertions
> ------------------------------------------
>
> Key: XERCESJ-1573
> URL: https://issues.apache.org/jira/browse/XERCESJ-1573
> Project: Xerces2-J
> Issue Type: Bug
> Components: XML Schema 1.1 Datatypes
> Affects Versions: 2.11.0
> Reporter: Jorge L. Williams
> Priority: Blocker
> Attachments: XS11Validate.java, d1.png, d2.png, d3.png, d4.png,
> d5.png, d6.png, duration-sans-assert.xsd, duration.xsd, good.xml, mem.png
>
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]