abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r617169 - /incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/context/AbstractRequestContext.java
Date Thu, 31 Jan 2008 17:44:35 GMT
Author: jmsnell
Date: Thu Jan 31 09:44:30 2008
New Revision: 617169

URL: http://svn.apache.org/viewvc?rev=617169&view=rev
Log:
deal with a null parser

Modified:
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/context/AbstractRequestContext.java

Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/context/AbstractRequestContext.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/context/AbstractRequestContext.java?rev=617169&r1=617168&r2=617169&view=diff
==============================================================================
--- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/context/AbstractRequestContext.java
(original)
+++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/context/AbstractRequestContext.java
Thu Jan 31 09:44:30 2008
@@ -95,6 +95,10 @@
       throws ParseException, 
              IOException {
     log.debug(Localizer.get("PARSING.REQUEST.DOCUMENT"));
+    if (parser == null)
+      parser = getAbdera().getParser();
+    if (parser == null)
+      throw new IllegalArgumentException("No Parser implementation was provided");
     if (document == null)
       document = getDocument(parser, parser.getDefaultParserOptions());
     return (Document<T>) document;
@@ -118,6 +122,10 @@
       throws ParseException, 
              IOException {
     log.debug(Localizer.get("PARSING.REQUEST.DOCUMENT"));
+    if (parser == null)
+      parser = getAbdera().getParser();
+    if (parser == null)
+      throw new IllegalArgumentException("No Parser implementation was provided");
     if (document == null) {
       document = parser.parse(
         getInputStream(), 



Mime
View raw message