On Mon, Jun 30, 2014 at 12:48 PM, Jody Garnett <[email protected]>
wrote:
> I am for it Andrea, a quick question - we did try and implement a close
> method previously to prep for Java 7 try-with-resource. Did they change the
> interface name on us - or am I missing something?
>
>From the java sources:
public interface Closeable extends AutoCloseable {
>
> -
> http://docs.codehaus.org/display/GEOTOOLS/Java+7+try-with-resource+compatibility
>
> In generally we should ensure all our "closable" things can work with
> try-with-resource. If we can do that in a consistent fashion all the better.
>
> Looks like AutoClosable has slight different meaning:* Note that unlike
> the close method of Closeable, this close method is not required to be
> idempotent. In other words, calling this close method more than once may
> have some visible side effect, unlike Closeable.close which is required to
> have no effect if called more than once. However, implementers of this
> interface are strongly encouraged to make their close methods idempotent.*
>
> So my understanding is Closable extends AutoClosable in order to
> explicitly throws an IOException (thus being obvious that data access is
> occurring). So yeah choose the appropriate interface and lets ensure we
> work with try-with-resource. For GridCoverageReader I expect Closable may
> be appropriate.
>
Works for me
Cheers
Andrea
--
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.
==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel