jmeter-commits mailing list archives

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

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

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

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java?rev=1294651&r1=1294650&r2=1294651&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java
Tue Feb 28 13:45:03 2012
@@ -706,7 +706,7 @@ public class HTTPHC3Impl 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;
             }
 
@@ -816,11 +816,11 @@ public class HTTPHC3Impl 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().setContentCharset(contentEncoding);
-                    haveContentEncoding = true;
-                } else if (contentEncoding != null && contentEncoding.trim().length()
== 0){
-                    contentEncoding=null;
+                    haveContentEncoding = true;                    
                 }
 
                 // If none of the arguments have a name specified, we
@@ -962,9 +962,11 @@ public class HTTPHC3Impl extends HTTPHCA
 
             // If a content encoding is specified, we set it as http parameter, so that
             // the post body will be encoded in the specified content encoding
-            final String contentEncoding = getContentEncoding();
+            String contentEncoding = getContentEncoding();
             boolean haveContentEncoding = false;
-            if(contentEncoding != null && contentEncoding.trim().length() > 0)
{
+            if(isNullOrEmptyTrimmed(contentEncoding)) {
+                contentEncoding = null;
+            } else {
                 put.getParams().setContentCharset(contentEncoding);
                 haveContentEncoding = true;
             }



Mime
View raw message