Would it be useful for ImagePlus to implement AutoClosable so it could be
used with Java's try with resources syntax?

Of course, the behaviour can be implemented by subclassing ImagePlus:

class ImagePlusAC extends ImagePlus implements AutoCloseable {

    public ImagePlusAC(String title, Image image) {
        super(title, image);
    }

   // And the other constructors
}

And that works nicely... but... I cannot see any obvious downside to
ImagePlus just being tagged as AutoClosable.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

Reply via email to