summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMili Verma <mili.verma@isode.com>2012-01-10 15:55:29 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-01-11 13:44:37 (GMT)
commitbe94e872d9423501c688c84c6cb945a420a5cb18 (patch)
tree77986e9e30282b526c0246bb6344c175b54ffb5f /src/com/isode/stroke/parser/payloadparsers/FormParserFactory.java
parentc9ff80a46b13b7d1987bf54cae87738a9baf552b (diff)
downloadstroke-be94e872d9423501c688c84c6cb945a420a5cb18.zip
stroke-be94e872d9423501c688c84c6cb945a420a5cb18.tar.bz2
Update review comment related stuff
This patch addresses some review comments: 1. Updates the Javadoc. 2. Disallows arguments from being null - throws NullPointerException. 3. Updates each test to use its own DummyEventLoop. Test-information: Unit tests pass.
Diffstat (limited to 'src/com/isode/stroke/parser/payloadparsers/FormParserFactory.java')
-rw-r--r--src/com/isode/stroke/parser/payloadparsers/FormParserFactory.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/com/isode/stroke/parser/payloadparsers/FormParserFactory.java b/src/com/isode/stroke/parser/payloadparsers/FormParserFactory.java
index 228c093..0287cca 100644
--- a/src/com/isode/stroke/parser/payloadparsers/FormParserFactory.java
+++ b/src/com/isode/stroke/parser/payloadparsers/FormParserFactory.java
@@ -24,7 +24,18 @@ public class FormParserFactory implements PayloadParserFactory {
public FormParserFactory() {
}
- public boolean canParse(String element, String ns, AttributeMap attributes) {
+ public boolean canParse(String element, String ns,
+ final AttributeMap attributes) {
+ if (element == null) {
+ throw new NullPointerException("'element' must not be null");
+ }
+ if (ns == null) {
+ throw new NullPointerException("'ns' must not be null");
+ }
+ if (attributes == null) {
+ throw new NullPointerException("'attributes' must not be null");
+ }
+
return ns.equals("jabber:x:data");
}