[jboss-cvs] JBossAS SVN: r87551 - branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/metadata.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Apr 20 04:06:50 EDT 2009
Author: bstansberry at jboss.com
Date: 2009-04-20 04:06:50 -0400 (Mon, 20 Apr 2009)
New Revision: 87551
Modified:
branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/metadata/RepositoryItemMetadata.java
Log:
[JBAS-5552] Make compareTo consistent with equals
Modified: branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/metadata/RepositoryItemMetadata.java
===================================================================
--- branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/metadata/RepositoryItemMetadata.java 2009-04-20 07:37:43 UTC (rev 87550)
+++ branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/metadata/RepositoryItemMetadata.java 2009-04-20 08:06:50 UTC (rev 87551)
@@ -308,7 +308,7 @@
}
else
{
- result = -1;
+ result = o.relativePath == null ? 0 : -1;
}
}
@@ -316,6 +316,28 @@
{
result = (int) (this.timestamp - o.timestamp);
}
+
+ if (result == 0 && this.directory != o.directory)
+ {
+ result = this.directory ? 1 : -1;
+ }
+
+ if (result == 0 && this.removed != o.removed)
+ {
+ result = this.removed ? 1 : -1;
+ }
+
+ if (result == 0)
+ {
+ if (this.originatingNode != null)
+ {
+ result = o.originatingNode == null ? -1 : this.originatingNode.compareTo(o.originatingNode);
+ }
+ else
+ {
+ result = o.originatingNode == null ? 0 : 1;
+ }
+ }
}
return result;
}
More information about the jboss-cvs-commits
mailing list