Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dcache-webadmin: fix comparison semantics
Java 1.7 now enforces comparison contracts on sort, and will throw an IllegalArgument exception if the implementation of compareTo violates it. Several comparisons used in the webadmin beans did not adhere to this contract. For instance, something like: a.name.compareTo(b.name) + a.domain.compareTo(b.domain) is incorrect, since this could possibly result in 0 if the two parts evaluate to oppositely signed 1s, when in fact 0 should be reserved for equality. This patch reimplements all compareTo in the bean classes, modernizing them with a call to Guava's ComparisonChain. Testing: Reran junit tests. Deployed and rechecked. Target: master Request: 2.6 Patch: http://rb.dcache.org/r/6307/ Bug: http://rt.dcache.org/Ticket/Display.html?id=8145 Require-notes: yes Require-book: no Acked-by: Tigran RELEASE NOTES: Fixes bug which throws java.lang.IllegalArgumentException: Comparison method violates its general contract! when data is being sorted in certain webadmin pages.
- Loading branch information
alrossi
committed
Dec 5, 2013
1 parent
110a50c
commit 5c788be
Showing
6 changed files
with
48 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters