Curtis, Thanks for the explanation. I have no idea what the "bytecode patching of ImageJ" is but it sounds like it is something of a death grip ImageJ moving forward with the times!
OOf course I understand that there will be lots of people who depend on Fiji so adding "implements AutoClosable" to ImagePlus will hardly be a priority. But on the other hand there has been a whole lot of progress with Java and the JVM since 1.6 and there are many worthwhile goodies that are being missed out on. parallel streams and perhaps increase performance and adopting graalVM polyglot could perhaps do the heavy lifting for multiple language support to name just two wins! All the best to everyone that is doing such an amazing job with ImageJ and Fiji On Fri, 22 Mar 2024 at 23:24, Curtis Rueden <[email protected]> wrote: > Hi Michael, > > > I had thought ImageJ's attachment to the antiquity of Java 1.6 had > > already been abandoned. > > A big part of the problem is Fiji's bytecode patching of ImageJ, which > currently only works when ij.jar is compiled targeting Java 1.6. > > See: https://github.com/imagej/ij1-patcher/issues/53 > > It is something I very much want to fix, but as always time is scarce. > > Regards, > Curtis > > On Fri, Mar 22, 2024 at 1:51 AM Michael Ellis <[email protected]> > wrote: > > > Wayne, > > > > Many thanks for the reply. > > > > ImagePlus implementing AutoCloseable is certainly not a show stopper. > > > > I had thought ImageJ's attachment to the antiquity of Java 1.6 had > already > > been abandoned. > > > > Is ImageJ for ever to be denied making use of new language/JVM features? > > > > Not a criticism, I understand the importance of long term stability and > > compatibility. > > > > As always, thank you for your reply. > > > > -- Michael Ellis > > > > On Fri, 22 Mar 2024, 02:57 Wayne Rasband, <[email protected]> wrote: > > > > > > On Mar 19, 2024, at 7:22 AM, Michael Ellis <[email protected]> > > > wrote: > > > > > > > > Would it be useful for ImagePlus to implement AutoClosable so it > could > > > be > > > > used with Java's try with resources syntax? > > > > > > It might be useful but the downside is some ImageJ users still use Java > > > 1.6 and the AutoCloseable interface requires Jave 1.7 or later. > > > > > > -wayne > > > > > > > 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 > > > > > > > -- > > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > > > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html
