jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1330860 - /jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
Date Thu, 26 Apr 2012 14:05:51 GMT
Author: sebb
Date: Thu Apr 26 14:05:50 2012
New Revision: 1330860

URL: http://svn.apache.org/viewvc?rev=1330860&view=rev
Log:
Simplify: encodeSpaces() is not expensive, so no point trying to avoid it for static strings

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

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java?rev=1330860&r1=1330859&r2=1330860&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
Thu Apr 26 14:05:50 2012
@@ -297,12 +297,6 @@ public abstract class HTTPSamplerBase ex
     /** Whether to remove '/pathsegment/..' from redirects; default true */
     private static boolean REMOVESLASHDOTDOT = JMeterUtils.getPropDefault("httpsampler.redirect.removeslashdotdot",
true);
 
-    ////////////////////// Variables //////////////////////
-
-    private boolean dynamicPath = false;// Set false if spaces are already encoded
-
-
-
     ////////////////////// Code ///////////////////////////
 
     public HTTPSamplerBase() {
@@ -420,10 +414,7 @@ public abstract class HTTPSamplerBase ex
 
     public String getPath() {
         String p = getPropertyAsString(PATH);
-        if (dynamicPath) {
-            return encodeSpaces(p);
-        }
-        return p;
+        return encodeSpaces(p);
     }
 
     public void setFollowRedirects(boolean value) {
@@ -1298,7 +1289,6 @@ public abstract class HTTPSamplerBase ex
      * {@inheritDoc}
      */
     public void testEnded() {
-        dynamicPath = false;
     }
 
     /**
@@ -1332,27 +1322,6 @@ public abstract class HTTPSamplerBase ex
      * {@inheritDoc}
      */
     public void testStarted() {
-        JMeterProperty pathP = getProperty(PATH);
-        boolean debugEnabled = log.isDebugEnabled();
-        if (debugEnabled) {
-            log.debug("path property is of type " + pathP.getClass().getName());
-        }
-        if (pathP instanceof StringProperty) {
-            String value = pathP.getStringValue();
-            if (value.length() > 0) {
-                if (debugEnabled) {
-                    log.debug("Encoding spaces in path: "+value);
-                }
-                pathP.setObjectValue(encodeSpaces(value));
-                dynamicPath = false;
-                if (debugEnabled) {
-                    log.debug("path ending value = " + pathP.getStringValue());
-                }
-            }
-        } else {
-            log.debug("setting dynamic path to true");
-            dynamicPath = true;
-        }
     }
 
     /**
@@ -1368,7 +1337,6 @@ public abstract class HTTPSamplerBase ex
     @Override
     public Object clone() {
         HTTPSamplerBase base = (HTTPSamplerBase) super.clone();
-        base.dynamicPath = dynamicPath;
         return base;
     }
 



Mime
View raw message