Re: [Geoserver-devel] API changes to add AutoCloseable for try-with-resources

2018-06-04 Thread Erik Merkle
A small caveat to my suggestion about default methods. Apparently default methods on interfaces is a Java 8 thing. So it is not a viable option if running with an older version. Erik Merkle Software Engineer | Boundless On Mon, Jun 4,

Re: [Geoserver-devel] API changes to add AutoCloseable for try-with-resources

2018-06-04 Thread Ben Caradoc-Davies
Erik, we require Java 8 for all supported branches. Interface default methods are on the table. Kind regards, Ben. On 05/06/18 12:54, Erik Merkle wrote: A small caveat to my suggestion about default methods. Apparently default methods on interfaces is a Java 8 thing. So it is not a viable op

Re: [Geoserver-devel] API changes to add AutoCloseable for try-with-resources

2018-06-04 Thread Ben Caradoc-Davies
Eric, that is an interesting idea but I suspect it would introduce silent resource leaks. Unless we have a default implementation that calls the deprecated dispose() method? In any case, just like constructors and virtual destructors in C++, there in an intimate relationship between a close()

Re: [Geoserver-devel] API changes to add AutoCloseable for try-with-resources

2018-06-04 Thread Erik Merkle
I don't believe I have a vote here, but I wanted to add that you could provide a default implementation on any GeoServer Interfaces to which you want to add AutoCloseable. That would get around the compile issue, and I believe the backward compatibility compile issue is exactly why Java added the d

Re: [Geoserver-devel] API changes to add AutoCloseable for try-with-resources

2018-06-04 Thread Chris Snider
Ben, Something to potentially consider regarding interfaces; While changing the signatures of existing interfaces will break the API, you could do one of two things: 1. copy the current interface wholesale and change the name to include a digit i.e. MyInterface => MyInterface1 Where the new int