jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1723881 - /jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java
Date Sat, 09 Jan 2016 20:41:41 GMT
Author: pmouawad
Date: Sat Jan  9 20:41:41 2016
New Revision: 1723881

URL: http://svn.apache.org/viewvc?rev=1723881&view=rev
Log:
Bug 57319 - Upgrade to HttpClient 4.5.X
Replace deprecated methods
Bugzilla Id: 57319

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java?rev=1723881&r1=1723880&r2=1723881&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java
Sat Jan  9 20:41:41 2016
@@ -35,8 +35,7 @@ import org.apache.commons.httpclient.URI
 import org.apache.commons.lang3.StringUtils;
 import org.apache.http.HttpResponse;
 import org.apache.http.client.methods.HttpRequestBase;
-import org.apache.http.impl.cookie.DateParseException;
-import org.apache.http.impl.cookie.DateUtils;
+import org.apache.http.client.utils.DateUtils;
 import org.apache.jmeter.config.ConfigTestElement;
 import org.apache.jmeter.engine.event.LoopIterationEvent;
 import org.apache.jmeter.protocol.http.sampler.HTTPSampleResult;
@@ -211,8 +210,8 @@ public class CacheManager extends Config
             }
             if (expires != null) {
                 try {
-                    expiresDate = DateUtils.parseDate(expires);
-                } catch (org.apache.http.impl.cookie.DateParseException e) {
+                    expiresDate = org.apache.http.client.utils.DateUtils.parseDate(expires);
+                } catch (IllegalArgumentException e) {
                     if (log.isDebugEnabled()){
                         log.debug("Unable to parse Expires: '"+expires+"' "+e);
                     }
@@ -238,7 +237,7 @@ public class CacheManager extends Config
                             // see http://www.ietf.org/rfc/rfc2616.txt#13.2.4 
                             expiresDate=new Date(System.currentTimeMillis()
                                     +Math.round((responseDate.getTime()-lastModifiedAsDate.getTime())*0.1));
-                        } catch(DateParseException e) {
+                        } catch(IllegalArgumentException e) {
                             // date or lastModified may be null or in bad format
                             if(log.isWarnEnabled()) {
                                 log.warn("Failed computing expiration date with following
info:"



Mime
View raw message