Author: fschumacher
Date: Mon Feb 12 17:45:39 2018
New Revision: 1824044

URL: http://svn.apache.org/viewvc?rev=1824044&view=rev
Log:
Use StringUtils

Part of #356 on Github. Based on contribution by Graham Russell (graham at 
ham1.co.uk)

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/assertions/HTMLAssertion.java

Modified: 
jmeter/trunk/src/components/org/apache/jmeter/assertions/HTMLAssertion.java
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/assertions/HTMLAssertion.java?rev=1824044&r1=1824043&r2=1824044&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/assertions/HTMLAssertion.java 
(original)
+++ jmeter/trunk/src/components/org/apache/jmeter/assertions/HTMLAssertion.java 
Mon Feb 12 17:45:39 2018
@@ -28,6 +28,7 @@ import java.io.StringWriter;
 import java.nio.charset.StandardCharsets;
 import java.text.MessageFormat;
 
+import org.apache.commons.lang3.StringUtils;
 import org.apache.jmeter.samplers.SampleResult;
 import org.apache.jmeter.testelement.AbstractTestElement;
 import org.apache.jmeter.testelement.property.BooleanProperty;
@@ -190,7 +191,7 @@ public class HTMLAssertion extends Abstr
         String lFilename = getFilename();
 
         // check if filename defined
-        if ((lFilename != null) && (!"".equals(lFilename.trim()))) {
+        if (StringUtils.isNotBlank(lFilename)) {
             
             try (FileWriter lOutputWriter = new FileWriter(lFilename, false)){
                 // write to file
@@ -247,7 +248,7 @@ public class HTMLAssertion extends Abstr
      *            used
      */
     public void setDoctype(String inDoctype) {
-        if ((inDoctype == null) || (inDoctype.trim().isEmpty())) {
+        if (StringUtils.isAllBlank(inDoctype)) {
             setProperty(new StringProperty(DOCTYPE_KEY, DEFAULT_DOCTYPE));
         } else {
             setProperty(new StringProperty(DOCTYPE_KEY, inDoctype));


Reply via email to