Changeset 33133 in osm for applications
- Timestamp:
- 2017-01-30T23:41:59+01:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/alignways
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/alignways/build.xml
r32680 r33133 14 14 <property name="plugin.icon" value="images/alignways.png"/> 15 15 <property name="plugin.link" value="https://wiki.openstreetmap.org/wiki/JOSM/Plugins/AlignWayS"/> 16 <property name="plugin.canloadatruntime" value="true"/> 16 17 17 18 <!-- ** include targets that all plugins have in common ** --> -
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysSegment.java
r32921 r33133 13 13 import java.util.Collection; 14 14 import java.util.HashSet; 15 import java.util.Objects; 15 16 16 17 import org.openstreetmap.josm.Main; … … 114 115 @Override 115 116 public int hashCode() { 116 final int prime = 31; 117 int result = 1; 118 result = prime * result + ((segment == null) ? 0 : segment.hashCode()); 119 result = prime * result 120 + ((segmentColor == null) ? 0 : segmentColor.hashCode()); 121 return result; 117 if (segment == null) { 118 return System.identityHashCode(this); 119 } 120 121 // hashCode and equals should be consistent during the lifetime of this segment, 122 // otherwise the temporary mapview overlay will not be properly removed on destroy() 123 return segment.hashCode(); 122 124 } 123 125 124 @Override 125 public boolean equals(Object obj) { 126 if (this == obj) 127 return true; 128 if (obj == null) 129 return false; 130 if (!(obj instanceof AlignWaysSegment)) 131 return false; 132 AlignWaysSegment other = (AlignWaysSegment) obj; 133 if (segment == null) { 134 if (other.segment != null) 135 return false; 136 } else if (!segment.equals(other.segment)) 137 return false; 138 /* Segment colour is ignored in comparison 139 if (segmentColor == null) { 140 if (other.segmentColor != null) 141 return false; 142 } else if (!segmentColor.equals(other.segmentColor)) 143 return false; 144 */ 145 return true; 146 } 126 @Override 127 public boolean equals(Object o) { 128 if (this == o) return true; 129 if (!(o instanceof AlignWaysSegment)) return false; 130 AlignWaysSegment that = (AlignWaysSegment) o; 131 return Objects.equals(segment, that.segment); 132 } 133 147 134 }
Note:
See TracChangeset
for help on using the changeset viewer.