jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1294649 - /jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
Date Tue, 28 Feb 2012 13:43:35 GMT
Author: pmouawad
Date: Tue Feb 28 13:43:35 2012
New Revision: 1294649

URL: http://svn.apache.org/viewvc?rev=1294649&view=rev
Log:
Use ancestor method

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.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=1294649&r1=1294648&r2=1294649&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
Tue Feb 28 13:43:35 2012
@@ -785,7 +785,7 @@ public class HTTPHC4Impl extends HTTPHCA
             // If a content encoding is specified, we use that as the
             // encoding of any parameter values
             String contentEncoding = getContentEncoding();
-            if(contentEncoding != null && contentEncoding.length() == 0) {
+            if(isNullOrEmptyTrimmed(contentEncoding)) {
                 contentEncoding = null;
             }
             Charset charset = null;
@@ -880,11 +880,11 @@ public class HTTPHC4Impl extends HTTPHCA
                 // the post body will be encoded in the specified content encoding
                 String contentEncoding = getContentEncoding();
                 boolean haveContentEncoding = false;
-                if(contentEncoding != null && contentEncoding.trim().length() >
0) {
+                if(isNullOrEmptyTrimmed(contentEncoding)) {
+                    contentEncoding=null;
+                } else {
                     post.getParams().setParameter(CoreProtocolPNames.HTTP_CONTENT_CHARSET,
contentEncoding);
                     haveContentEncoding = true;
-                } else if (contentEncoding != null && contentEncoding.trim().length()
== 0){
-                    contentEncoding=null;
                 }
 
                 // If none of the arguments have a name specified, we
@@ -1010,7 +1010,7 @@ public class HTTPHC4Impl extends HTTPHCA
 
         // Check for local contentEncoding override
         final String contentEncoding = getContentEncoding();
-        boolean haveContentEncoding = (contentEncoding != null && contentEncoding.trim().length()
> 0);
+        boolean haveContentEncoding = !isNullOrEmptyTrimmed(contentEncoding);
         
         HttpParams putParams = put.getParams();
         HTTPFileArg files[] = getHTTPFiles();



Mime
View raw message