imglib / imglib2-roi

Regions of interest (ROIs) and labelings for ImgLib2
Other
8 stars 8 forks source link

.equals() methods of RealTransformUnaryCompositeRealMaskRealInterval behaves strange #69

Open tischi opened 9 months ago

tischi commented 9 months ago

@tpietzsch @bogovicj

Within the class RealTransformUnaryCompositeRealMaskRealInterval I found this issue:

image

As you can see in the lower part of the screenshot this and obj are in fact the same Java objects. Nevertheless the .equals() method returns false.

Is this a bug or could it be an error on my side?

tpietzsch commented 9 months ago

This is a bug, definitely. Not on your side.

tpietzsch commented 9 months ago

I think to fix it, it would be good to go through all the .equals() methods in this package and look at what they are actually supposed to do... Does the javadoc already say something about the intented behaviour? Then maybe find the "top-most" interfaces regarding intented behaviour (CompositeMaskPredicate? UnaryCompositeMaskPredicate?) and add static equals methods there that can be called from the implementations?