Fixed issue: NETTY-28 (Channel.compareTo() can return 0 for different channels.)

* Changed AbstractChannel.compareTo(Channel) to use the id of the channels instead of the identity hash codes
This commit is contained in:
Trustin Lee 2008-08-25 08:57:03 +00:00
parent 6ff5a87d01
commit b4d84ce73b

View File

@ -94,8 +94,8 @@ public abstract class AbstractChannel implements Channel, Comparable<Channel> {
return this == o; return this == o;
} }
public int compareTo(Channel o) { public final int compareTo(Channel o) {
return System.identityHashCode(this) - System.identityHashCode(o); return getId().compareTo(o.getId());
} }
public boolean isOpen() { public boolean isOpen() {