Changeset 9371 in josm for trunk/src/org/openstreetmap/josm/command/ChangeRelationMemberRoleCommand.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/ChangeRelationMemberRoleCommand.java
r9067 r9371 5 5 6 6 import java.util.Collection; 7 import java.util.Objects; 7 8 8 9 import javax.swing.Icon; … … 84 85 @Override 85 86 public int hashCode() { 86 final int prime = 31; 87 int result = super.hashCode(); 88 result = prime * result + ((newRole == null) ? 0 : newRole.hashCode()); 89 result = prime * result + ((oldModified == null) ? 0 : oldModified.hashCode()); 90 result = prime * result + ((oldRole == null) ? 0 : oldRole.hashCode()); 91 result = prime * result + position; 92 result = prime * result + ((relation == null) ? 0 : relation.hashCode()); 93 return result; 87 return Objects.hash(super.hashCode(), relation, position, newRole, oldRole, oldModified); 94 88 } 95 89 96 90 @Override 97 91 public boolean equals(Object obj) { 98 if (this == obj) 99 return true; 100 if (!super.equals(obj)) 101 return false; 102 if (getClass() != obj.getClass()) 103 return false; 104 ChangeRelationMemberRoleCommand other = (ChangeRelationMemberRoleCommand) obj; 105 if (newRole == null) { 106 if (other.newRole != null) 107 return false; 108 } else if (!newRole.equals(other.newRole)) 109 return false; 110 if (oldModified == null) { 111 if (other.oldModified != null) 112 return false; 113 } else if (!oldModified.equals(other.oldModified)) 114 return false; 115 if (oldRole == null) { 116 if (other.oldRole != null) 117 return false; 118 } else if (!oldRole.equals(other.oldRole)) 119 return false; 120 if (position != other.position) 121 return false; 122 if (relation == null) { 123 if (other.relation != null) 124 return false; 125 } else if (!relation.equals(other.relation)) 126 return false; 127 return true; 92 if (this == obj) return true; 93 if (obj == null || getClass() != obj.getClass()) return false; 94 if (!super.equals(obj)) return false; 95 ChangeRelationMemberRoleCommand that = (ChangeRelationMemberRoleCommand) obj; 96 return position == that.position && 97 Objects.equals(relation, that.relation) && 98 Objects.equals(newRole, that.newRole) && 99 Objects.equals(oldRole, that.oldRole) && 100 Objects.equals(oldModified, that.oldModified); 128 101 } 129 102 }
Note:
See TracChangeset
for help on using the changeset viewer.