1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-25 15:52:06 +01:00

Add assert to IQ.initializeAsResultFor(IQ)

This method is not meant to be used to be invoked with the identity.
This commit is contained in:
Florian Schmaus 2019-07-04 15:48:07 +02:00
parent 870e6c674a
commit 1b5a264d52

View file

@ -261,6 +261,8 @@ public abstract class IQ extends Stanza {
} }
protected final void initializeAsResultFor(IQ request) { protected final void initializeAsResultFor(IQ request) {
assert this != request;
if (!(request.getType() == Type.get || request.getType() == Type.set)) { if (!(request.getType() == Type.get || request.getType() == Type.set)) {
throw new IllegalArgumentException( throw new IllegalArgumentException(
"IQ must be of type 'set' or 'get'. Original IQ: " + request.toXML()); "IQ must be of type 'set' or 'get'. Original IQ: " + request.toXML());