You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by se...@apache.org on 2016/08/14 10:25:27 UTC

svn commit: r1756307 - in /jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler: HTTPHC4Impl.java HttpWebdav.java

Author: sebb
Date: Sun Aug 14 10:25:27 2016
New Revision: 1756307

URL: http://svn.apache.org/viewvc?rev=1756307&view=rev
Log:
No need for anchors when pattern is used in match()

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HttpWebdav.java

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java?rev=1756307&r1=1756306&r2=1756307&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java Sun Aug 14 10:25:27 2016
@@ -151,7 +151,7 @@ public class HTTPHC4Impl extends HTTPHCA
 
     private static final String CONTEXT_METRICS = "jmeter_metrics"; // TODO hack for metrics related to HTTPCLIENT-1081, to be removed later
     
-    private static final Pattern PORT_PATTERN = Pattern.compile("^\\d+$");
+    private static final Pattern PORT_PATTERN = Pattern.compile("\\d+"); // only used in .matches(), no need for anchors
 
     private static final ConnectionKeepAliveStrategy IDLE_STRATEGY = new DefaultConnectionKeepAliveStrategy(){
         @Override

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HttpWebdav.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HttpWebdav.java?rev=1756307&r1=1756306&r2=1756307&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HttpWebdav.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HttpWebdav.java Sun Aug 14 10:25:27 2016
@@ -31,7 +31,7 @@ import org.apache.http.client.methods.Ht
 public final class HttpWebdav extends HttpEntityEnclosingRequestBase {
     // A HTTP method can be a token as specified in
     // https://tools.ietf.org/html/rfc7230#section-3.2.6
-    private static final Pattern WEBDAV_METHOD_PATTERN = Pattern.compile("^(?i)[\\da-z!#$%&'*+\\-.^_`|~]+$");
+    private static final Pattern WEBDAV_METHOD_PATTERN = Pattern.compile("(?i)[\\da-z!#$%&'*+\\-.^_`|~]+"); // only used in .matches(), no need for anchors
     
     private final String davMethod;