From commits-return-1398-apmail-jmeter-commits-archive=jmeter.apache.org@jmeter.apache.org Mon Sep 3 19:59:59 2012 Return-Path: X-Original-To: apmail-jmeter-commits-archive@minotaur.apache.org Delivered-To: apmail-jmeter-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 99187DC47 for ; Mon, 3 Sep 2012 19:59:59 +0000 (UTC) Received: (qmail 7495 invoked by uid 500); 3 Sep 2012 19:59:59 -0000 Delivered-To: apmail-jmeter-commits-archive@jmeter.apache.org Received: (qmail 7477 invoked by uid 500); 3 Sep 2012 19:59:59 -0000 Mailing-List: contact commits-help@jmeter.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jmeter.apache.org Delivered-To: mailing list commits@jmeter.apache.org Received: (qmail 7469 invoked by uid 99); 3 Sep 2012 19:59:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Sep 2012 19:59:59 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Sep 2012 19:59:58 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 4E1162388CAD for ; Mon, 3 Sep 2012 19:59:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1380327 - in /jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http: control/ sampler/ Date: Mon, 03 Sep 2012 19:59:14 -0000 To: commits@jmeter.apache.org From: pmouawad@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120903195915.4E1162388CAD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: pmouawad Date: Mon Sep 3 19:59:14 2012 New Revision: 1380327 URL: http://svn.apache.org/viewvc?rev=1380327&view=rev Log: Use JOrphanUtils#isBlank Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HeaderManager.java jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHCAbstractImpl.java jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerFactory.java Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java?rev=1380327&r1=1380326&r2=1380327&view=diff ============================================================================== --- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java (original) +++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java Mon Sep 3 19:59:14 2012 @@ -40,6 +40,7 @@ import org.apache.jmeter.testelement.pro import org.apache.jmeter.testelement.property.TestElementProperty; import org.apache.jmeter.util.JMeterUtils; import org.apache.jorphan.logging.LoggingManager; +import org.apache.jorphan.util.JOrphanUtils; import org.apache.log.Logger; // For Unit tests, @see TestAuthManager @@ -244,7 +245,7 @@ public class AuthManager extends ConfigT String line; while ((line = reader.readLine()) != null) { try { - if (line.startsWith("#") || line.trim().length() == 0) { //$NON-NLS-1$ + if (line.startsWith("#") || JOrphanUtils.isBlank(line)) { //$NON-NLS-1$ continue; } StringTokenizer st = new StringTokenizer(line, "\t"); //$NON-NLS-1$ Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java?rev=1380327&r1=1380326&r2=1380327&view=diff ============================================================================== --- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java (original) +++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java Mon Sep 3 19:59:14 2012 @@ -198,7 +198,7 @@ public class CookieManager extends Confi final CollectionProperty cookies = getCookies(); while ((line = reader.readLine()) != null) { try { - if (line.startsWith("#") || line.trim().length() == 0) {//$NON-NLS-1$ + if (line.startsWith("#") || JOrphanUtils.isBlank(line)) {//$NON-NLS-1$ continue; } String[] st = JOrphanUtils.split(line, TAB, false); Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HeaderManager.java URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HeaderManager.java?rev=1380327&r1=1380326&r2=1380327&view=diff ============================================================================== --- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HeaderManager.java (original) +++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HeaderManager.java Mon Sep 3 19:59:14 2012 @@ -138,7 +138,7 @@ public class HeaderManager extends Confi String line; while ((line = reader.readLine()) != null) { try { - if (line.startsWith("#") || line.trim().length() == 0) {// $NON-NLS-1$ + if (line.startsWith("#") || JOrphanUtils.isBlank(line)) {// $NON-NLS-1$ continue; } String[] st = JOrphanUtils.split(line, "\t", " ");// $NON-NLS-1$ $NON-NLS-2$ Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHCAbstractImpl.java URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHCAbstractImpl.java?rev=1380327&r1=1380326&r2=1380327&view=diff ============================================================================== --- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHCAbstractImpl.java (original) +++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHCAbstractImpl.java Mon Sep 3 19:59:14 2012 @@ -29,6 +29,7 @@ import java.util.StringTokenizer; import org.apache.jmeter.JMeter; import org.apache.jmeter.util.JMeterUtils; import org.apache.jorphan.logging.LoggingManager; +import org.apache.jorphan.util.JOrphanUtils; import org.apache.log.Logger; /** @@ -140,7 +141,7 @@ public abstract class HTTPHCAbstractImpl * @return {@code true} iff both ProxyPort and ProxyHost are defined. */ protected boolean isDynamicProxy(String proxyHost, int proxyPort){ - return (proxyHost.trim().length() > 0 && proxyPort > 0); + return (!JOrphanUtils.isBlank(proxyHost) && proxyPort > 0); } /** @@ -158,6 +159,6 @@ public abstract class HTTPHCAbstractImpl * @return true if value is null or empty trimmed */ protected static boolean isNullOrEmptyTrimmed(String value) { - return value == null || value.trim().length() == 0; + return JOrphanUtils.isBlank(value); } } 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=1380327&r1=1380326&r2=1380327&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 Mon Sep 3 19:59:14 2012 @@ -929,7 +929,7 @@ public abstract class HTTPSamplerBase ex */ public String getQueryString(String contentEncoding) { // Check if the sampler has a specified content encoding - if(contentEncoding == null || contentEncoding.trim().length() == 0) { + if(JOrphanUtils.isBlank(contentEncoding)) { // We use the encoding which should be used according to the HTTP spec, which is UTF-8 contentEncoding = EncoderCache.URL_ARGUMENT_ENCODING; } Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerFactory.java URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerFactory.java?rev=1380327&r1=1380326&r2=1380327&view=diff ============================================================================== --- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerFactory.java (original) +++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerFactory.java Mon Sep 3 19:59:14 2012 @@ -19,6 +19,7 @@ package org.apache.jmeter.protocol.http.sampler; import org.apache.jmeter.util.JMeterUtils; +import org.apache.jorphan.util.JOrphanUtils; /** * Factory to return the appropriate HTTPSampler for use with classes that need @@ -90,7 +91,7 @@ public final class HTTPSamplerFactory { if (HTTPSamplerBase.PROTOCOL_FILE.equals(base.getProtocol())) { return new HTTPFileImpl(base); } - if (impl.trim().length() == 0){ + if (JOrphanUtils.isBlank(impl)){ impl = DEFAULT_CLASSNAME; } if (IMPL_JAVA.equals(impl) || HTTP_SAMPLER_JAVA.equals(impl)) {