You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2012/02/28 14:38:38 UTC

svn commit: r1294644 - /jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java

Author: pmouawad
Date: Tue Feb 28 13:38:38 2012
New Revision: 1294644

URL: http://svn.apache.org/viewvc?rev=1294644&view=rev
Log:
Check for empty encoding also

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=1294644&r1=1294643&r2=1294644&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 Tue Feb 28 13:38:38 2012
@@ -41,6 +41,7 @@ import java.util.concurrent.ThreadPoolEx
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 
+import org.apache.commons.lang.StringUtils;
 import org.apache.jmeter.config.Argument;
 import org.apache.jmeter.config.Arguments;
 import org.apache.jmeter.engine.event.LoopIterationEvent;
@@ -521,7 +522,8 @@ public abstract class HTTPSamplerBase ex
         }
 
         HTTPArgument arg = null;
-        if(contentEncoding != null) {
+        final boolean nonEmptyEncoding = !StringUtils.isEmpty(contentEncoding);
+        if(nonEmptyEncoding) {
             arg = new HTTPArgument(name, value, metaData, true, contentEncoding);
         }
         else {
@@ -530,7 +532,7 @@ public abstract class HTTPSamplerBase ex
 
         // Check if there are any difference between name and value and their encoded name and value
         String valueEncoded = null;
-        if(contentEncoding != null) {
+        if(nonEmptyEncoding) {
             try {
                 valueEncoded = arg.getEncodedValue(contentEncoding);
             }
@@ -999,7 +1001,7 @@ public abstract class HTTPSamplerBase ex
             if (name.length() > 0) {
                 // If we know the encoding, we can decode the argument value,
                 // to make it easier to read for the user
-                if(contentEncoding != null) {
+                if(!StringUtils.isEmpty(contentEncoding)) {
                     addEncodedArgument(name, value, metaData, contentEncoding);
                 }
                 else {