Ticket #20598: 20598.3.patch

File 20598.3.patch, 1.8 KB (added by taylor.smock, 5 years ago)

Fix ImageEntryTest.testEqualsContract

  • src/org/openstreetmap/josm/gui/layer/geoimage/ImageEntry.java

     
    105105
    106106    @Override
    107107    public int hashCode() {
    108         return Objects.hash(super.hashCode(), thumbnail);
     108        return Objects.hash(super.hashCode(), thumbnail, dataSet);
    109109    }
    110110
    111111    @Override
  • test/unit/org/openstreetmap/josm/gui/layer/geoimage/ImageEntryTest.java

     
    44import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    66import java.io.File;
     7import java.util.ArrayList;
    78
    89import org.junit.jupiter.api.Test;
    910import org.openstreetmap.josm.TestUtils;
     11import org.openstreetmap.josm.data.ImageData;
    1012import org.openstreetmap.josm.data.gpx.GpxImageEntry;
    1113
    1214import nl.jqno.equalsverifier.EqualsVerifier;
     
    3436    void testEqualsContract() {
    3537        TestUtils.assumeWorkingEqualsVerifier();
    3638        EqualsVerifier.forClass(ImageEntry.class).usingGetClass()
    37             .suppress(Warning.NONFINAL_FIELDS)
    38             .withPrefabValues(GpxImageEntry.class, new GpxImageEntry(new File("foo")), new GpxImageEntry(new File("bar")))
     39          .suppress(Warning.NONFINAL_FIELDS)
     40          .withPrefabValues(GpxImageEntry.class,
     41            new GpxImageEntry(new File("foo")),
     42            new GpxImageEntry(new File("bar")))
     43          .withPrefabValues(ImageData.class, new ImageData(), new ImageData(new ArrayList<>()))
    3944            .verify();
    4045    }
    4146}