Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/http
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12246/htmlparser/src/org/htmlparser/http
Modified Files:
ConnectionManager.java
Log Message:
Optimizations suggested by profiling.
Correction to previous drop:
-- use extractAllNodesThatmatch to replace searchFor(cls) --
Index: ConnectionManager.java
===================================================================
RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/http/ConnectionManager.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ConnectionManager.java 19 Jun 2005 12:01:13 -0000 1.5
--- ConnectionManager.java 20 Jun 2005 01:56:32 -0000 1.6
***************
*** 143,146 ****
--- 143,152 ----
/**
+ * Cookie expiry date format for parsing.
+ */
+ static protected SimpleDateFormat mFormat =
+ new SimpleDateFormat ("EEE, dd-MMM-yy kk:mm:ss z");
+
+ /**
* Create a connection manager.
*/
***************
*** 1056,1064 ****
String comma = tokenizer.nextToken ();
String rest = tokenizer.nextToken ();
- SimpleDateFormat format = new SimpleDateFormat (
- "EEE, dd-MMM-yy kk:mm:ss z");
try
{
! Date date = format.parse (value + comma + rest);
cookie.setExpiryDate (date);
}
--- 1062,1068 ----
String comma = tokenizer.nextToken ();
String rest = tokenizer.nextToken ();
try
{
! Date date = mFormat.parse (value + comma + rest);
cookie.setExpiryDate (date);
}
|