Changeset 9371 in josm for trunk/src/org/openstreetmap/josm/command/RotateCommand.java
- Timestamp:
- 2016-01-09T23:20:37+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/RotateCommand.java
r9243 r9371 5 5 6 6 import java.util.Collection; 7 import java.util.Objects; 7 8 8 9 import org.openstreetmap.josm.data.coor.EastNorth; … … 93 94 @Override 94 95 public int hashCode() { 95 final int prime = 31; 96 int result = super.hashCode(); 97 result = prime * result + ((pivot == null) ? 0 : pivot.hashCode()); 98 long temp; 99 temp = Double.doubleToLongBits(rotationAngle); 100 result = prime * result + (int) (temp ^ (temp >>> 32)); 101 temp = Double.doubleToLongBits(startAngle); 102 result = prime * result + (int) (temp ^ (temp >>> 32)); 103 return result; 96 return Objects.hash(super.hashCode(), pivot, startAngle, rotationAngle); 104 97 } 105 98 106 99 @Override 107 100 public boolean equals(Object obj) { 108 if (this == obj) 109 return true; 110 if (!super.equals(obj)) 111 return false; 112 if (getClass() != obj.getClass()) 113 return false; 114 RotateCommand other = (RotateCommand) obj; 115 if (pivot == null) { 116 if (other.pivot != null) 117 return false; 118 } else if (!pivot.equals(other.pivot)) 119 return false; 120 if (Double.doubleToLongBits(rotationAngle) != Double.doubleToLongBits(other.rotationAngle)) 121 return false; 122 if (Double.doubleToLongBits(startAngle) != Double.doubleToLongBits(other.startAngle)) 123 return false; 124 return true; 101 if (this == obj) return true; 102 if (obj == null || getClass() != obj.getClass()) return false; 103 if (!super.equals(obj)) return false; 104 RotateCommand that = (RotateCommand) obj; 105 return Double.compare(that.startAngle, startAngle) == 0 && 106 Double.compare(that.rotationAngle, rotationAngle) == 0 && 107 Objects.equals(pivot, that.pivot); 125 108 } 126 109 }
Note:
See TracChangeset
for help on using the changeset viewer.