mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-25 12:08:00 +01:00
[sinttest] Improve code readability in MultiUserChatOccupantIntegrationTest
Especially considering pattern matching for instanceof, which will be available in Java 16.
This commit is contained in:
parent
9c7e575e9e
commit
7e8fddcbf8
1 changed files with 7 additions and 2 deletions
|
@ -114,8 +114,13 @@ public class MultiUserChatOccupantIntegrationTest extends AbstractMultiUserChatI
|
|||
final List<Stanza> results = new ArrayList<>();
|
||||
final StanzaListener stanzaListener = stanza -> {
|
||||
results.add(stanza);
|
||||
if (stanza instanceof Message && ((Message) stanza).getSubject() != null) {
|
||||
subjectResultSyncPoint.signal(((Message) stanza).getSubject());
|
||||
// TODO: Use pattern matching for instanceof once Smack is Java 16 or higher.
|
||||
if (stanza instanceof Message) {
|
||||
Message message = (Message) stanza;
|
||||
String subject = message.getSubject();
|
||||
if (subject != null) {
|
||||
subjectResultSyncPoint.signal(subject);
|
||||
}
|
||||
}
|
||||
};
|
||||
conTwo.addStanzaListener(stanzaListener, FromMatchesFilter.create(mucAddress));
|
||||
|
|
Loading…
Reference in a new issue