// return true if obj is this
if (obj == this) return true;
// return false if obj does not have the correct type
if ((obj == null) || !(obj instanceof JavaMember)) return false;
JavaMember other = (JavaMember)obj;
// compare declaringClass and field names
return (getDeclaringClass() == other.getDeclaringClass())
&& (getName().equals(other.getName()));
}