From fa10a01831f4cceddc2bf947b4ce11924af57a6c Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Sat, 21 May 2016 12:36:51 +0200 Subject: [PATCH] Fix Presence.setPriority(int): Range is [-128,127] Thanks to Guus der Kinderen for reporting this. --- .../main/java/org/jivesoftware/smack/packet/Presence.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/packet/Presence.java b/smack-core/src/main/java/org/jivesoftware/smack/packet/Presence.java index af15fc6de..88bee4795 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/packet/Presence.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/packet/Presence.java @@ -185,15 +185,15 @@ public final class Presence extends Stanza implements TypedCloneable { } /** - * Sets the priority of the presence. The valid range is -128 through 128. + * Sets the priority of the presence. The valid range is -128 through 127. * * @param priority the priority of the presence. * @throws IllegalArgumentException if the priority is outside the valid range. */ public void setPriority(int priority) { - if (priority < -128 || priority > 128) { + if (priority < -128 || priority > 127) { throw new IllegalArgumentException("Priority value " + priority + - " is not valid. Valid range is -128 through 128."); + " is not valid. Valid range is -128 through 127."); } this.priority = priority; }