diff --git a/core/src/main/java/org/jivesoftware/smack/filter/AndFilter.java b/core/src/main/java/org/jivesoftware/smack/filter/AndFilter.java index ac5bb259f..0396265ae 100644 --- a/core/src/main/java/org/jivesoftware/smack/filter/AndFilter.java +++ b/core/src/main/java/org/jivesoftware/smack/filter/AndFilter.java @@ -51,11 +51,11 @@ public class AndFilter implements PacketFilter { */ public AndFilter(PacketFilter... filters) { if (filters == null) { - throw new IllegalArgumentException("Parameter cannot be null."); + throw new IllegalArgumentException("Parameter must not be null."); } for(PacketFilter filter : filters) { if(filter == null) { - throw new IllegalArgumentException("Parameter cannot be null."); + throw new IllegalArgumentException("Parameter must not be null."); } } this.filters = new ArrayList(Arrays.asList(filters)); @@ -69,7 +69,7 @@ public class AndFilter implements PacketFilter { */ public void addFilter(PacketFilter filter) { if (filter == null) { - throw new IllegalArgumentException("Parameter cannot be null."); + throw new IllegalArgumentException("Parameter must not be null."); } filters.add(filter); } diff --git a/core/src/main/java/org/jivesoftware/smack/filter/NotFilter.java b/core/src/main/java/org/jivesoftware/smack/filter/NotFilter.java index 801eda368..42f252e69 100644 --- a/core/src/main/java/org/jivesoftware/smack/filter/NotFilter.java +++ b/core/src/main/java/org/jivesoftware/smack/filter/NotFilter.java @@ -36,7 +36,7 @@ public class NotFilter implements PacketFilter { */ public NotFilter(PacketFilter filter) { if (filter == null) { - throw new IllegalArgumentException("Parameter cannot be null."); + throw new IllegalArgumentException("Parameter must not be null."); } this.filter = filter; } diff --git a/core/src/main/java/org/jivesoftware/smack/filter/OrFilter.java b/core/src/main/java/org/jivesoftware/smack/filter/OrFilter.java index e67977b50..7c52ed761 100644 --- a/core/src/main/java/org/jivesoftware/smack/filter/OrFilter.java +++ b/core/src/main/java/org/jivesoftware/smack/filter/OrFilter.java @@ -51,11 +51,11 @@ public class OrFilter implements PacketFilter { */ public OrFilter(PacketFilter... filters) { if (filters == null) { - throw new IllegalArgumentException("Parameter cannot be null."); + throw new IllegalArgumentException("Parameter must not be null."); } for(PacketFilter filter : filters) { if(filter == null) { - throw new IllegalArgumentException("Parameter cannot be null."); + throw new IllegalArgumentException("Parameter must not be null."); } } this.filters = new ArrayList(Arrays.asList(filters)); @@ -69,7 +69,7 @@ public class OrFilter implements PacketFilter { */ public void addFilter(PacketFilter filter) { if (filter == null) { - throw new IllegalArgumentException("Parameter cannot be null."); + throw new IllegalArgumentException("Parameter must not be null."); } filters.add(filter); } diff --git a/core/src/main/java/org/jivesoftware/smack/filter/PacketFilter.java b/core/src/main/java/org/jivesoftware/smack/filter/PacketFilter.java index af9b26151..ae571c119 100644 --- a/core/src/main/java/org/jivesoftware/smack/filter/PacketFilter.java +++ b/core/src/main/java/org/jivesoftware/smack/filter/PacketFilter.java @@ -20,24 +20,22 @@ package org.jivesoftware.smack.filter; import org.jivesoftware.smack.packet.Packet; /** - * Defines a way to filter packets for particular attributes. Packet filters are - * used when constructing packet listeners or collectors -- the filter defines - * what packets match the criteria of the collector or listener for further - * packet processing.

- * - * Several pre-defined filters are defined. These filters can be logically combined - * for more complex packet filtering by using the - * {@link org.jivesoftware.smack.filter.AndFilter AndFilter} and - * {@link org.jivesoftware.smack.filter.OrFilter OrFilter} filters. It's also possible - * to define your own filters by implementing this interface. The code example below - * creates a trivial filter for packets with a specific ID. + * Defines a way to filter packets for particular attributes. Packet filters are used when + * constructing packet listeners or collectors -- the filter defines what packets match the criteria + * of the collector or listener for further packet processing. + *

+ * Several simple filters are pre-defined. These filters can be logically combined for more complex + * packet filtering by using the {@link org.jivesoftware.smack.filter.AndFilter AndFilter} and + * {@link org.jivesoftware.smack.filter.OrFilter OrFilter} filters. It's also possible to define + * your own filters by implementing this interface. The code example below creates a trivial filter + * for packets with a specific ID (real code should use {@link PacketIDFilter} instead). * *

  * // Use an anonymous inner class to define a packet filter that returns
- * // all packets that have a packet ID of "RS145".
+ * // all packets that have a packet ID of "RS145".
  * PacketFilter myFilter = new PacketFilter() {
  *     public boolean accept(Packet packet) {
- *         return "RS145".equals(packet.getPacketID());
+ *         return "RS145".equals(packet.getPacketID());
  *     }
  * };
  * // Create a new packet collector using the filter we created.
diff --git a/core/src/main/java/org/jivesoftware/smack/filter/PacketIDFilter.java b/core/src/main/java/org/jivesoftware/smack/filter/PacketIDFilter.java
index d19afde52..82359051e 100644
--- a/core/src/main/java/org/jivesoftware/smack/filter/PacketIDFilter.java
+++ b/core/src/main/java/org/jivesoftware/smack/filter/PacketIDFilter.java
@@ -35,7 +35,7 @@ public class PacketIDFilter implements PacketFilter {
      */
     public PacketIDFilter(String packetID) {
         if (packetID == null) {
-            throw new IllegalArgumentException("Packet ID cannot be null.");
+            throw new IllegalArgumentException("Packet ID must not be null.");
         }
         this.packetID = packetID;
     }
diff --git a/core/src/main/java/org/jivesoftware/smack/filter/ThreadFilter.java b/core/src/main/java/org/jivesoftware/smack/filter/ThreadFilter.java
index 86ccba02c..aa77ee7c0 100644
--- a/core/src/main/java/org/jivesoftware/smack/filter/ThreadFilter.java
+++ b/core/src/main/java/org/jivesoftware/smack/filter/ThreadFilter.java
@@ -36,7 +36,7 @@ public class ThreadFilter implements PacketFilter {
      */
     public ThreadFilter(String thread) {
         if (thread == null) {
-            throw new IllegalArgumentException("Thread cannot be null.");
+            throw new IllegalArgumentException("Thread must not be null.");
         }
         this.thread = thread;
     }
diff --git a/core/src/main/java/org/jivesoftware/smack/packet/Packet.java b/core/src/main/java/org/jivesoftware/smack/packet/Packet.java
index 669843d10..fab00a078 100644
--- a/core/src/main/java/org/jivesoftware/smack/packet/Packet.java
+++ b/core/src/main/java/org/jivesoftware/smack/packet/Packet.java
@@ -235,8 +235,8 @@ public abstract class Packet {
 
     /**
      * Returns the first packet extension that matches the specified element name and
-     * namespace, or null if it doesn't exist. If the provided elementName is null
-     * than only the provided namespace is attempted to be matched. Packet extensions are
+     * namespace, or null if it doesn't exist. If the provided elementName is null,
+     * only the namespace is matched. Packet extensions are
      * are arbitrary XML sub-documents in standard XMPP packets. By default, a 
      * DefaultPacketExtension instance will be returned for each extension. However, 
      * PacketExtensionProvider instances can be registered with the