1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-23 04:22:05 +01:00

Fix Presence.setPriority(int): Range is [-128,127]

Thanks to Guus der Kinderen for reporting this.
This commit is contained in:
Florian Schmaus 2016-05-21 12:36:51 +02:00
parent 4c63cfafd7
commit fa10a01831

View file

@ -185,15 +185,15 @@ public final class Presence extends Stanza implements TypedCloneable<Presence> {
} }
/** /**
* 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. * @param priority the priority of the presence.
* @throws IllegalArgumentException if the priority is outside the valid range. * @throws IllegalArgumentException if the priority is outside the valid range.
*/ */
public void setPriority(int priority) { public void setPriority(int priority) {
if (priority < -128 || priority > 128) { if (priority < -128 || priority > 127) {
throw new IllegalArgumentException("Priority value " + priority + 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; this.priority = priority;
} }