Fix SASLMechanism.compareTo(SASLMechanism)

Thanks to Aleksander Melnichnikov for pointing this out.
This commit is contained in:
Florian Schmaus 2017-02-02 16:08:37 +01:00
parent bf1e07e672
commit ffe9397e66
1 changed files with 3 additions and 1 deletions

View File

@ -266,7 +266,9 @@ public abstract class SASLMechanism implements Comparable<SASLMechanism> {
} }
public final int compareTo(SASLMechanism other) { public final int compareTo(SASLMechanism other) {
return getPriority() - other.getPriority(); // Switch to Integer.compare(int, int) once Smack is on Android 19 or higher.
Integer ourPriority = new Integer(getPriority());
return ourPriority.compareTo(other.getPriority());
} }
/** /**