mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix android test: more precise DomChildrenDescription.equals/hashCode
This commit is contained in:
@@ -62,6 +62,29 @@ public abstract class AbstractDomChildDescriptionImpl implements AbstractDomChil
|
||||
myCustomAnnotations.put(annotation.annotationType(), annotation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
AbstractDomChildDescriptionImpl that = (AbstractDomChildDescriptionImpl)o;
|
||||
|
||||
if (myCustomAnnotations != null ? !myCustomAnnotations.equals(that.myCustomAnnotations) : that.myCustomAnnotations != null)
|
||||
return false;
|
||||
if (!myType.equals(that.myType)) return false;
|
||||
if (myUserMap != null ? !myUserMap.equals(that.myUserMap) : that.myUserMap != null) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = myType.hashCode();
|
||||
result = 31 * result + (myCustomAnnotations != null ? myCustomAnnotations.hashCode() : 0);
|
||||
result = 31 * result + (myUserMap != null ? myUserMap.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setUserMap(final Map userMap) {
|
||||
myUserMap = userMap;
|
||||
}
|
||||
|
||||
@@ -39,20 +39,18 @@ public abstract class DomChildDescriptionImpl extends AbstractDomChildDescriptio
|
||||
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
if (!super.equals(o)) return false;
|
||||
|
||||
final DomChildDescriptionImpl that = (DomChildDescriptionImpl)o;
|
||||
|
||||
if (myTagName != null ? !myTagName.equals(that.myTagName) : that.myTagName != null) return false;
|
||||
if (!getType().equals(that.getType())) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
int result;
|
||||
result = (myTagName != null ? myTagName.hashCode() : 0);
|
||||
result = 31 * result + getType().hashCode();
|
||||
int result = super.hashCode();
|
||||
result = 31 * result + (myTagName != null ? myTagName.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user