Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r14193 r14202 33 33 import java.util.List; 34 34 import java.util.Map; 35 import java.util.Objects; 35 36 import java.util.Optional; 36 37 import java.util.concurrent.ForkJoinPool; … … 190 191 } 191 192 193 @Override 194 public int hashCode() { 195 return Objects.hash(order, osm, style, flags); 196 } 197 198 @Override 199 public boolean equals(Object obj) { 200 if (this == obj) 201 return true; 202 if (obj == null || getClass() != obj.getClass()) 203 return false; 204 StyleRecord other = (StyleRecord) obj; 205 return flags == other.flags 206 && order == other.order 207 && Objects.equals(osm, other.osm) 208 && Objects.equals(style, other.style); 209 } 210 192 211 /** 193 212 * Get the style for this style element. -
trunk/test/unit/org/openstreetmap/josm/data/coor/LatLonTest.java
r14201 r14202 36 36 * Lat/Lon sample values for unit tests 37 37 */ 38 @SuppressFBWarnings(value = "MS_MUTABLE_COLLECTION") 38 39 public static final List<Double> SAMPLE_VALUES = Arrays.asList( 39 40 // CHECKSTYLE.OFF: SingleSpaceSeparator -
trunk/test/unit/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRendererTest.java
r12078 r14202 7 7 import org.junit.Test; 8 8 import org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer.StyleRecord; 9 10 import nl.jqno.equalsverifier.EqualsVerifier; 11 import nl.jqno.equalsverifier.Warning; 9 12 10 13 /** … … 70 73 } 71 74 72 private long floatToFixedCheckBits(float number, int totalBits) { 75 private static long floatToFixedCheckBits(float number, int totalBits) { 73 76 long result = StyleRecord.floatToFixed(number, totalBits); 74 77 long shouldBeZero = result >> totalBits; … … 77 80 } 78 81 82 /** 83 * Unit test of methods {@link StyleRecord#equals} and {@link StyleRecord#hashCode}. 84 */ 85 @Test 86 public void testEqualsContract() { 87 EqualsVerifier.forClass(StyleRecord.class).usingGetClass() 88 .suppress(Warning.NONFINAL_FIELDS) 89 .verify(); 90 } 79 91 }
Note:
See TracChangeset
for help on using the changeset viewer.
