1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 17:49:38 +02:00

SMACK-361 Some general code cleanup added some missing hashcode methods and added back some removed public API methods (marked as deprecated).

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/branches/smack_3_3_0@13598 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
rcollier 2013-03-31 14:24:50 +00:00
parent 58f56ee31b
commit 0fdfd6e75e
12 changed files with 84 additions and 43 deletions

View file

@ -299,24 +299,23 @@ public class FormField {
return buf.toString();
}
@Override
public boolean equals(Object obj) {
if (obj == null)
return false;
if (obj == this)
return true;
if (obj.getClass() != getClass())
if (!(obj instanceof FormField))
return false;
FormField other = (FormField) obj;
String thisXml = toXML();
String otherXml = other.toXML();
return toXML().equals(other.toXML());
}
if (thisXml.equals(otherXml)) {
return true;
} else {
return false;
}
@Override
public int hashCode() {
return toXML().hashCode();
}
/**
@ -356,6 +355,7 @@ public class FormField {
return value;
}
@Override
public String toString() {
return getLabel();
}
@ -375,6 +375,7 @@ public class FormField {
return buf.toString();
}
@Override
public boolean equals(Object obj) {
if (obj == null)
return false;
@ -396,5 +397,13 @@ public class FormField {
return true;
}
@Override
public int hashCode() {
int result = 1;
result = 37 * result + value.hashCode();
result = 37 * result + (label == null ? 0 : label.hashCode());
return result;
}
}
}