AutoCloseable XMLStreamReader and XMLStreamWriter?

Philippe Marschall kustos at gmx.net
Tue May 28 19:44:54 UTC 2013



On 27.05.2013 10:40, Alan Bateman wrote:
> On 26/05/2013 12:04, Philippe Marschall wrote:
>> Hi
>>
>> It would be nice if javax.xml.stream.XMLStreamReader and
>> javax.xml.stream.XMLStreamWriter could be made to extend
>> java.lang.AutoCloseable so that they can be used in a
>> try-with-resouces statement. The some does for XMLEventReader and
>> XMLEventReader.
> I don't recall if this one has come up before (there were lots of
> candidates identified for retrofitting when AutoCloseable was added) but
> the XML APIs have the complication that they are a "Standalone
> Technology".

Yes and JEP-185 doesn't make it less confusing.

> I don't know how far back JSR-206/173 needs to be support
> but if you retrofit these interfaces to extend AutoCloseable then it
> would rule out usage with jdk6. Joe Wang might know about about this.

Is he watching this list or should I contact him otherwise?

Cheers
Philippe



More information about the core-libs-dev mailing list