From 469548f53a2556f0412f09db00d491d92c080854 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Mon, 22 Dec 2014 16:13:02 +0100 Subject: [PATCH] Use '==' in (IQ|Message|Presence)TypeFilter instead of 'equals()' --- .../main/java/org/jivesoftware/smack/filter/IQTypeFilter.java | 2 +- .../java/org/jivesoftware/smack/filter/MessageTypeFilter.java | 2 +- .../java/org/jivesoftware/smack/filter/PresenceTypeFilter.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/filter/IQTypeFilter.java b/smack-core/src/main/java/org/jivesoftware/smack/filter/IQTypeFilter.java index 782517a56..d6269aa35 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/filter/IQTypeFilter.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/filter/IQTypeFilter.java @@ -42,6 +42,6 @@ public class IQTypeFilter extends FlexiblePacketTypeFilter { @Override protected boolean acceptSpecific(IQ iq) { - return iq.getType().equals(type); + return iq.getType() == type; } } diff --git a/smack-core/src/main/java/org/jivesoftware/smack/filter/MessageTypeFilter.java b/smack-core/src/main/java/org/jivesoftware/smack/filter/MessageTypeFilter.java index a4d57024f..e1035cc45 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/filter/MessageTypeFilter.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/filter/MessageTypeFilter.java @@ -49,7 +49,7 @@ public class MessageTypeFilter extends FlexiblePacketTypeFilter { @Override protected boolean acceptSpecific(Message message) { - return message.getType().equals(this.type); + return message.getType() == type; } } diff --git a/smack-core/src/main/java/org/jivesoftware/smack/filter/PresenceTypeFilter.java b/smack-core/src/main/java/org/jivesoftware/smack/filter/PresenceTypeFilter.java index 1766aae39..045cd2bf8 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/filter/PresenceTypeFilter.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/filter/PresenceTypeFilter.java @@ -43,6 +43,6 @@ public class PresenceTypeFilter extends FlexiblePacketTypeFilter { @Override protected boolean acceptSpecific(Presence presence) { - return presence.getType().equals(type); + return presence.getType() == type; } }