Changeset 9371 in josm for trunk/src/org/openstreetmap/josm/command/conflict
- Timestamp:
- 2016-01-09T23:20:37+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/command/conflict
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/conflict/ConflictAddCommand.java
r8914 r9371 5 5 6 6 import java.util.Collection; 7 import java.util.Objects; 7 8 8 9 import javax.swing.Icon; … … 89 90 @Override 90 91 public int hashCode() { 91 final int prime = 31; 92 int result = super.hashCode(); 93 result = prime * result + ((conflict == null) ? 0 : conflict.hashCode()); 94 return result; 92 return Objects.hash(super.hashCode(), conflict); 95 93 } 96 94 97 95 @Override 98 96 public boolean equals(Object obj) { 99 if (this == obj) 100 return true; 101 if (!super.equals(obj)) 102 return false; 103 if (getClass() != obj.getClass()) 104 return false; 105 ConflictAddCommand other = (ConflictAddCommand) obj; 106 if (conflict == null) { 107 if (other.conflict != null) 108 return false; 109 } else if (!conflict.equals(other.conflict)) 110 return false; 111 return true; 97 if (this == obj) return true; 98 if (obj == null || getClass() != obj.getClass()) return false; 99 if (!super.equals(obj)) return false; 100 ConflictAddCommand that = (ConflictAddCommand) obj; 101 return Objects.equals(conflict, that.conflict); 112 102 } 113 103 } -
trunk/src/org/openstreetmap/josm/command/conflict/ConflictResolveCommand.java
r8914 r9371 3 3 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 6 import java.util.Objects; 5 7 6 8 import org.openstreetmap.josm.Main; … … 84 86 @Override 85 87 public int hashCode() { 86 final int prime = 31; 87 int result = super.hashCode(); 88 result = prime * result + ((resolvedConflicts == null) ? 0 : resolvedConflicts.hashCode()); 89 return result; 88 return Objects.hash(super.hashCode(), resolvedConflicts); 90 89 } 91 90 92 91 @Override 93 92 public boolean equals(Object obj) { 94 if (this == obj) 95 return true; 96 if (!super.equals(obj)) 97 return false; 98 if (getClass() != obj.getClass()) 99 return false; 100 ConflictResolveCommand other = (ConflictResolveCommand) obj; 101 if (resolvedConflicts == null) { 102 if (other.resolvedConflicts != null) 103 return false; 104 } else if (!resolvedConflicts.equals(other.resolvedConflicts)) 105 return false; 106 return true; 93 if (this == obj) return true; 94 if (obj == null || getClass() != obj.getClass()) return false; 95 if (!super.equals(obj)) return false; 96 ConflictResolveCommand that = (ConflictResolveCommand) obj; 97 return Objects.equals(resolvedConflicts, that.resolvedConflicts); 107 98 } 108 99 } -
trunk/src/org/openstreetmap/josm/command/conflict/CoordinateConflictResolveCommand.java
r8910 r9371 5 5 6 6 import java.util.Collection; 7 import java.util.Objects; 7 8 8 9 import javax.swing.Icon; … … 76 77 @Override 77 78 public int hashCode() { 78 final int prime = 31; 79 int result = super.hashCode(); 80 result = prime * result + ((conflict == null) ? 0 : conflict.hashCode()); 81 result = prime * result + ((decision == null) ? 0 : decision.hashCode()); 82 return result; 79 return Objects.hash(super.hashCode(), conflict, decision); 83 80 } 84 81 85 82 @Override 86 83 public boolean equals(Object obj) { 87 if (this == obj) 88 return true; 89 if (!super.equals(obj)) 90 return false; 91 if (getClass() != obj.getClass()) 92 return false; 93 CoordinateConflictResolveCommand other = (CoordinateConflictResolveCommand) obj; 94 if (conflict == null) { 95 if (other.conflict != null) 96 return false; 97 } else if (!conflict.equals(other.conflict)) 98 return false; 99 if (decision != other.decision) 100 return false; 101 return true; 84 if (this == obj) return true; 85 if (obj == null || getClass() != obj.getClass()) return false; 86 if (!super.equals(obj)) return false; 87 CoordinateConflictResolveCommand that = (CoordinateConflictResolveCommand) obj; 88 return Objects.equals(conflict, that.conflict) && 89 decision == that.decision; 102 90 } 103 91 } -
trunk/src/org/openstreetmap/josm/command/conflict/DeletedStateConflictResolveCommand.java
r8910 r9371 5 5 6 6 import java.util.Collection; 7 import java.util.Objects; 7 8 import java.util.Set; 8 9 … … 91 92 @Override 92 93 public int hashCode() { 93 final int prime = 31; 94 int result = super.hashCode(); 95 result = prime * result + ((conflict == null) ? 0 : conflict.hashCode()); 96 result = prime * result + ((decision == null) ? 0 : decision.hashCode()); 97 return result; 94 return Objects.hash(super.hashCode(), conflict, decision); 98 95 } 99 96 100 97 @Override 101 98 public boolean equals(Object obj) { 102 if (this == obj) 103 return true; 104 if (!super.equals(obj)) 105 return false; 106 if (getClass() != obj.getClass()) 107 return false; 108 DeletedStateConflictResolveCommand other = (DeletedStateConflictResolveCommand) obj; 109 if (conflict == null) { 110 if (other.conflict != null) 111 return false; 112 } else if (!conflict.equals(other.conflict)) 113 return false; 114 if (decision != other.decision) 115 return false; 116 return true; 99 if (this == obj) return true; 100 if (obj == null || getClass() != obj.getClass()) return false; 101 if (!super.equals(obj)) return false; 102 DeletedStateConflictResolveCommand that = (DeletedStateConflictResolveCommand) obj; 103 return Objects.equals(conflict, that.conflict) && 104 decision == that.decision; 117 105 } 118 106 } -
trunk/src/org/openstreetmap/josm/command/conflict/ModifiedConflictResolveCommand.java
r8910 r9371 6 6 7 7 import java.util.Collection; 8 import java.util.Objects; 8 9 9 10 import javax.swing.Icon; … … 67 68 @Override 68 69 public int hashCode() { 69 final int prime = 31; 70 int result = super.hashCode(); 71 result = prime * result + ((conflict == null) ? 0 : conflict.hashCode()); 72 return result; 70 return Objects.hash(super.hashCode(), conflict); 73 71 } 74 72 75 73 @Override 76 74 public boolean equals(Object obj) { 77 if (this == obj) 78 return true; 79 if (!super.equals(obj)) 80 return false; 81 if (getClass() != obj.getClass()) 82 return false; 83 ModifiedConflictResolveCommand other = (ModifiedConflictResolveCommand) obj; 84 if (conflict == null) { 85 if (other.conflict != null) 86 return false; 87 } else if (!conflict.equals(other.conflict)) 88 return false; 89 return true; 75 if (this == obj) return true; 76 if (obj == null || getClass() != obj.getClass()) return false; 77 if (!super.equals(obj)) return false; 78 ModifiedConflictResolveCommand that = (ModifiedConflictResolveCommand) obj; 79 return Objects.equals(conflict, that.conflict); 90 80 } 91 81 } -
trunk/src/org/openstreetmap/josm/command/conflict/RelationMemberConflictResolverCommand.java
r8510 r9371 6 6 import java.util.Collection; 7 7 import java.util.List; 8 import java.util.Objects; 8 9 9 10 import javax.swing.Icon; … … 98 99 @Override 99 100 public int hashCode() { 100 final int prime = 31; 101 int result = super.hashCode(); 102 result = prime * result + ((mergedMembers == null) ? 0 : mergedMembers.hashCode()); 103 result = prime * result + ((my == null) ? 0 : my.hashCode()); 104 result = prime * result + ((their == null) ? 0 : their.hashCode()); 105 return result; 101 return Objects.hash(super.hashCode(), my, their, mergedMembers); 106 102 } 107 103 108 104 @Override 109 105 public boolean equals(Object obj) { 110 if (this == obj) 111 return true; 112 if (!super.equals(obj)) 113 return false; 114 if (getClass() != obj.getClass()) 115 return false; 116 RelationMemberConflictResolverCommand other = (RelationMemberConflictResolverCommand) obj; 117 if (mergedMembers == null) { 118 if (other.mergedMembers != null) 119 return false; 120 } else if (!mergedMembers.equals(other.mergedMembers)) 121 return false; 122 if (my == null) { 123 if (other.my != null) 124 return false; 125 } else if (!my.equals(other.my)) 126 return false; 127 if (their == null) { 128 if (other.their != null) 129 return false; 130 } else if (!their.equals(other.their)) 131 return false; 132 return true; 106 if (this == obj) return true; 107 if (obj == null || getClass() != obj.getClass()) return false; 108 if (!super.equals(obj)) return false; 109 RelationMemberConflictResolverCommand that = (RelationMemberConflictResolverCommand) obj; 110 return Objects.equals(my, that.my) && 111 Objects.equals(their, that.their) && 112 Objects.equals(mergedMembers, that.mergedMembers); 133 113 } 134 114 } -
trunk/src/org/openstreetmap/josm/command/conflict/TagConflictResolveCommand.java
r8910 r9371 6 6 import java.util.Collection; 7 7 import java.util.List; 8 import java.util.Objects; 8 9 9 10 import javax.swing.Icon; … … 103 104 @Override 104 105 public int hashCode() { 105 final int prime = 31; 106 int result = super.hashCode(); 107 result = prime * result + ((conflict == null) ? 0 : conflict.hashCode()); 108 result = prime * result + ((mergeItems == null) ? 0 : mergeItems.hashCode()); 109 return result; 106 return Objects.hash(super.hashCode(), conflict, mergeItems); 110 107 } 111 108 112 109 @Override 113 110 public boolean equals(Object obj) { 114 if (this == obj) 115 return true; 116 if (!super.equals(obj)) 117 return false; 118 if (getClass() != obj.getClass()) 119 return false; 120 TagConflictResolveCommand other = (TagConflictResolveCommand) obj; 121 if (conflict == null) { 122 if (other.conflict != null) 123 return false; 124 } else if (!conflict.equals(other.conflict)) 125 return false; 126 if (mergeItems == null) { 127 if (other.mergeItems != null) 128 return false; 129 } else if (!mergeItems.equals(other.mergeItems)) 130 return false; 131 return true; 111 if (this == obj) return true; 112 if (obj == null || getClass() != obj.getClass()) return false; 113 if (!super.equals(obj)) return false; 114 TagConflictResolveCommand that = (TagConflictResolveCommand) obj; 115 return Objects.equals(conflict, that.conflict) && 116 Objects.equals(mergeItems, that.mergeItems); 132 117 } 133 118 } -
trunk/src/org/openstreetmap/josm/command/conflict/VersionConflictResolveCommand.java
r8910 r9371 6 6 7 7 import java.util.Collection; 8 import java.util.Objects; 8 9 9 10 import javax.swing.Icon; … … 76 77 @Override 77 78 public int hashCode() { 78 final int prime = 31; 79 int result = super.hashCode(); 80 result = prime * result + ((conflict == null) ? 0 : conflict.hashCode()); 81 return result; 79 return Objects.hash(super.hashCode(), conflict); 82 80 } 83 81 84 82 @Override 85 83 public boolean equals(Object obj) { 86 if (this == obj) 87 return true; 88 if (!super.equals(obj)) 89 return false; 90 if (getClass() != obj.getClass()) 91 return false; 92 VersionConflictResolveCommand other = (VersionConflictResolveCommand) obj; 93 if (conflict == null) { 94 if (other.conflict != null) 95 return false; 96 } else if (!conflict.equals(other.conflict)) 97 return false; 98 return true; 84 if (this == obj) return true; 85 if (obj == null || getClass() != obj.getClass()) return false; 86 if (!super.equals(obj)) return false; 87 VersionConflictResolveCommand that = (VersionConflictResolveCommand) obj; 88 return Objects.equals(conflict, that.conflict); 99 89 } 100 90 } -
trunk/src/org/openstreetmap/josm/command/conflict/WayNodesConflictResolverCommand.java
r8910 r9371 6 6 import java.util.Collection; 7 7 import java.util.List; 8 import java.util.Objects; 8 9 9 10 import javax.swing.Icon; … … 75 76 @Override 76 77 public int hashCode() { 77 final int prime = 31; 78 int result = super.hashCode(); 79 result = prime * result + ((conflict == null) ? 0 : conflict.hashCode()); 80 result = prime * result + ((mergedNodeList == null) ? 0 : mergedNodeList.hashCode()); 81 return result; 78 return Objects.hash(super.hashCode(), conflict, mergedNodeList); 82 79 } 83 80 84 81 @Override 85 82 public boolean equals(Object obj) { 86 if (this == obj) 87 return true; 88 if (!super.equals(obj)) 89 return false; 90 if (getClass() != obj.getClass()) 91 return false; 92 WayNodesConflictResolverCommand other = (WayNodesConflictResolverCommand) obj; 93 if (conflict == null) { 94 if (other.conflict != null) 95 return false; 96 } else if (!conflict.equals(other.conflict)) 97 return false; 98 if (mergedNodeList == null) { 99 if (other.mergedNodeList != null) 100 return false; 101 } else if (!mergedNodeList.equals(other.mergedNodeList)) 102 return false; 103 return true; 83 if (this == obj) return true; 84 if (obj == null || getClass() != obj.getClass()) return false; 85 if (!super.equals(obj)) return false; 86 WayNodesConflictResolverCommand that = (WayNodesConflictResolverCommand) obj; 87 return Objects.equals(conflict, that.conflict) && 88 Objects.equals(mergedNodeList, that.mergedNodeList); 104 89 } 105 90 }
Note:
See TracChangeset
for help on using the changeset viewer.