abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From roo...@apache.org
Subject svn commit: r429514 - /incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/cache/CachedResponseBase.java
Date Mon, 07 Aug 2006 23:45:07 GMT
Author: rooneg
Date: Mon Aug  7 16:45:07 2006
New Revision: 429514

URL: http://svn.apache.org/viewvc?rev=429514&view=rev
Log:
Don't crash if the server doesn't send back a Date header.

[ in client/src/main/java/org/apache/abdera/protocol/cache ]

* CachedResponseBase.java
  (getCachedTime): Don't dereference a null pointer if there's no Date
   header in the response.

Modified:
    incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/cache/CachedResponseBase.java

Modified: incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/cache/CachedResponseBase.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/cache/CachedResponseBase.java?rev=429514&r1=429513&r2=429514&view=diff
==============================================================================
--- incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/cache/CachedResponseBase.java
(original)
+++ incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/cache/CachedResponseBase.java
Mon Aug  7 16:45:07 2006
@@ -68,7 +68,11 @@
   }
 
   public long getCachedTime() {
-    return getServerDate().getTime();
+    Date serverDate = getServerDate();
+    if (serverDate != null)
+      return serverDate.getTime();
+    else
+      return 0;
   }
   
   public long getResidentAge() {



Mime
View raw message