jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1380319 - /jmeter/trunk/src/components/org/apache/jmeter/assertions/SMIMEAssertion.java
Date Mon, 03 Sep 2012 19:40:28 GMT
Author: pmouawad
Date: Mon Sep  3 19:40:28 2012
New Revision: 1380319

URL: http://svn.apache.org/viewvc?rev=1380319&view=rev
Log:
Use better empty String testing 

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

Modified: jmeter/trunk/src/components/org/apache/jmeter/assertions/SMIMEAssertion.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/assertions/SMIMEAssertion.java?rev=1380319&r1=1380318&r2=1380319&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/assertions/SMIMEAssertion.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/assertions/SMIMEAssertion.java Mon Sep 
3 19:40:28 2012
@@ -43,6 +43,7 @@ import javax.security.auth.x500.X500Prin
 import org.apache.commons.io.IOUtils;
 import org.apache.jmeter.samplers.SampleResult;
 import org.apache.jorphan.logging.LoggingManager;
+import org.apache.jorphan.util.JOrphanUtils;
 import org.apache.log.Logger;
 import org.bouncycastle.asn1.x509.GeneralName;
 import org.bouncycastle.asn1.x509.X509Name;
@@ -167,7 +168,7 @@ class SMIMEAssertion {
                         StringBuilder failureMessage = new StringBuilder();
 
                         String serial = testElement.getSignerSerial();
-                        if (serial.trim().length() > 0) {
+                        if (!JOrphanUtils.isBlank(serial)) {
                             BigInteger serialNbr = readSerialNumber(serial);
                             if (!serialNbr.equals(cert.getSerialNumber())) {
                                 res.setFailure(true);
@@ -180,7 +181,7 @@ class SMIMEAssertion {
                         }
 
                         String email = testElement.getSignerEmail();
-                        if (email.trim().length() > 0) {
+                        if (!JOrphanUtils.isBlank(email)) {
                             List<String> emailfromCert = getEmailFromCert(cert);
                             if (!emailfromCert.contains(email)) {
                                 res.setFailure(true);



Mime
View raw message