Skip to content

Commit 4685e40

Browse files
committed
added 1.5 compatibility patch.
1 parent 38295ac commit 4685e40

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tls/src/main/java/org/bouncycastle/jsse/provider/ProvX509KeyManagerSimple.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,10 +362,10 @@ private static final class Match
362362

363363
public int compareTo(Match that)
364364
{
365-
int cmp = Boolean.compare(that.isValid(), this.isValid());
365+
int cmp = (that.isValid() == this.isValid()) ? 0 : (that.isValid() ? 1 : -1);
366366
if (cmp == 0)
367367
{
368-
cmp = Integer.compare(this.keyTypeIndex, that.keyTypeIndex);
368+
cmp = this.keyTypeIndex < that.keyTypeIndex ? -1 : (this.keyTypeIndex == that.keyTypeIndex ? 0 : 1);
369369
if (cmp == 0)
370370
{
371371
cmp = this.quality.compareTo(that.quality);

0 commit comments

Comments
 (0)