From 69738b5e53d54b0709486c3406a5846d16f614e1 Mon Sep 17 00:00:00 2001 From: Dan Berindei Date: Fri, 12 Oct 2012 22:45:59 +0300 Subject: [PATCH] ISPN-2301 Fix compilation error introduced by the ISPN-2301 fix --- .../org/infinispan/server/hotrod/ServerAddress.scala | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/server/hotrod/src/main/scala/org/infinispan/server/hotrod/ServerAddress.scala b/server/hotrod/src/main/scala/org/infinispan/server/hotrod/ServerAddress.scala index 5221b8d6f1e7..6c041adba8d1 100644 --- a/server/hotrod/src/main/scala/org/infinispan/server/hotrod/ServerAddress.scala +++ b/server/hotrod/src/main/scala/org/infinispan/server/hotrod/ServerAddress.scala @@ -72,6 +72,18 @@ class ServerAddress(val host: String, val port: Int) extends Address { override def toString = "%s:%d".format(host, port) + def compareTo(o: Address) : Int = { + o match { + case oa : ServerAddress => { + var cmp = host.compareTo(oa.host) + if (cmp == 0) { + cmp = port - oa.port + } + cmp + } + case _ => 0 + } + } } object ServerAddress {