You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by vl...@apache.org on 2023/05/11 12:17:42 UTC

[jmeter] branch master updated: Use JMeterProperty#intValue for loop count directly (#5876)

This is an automated email from the ASF dual-hosted git repository.

vladimirsitnikov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git


The following commit(s) were added to refs/heads/master by this push:
     new 96bfab978c Use JMeterProperty#intValue for loop count directly (#5876)
96bfab978c is described below

commit 96bfab978c80c5152222a6cba01b537a90f597a6
Author: Felix Schumacher <fe...@internetallee.de>
AuthorDate: Thu May 11 14:17:35 2023 +0200

    Use JMeterProperty#intValue for loop count directly (#5876)
    
    This will get rid of the roundtrip over a String in case,
    the prop is already an IntegerProperty.
---
 src/core/src/main/java/org/apache/jmeter/control/LoopController.java    | 2 +-
 .../main/java/org/apache/jmeter/protocol/jms/sampler/JMSSampler.java    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/core/src/main/java/org/apache/jmeter/control/LoopController.java b/src/core/src/main/java/org/apache/jmeter/control/LoopController.java
index b076a19f94..50a3e2094d 100644
--- a/src/core/src/main/java/org/apache/jmeter/control/LoopController.java
+++ b/src/core/src/main/java/org/apache/jmeter/control/LoopController.java
@@ -87,7 +87,7 @@ public class LoopController extends GenericController implements Serializable, I
                 ) {
             try {
                 JMeterProperty prop = getProperty(LOOPS);
-                nbLoops = Integer.valueOf(prop.getStringValue());
+                nbLoops = prop.getIntValue();
             } catch (NumberFormatException e) {
                 nbLoops = 0;
             }
diff --git a/src/protocol/jms/src/main/java/org/apache/jmeter/protocol/jms/sampler/JMSSampler.java b/src/protocol/jms/src/main/java/org/apache/jmeter/protocol/jms/sampler/JMSSampler.java
index 6199252098..afa833b5cd 100644
--- a/src/protocol/jms/src/main/java/org/apache/jmeter/protocol/jms/sampler/JMSSampler.java
+++ b/src/protocol/jms/src/main/java/org/apache/jmeter/protocol/jms/sampler/JMSSampler.java
@@ -597,7 +597,7 @@ public class JMSSampler extends AbstractSampler implements ThreadListener {
 
     public int getCommunicationstyle() {
         JMeterProperty prop = getProperty(JMS_COMMUNICATION_STYLE);
-        return Integer.parseInt(prop.getStringValue());
+        return prop.getIntValue();
     }
 
     public String getCommunicationstyleString() {