Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/http
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28159
Modified Files:
ConnectionManager.java
Log Message:
Bug #1160010 NullPointerException in addCookies
Add test for null expiry date.
Index: ConnectionManager.java
===================================================================
RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/http/ConnectionManager.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ConnectionManager.java 2 Sep 2004 02:28:15 -0000 1.1
--- ConnectionManager.java 12 Mar 2005 11:52:21 -0000 1.2
***************
*** 884,887 ****
--- 884,888 ----
{
Cookie cookie;
+ Date expires;
Date now;
***************
*** 892,896 ****
{
cookie = (Cookie)cookies.elementAt (i);
! if (cookie.getExpiryDate ().before (now))
{
cookies.remove (i);
--- 893,898 ----
{
cookie = (Cookie)cookies.elementAt (i);
! expires = cookie.getExpiryDate ();
! if ((null != expires) && expires.before (now))
{
cookies.remove (i);
***************
*** 898,907 ****
}
else
! if (path.startsWith (cookie.getPath ()))
! {
! if (null == list)
! list = new Vector ();
! list.addElement (cookie);
! }
}
}
--- 900,909 ----
}
else
! if (path.startsWith (cookie.getPath ()))
! {
! if (null == list)
! list = new Vector ();
! list.addElement (cookie);
! }
}
}
|