ome / bioformats

Bio-Formats is a Java library for reading and writing data in life sciences image file formats. It is developed by the Open Microscopy Environment. Bio-Formats is released under the GNU General Public License (GPL); commercial licenses are available from Glencoe Software.
https://www.openmicroscopy.org/bio-formats
GNU General Public License v2.0
370 stars 241 forks source link

Strings are being compared with == and != #4184

Closed scuniff closed 2 weeks ago

scuniff commented 2 months ago

2 occurrences where 2 Strings are being compared with == and !=.

They should be using String.equals()

https://github.com/ome/bioformats/blob/6fa35f6deb652ac34e3bb2fba5b8b694481d3585/components/formats-bsd/src/loci/formats/gui/PreviewPane.java#L218

https://github.com/ome/bioformats/blob/6fa35f6deb652ac34e3bb2fba5b8b694481d3585/components/formats-bsd/src/loci/formats/gui/PreviewPane.java#L263

should be?

Line 218 if (id.equals(lastId)) continue; Line 263 if (!id.equals(loadId)) {

joshmoore commented 2 months ago

Thanks, as ever, @scuniff