[jboss-cvs] JBossCache/src/org/jboss/cache ...
Manik Surtani
msurtani at jboss.com
Wed Dec 6 08:01:19 EST 2006
User: msurtani
Date: 06/12/06 08:01:19
Modified: src/org/jboss/cache Tag: Branch_JBossCache_1_4_0
GlobalTransaction.java
Log:
JBCACHE-895
Revision Changes Path
No revision
No revision
1.13.2.1 +6 -16 JBossCache/src/org/jboss/cache/GlobalTransaction.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: GlobalTransaction.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/GlobalTransaction.java,v
retrieving revision 1.13
retrieving revision 1.13.2.1
diff -u -b -r1.13 -r1.13.2.1
--- GlobalTransaction.java 13 Apr 2006 12:02:59 -0000 1.13
+++ GlobalTransaction.java 6 Dec 2006 13:01:19 -0000 1.13.2.1
@@ -22,7 +22,7 @@
*
* @author <a href="mailto:bela at jboss.org">Bela Ban</a> Apr 12, 2003
* @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
- * @version $Revision: 1.13 $
+ * @version $Revision: 1.13.2.1 $
*/
public class GlobalTransaction implements Externalizable {
Address addr=null;
@@ -83,22 +83,12 @@
return true;
if(!(other instanceof GlobalTransaction))
return false;
- return compareTo(other) == 0;
- }
- public int compareTo(Object o) {
- GlobalTransaction other;
- int comp;
- if(o == null || !(o instanceof GlobalTransaction))
- throw new ClassCastException("GlobalTransaction.compareTo(): other object is " + o);
- other=(GlobalTransaction)o;
- comp=addr != null ? addr.compareTo(other.addr) : 0;
- if(comp == 0)
- {
- if(id < other.getId()) comp = -1;
- else if(id > other.getId()) comp = 1;
- }
- return comp;
+ if(other == null) throw new NullPointerException("GlobalTransaction.compareTo(): other object is null");
+
+ GlobalTransaction otherGtx=(GlobalTransaction)other;
+
+ return (addr == null && otherGtx.addr == null) || (addr != null && otherGtx.addr != null && addr.compareTo(otherGtx.addr) == 0) && id == otherGtx.id;
}
public String toString() {
More information about the jboss-cvs-commits
mailing list