Class UnclosedReaderDetector


  • public class UnclosedReaderDetector
    extends WrappingXMLInputFactory
    XMLInputFactory wrapper that enabled detection of unclosed stream readers. An unclosed reader will be detected when the XMLStreamReader instance is finalized by the virtual machine. When this happens, a warning message will be logged. The log message contains the stack trace of the instruction that created the reader.

    Note that for this to work, the detector must compute the stack trace every time a reader is created. Since this may have a significant performance impact, the wrapper should only used during testing and debugging.

    • Constructor Detail

      • UnclosedReaderDetector

        public UnclosedReaderDetector​(XMLInputFactory parent)
        Constructor.
        Parameters:
        parent - the parent factory