jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject svn commit: r1843490 - in /jmeter/trunk/src: core/org/apache/jmeter/engine/ core/org/apache/jmeter/testbeans/gui/ core/org/apache/jmeter/testelement/property/ protocol/mail/org/apache/jmeter/protocol/smtp/sampler/gui/
Date Wed, 10 Oct 2018 18:58:35 GMT
Author: fschumacher
Date: Wed Oct 10 18:58:35 2018
New Revision: 1843490

URL: http://svn.apache.org/viewvc?rev=1843490&view=rev
Log:
Use `isEmpty()` instead of comparing `size()` to zero

Small improvement on efficiency. Should be functionally the same.
Closes #402 on github

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/engine/DistributedRunner.java
    jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java
    jmeter/trunk/src/core/org/apache/jmeter/testelement/property/CollectionProperty.java
    jmeter/trunk/src/protocol/mail/org/apache/jmeter/protocol/smtp/sampler/gui/SmtpPanel.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/engine/DistributedRunner.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/engine/DistributedRunner.java?rev=1843490&r1=1843489&r2=1843490&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/engine/DistributedRunner.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/engine/DistributedRunner.java Wed Oct 10 18:58:35
2018
@@ -107,7 +107,7 @@ public class DistributedRunner {
 
         if (!addrs.isEmpty()) {
             String msg = "Following remote engines could not be configured:" + addrs;
-            if (!continueOnFail || engines.size() == 0) {
+            if (!continueOnFail || engines.isEmpty()) {
                 stop();
                 throw new RuntimeException(msg); // NOSONAR
             } else {

Modified: jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java?rev=1843490&r1=1843489&r2=1843490&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java Wed
Oct 10 18:58:35 2018
@@ -487,7 +487,7 @@ public class GenericTestBeanCustomizer e
     public void setObject(Object map) {
         propertyMap = (Map<String, Object>) map;
 
-        if (propertyMap.size() == 0) {
+        if (propertyMap.isEmpty()) {
             // Uninitialized -- set it to the defaults:
             for (PropertyDescriptor descriptor : descriptors) {
                 Object value = descriptor.getValue(DEFAULT);

Modified: jmeter/trunk/src/core/org/apache/jmeter/testelement/property/CollectionProperty.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/testelement/property/CollectionProperty.java?rev=1843490&r1=1843489&r2=1843490&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/testelement/property/CollectionProperty.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/testelement/property/CollectionProperty.java Wed
Oct 10 18:58:35 2018
@@ -186,7 +186,7 @@ public class CollectionProperty extends
      */
     @Override
     protected Class<? extends JMeterProperty> getPropertyType() {
-        if (value != null && value.size() > 0) {
+        if (value != null && !value.isEmpty()) {
             return value.iterator().next().getClass();
         }
         return NullProperty.class;

Modified: jmeter/trunk/src/protocol/mail/org/apache/jmeter/protocol/smtp/sampler/gui/SmtpPanel.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/mail/org/apache/jmeter/protocol/smtp/sampler/gui/SmtpPanel.java?rev=1843490&r1=1843489&r2=1843490&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/mail/org/apache/jmeter/protocol/smtp/sampler/gui/SmtpPanel.java
(original)
+++ jmeter/trunk/src/protocol/mail/org/apache/jmeter/protocol/smtp/sampler/gui/SmtpPanel.java
Wed Oct 10 18:58:35 2018
@@ -1019,7 +1019,7 @@ public class SmtpPanel extends JPanel {
     }
 
     private JButton addHeaderActionPerformed(ActionEvent evt){
-        if(headerFields.size() == 0){
+        if(headerFields.isEmpty()){
             headerFieldName.setVisible(true);
             headerFieldValue.setVisible(true);
         }



Mime
View raw message