From 1c08d1c59442a8b60bd474da670aad1f59986f34 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Tue, 9 Dec 2014 13:58:23 +0100 Subject: [PATCH] Remove PacketExtensionFilter(Class) constructor as it's potential error prone, because most PacketExtension's don't have a non-argument constructor required for this to work. Also add some javadoc. --- .../jivesoftware/smack/filter/PacketExtensionFilter.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/filter/PacketExtensionFilter.java b/smack-core/src/main/java/org/jivesoftware/smack/filter/PacketExtensionFilter.java index e1452a91b..3cb6218e4 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/filter/PacketExtensionFilter.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/filter/PacketExtensionFilter.java @@ -57,14 +57,15 @@ public class PacketExtensionFilter implements PacketFilter { this(null, namespace); } + /** + * Creates a new packet extension filter for the given packet extension. + * + * @param packetExtension + */ public PacketExtensionFilter(PacketExtension packetExtension) { this(packetExtension.getElementName(), packetExtension.getNamespace()); } - public PacketExtensionFilter(Class packetExtensionClass) throws InstantiationException, IllegalAccessException { - this(packetExtensionClass.newInstance()); - } - public boolean accept(Packet packet) { return packet.hasExtension(elementName, namespace); }