You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2017/12/21 15:16:27 UTC

svn commit: r1818934 - /jmeter/trunk/src/components/org/apache/jmeter/extractor/BoundaryExtractor.java

Author: pmouawad
Date: Thu Dec 21 15:16:27 2017
New Revision: 1818934

URL: http://svn.apache.org/viewvc?rev=1818934&view=rev
Log:
Fix SONAR bugs

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/extractor/BoundaryExtractor.java

Modified: jmeter/trunk/src/components/org/apache/jmeter/extractor/BoundaryExtractor.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/extractor/BoundaryExtractor.java?rev=1818934&r1=1818933&r2=1818934&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/extractor/BoundaryExtractor.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/extractor/BoundaryExtractor.java Thu Dec 21 15:16:27 2017
@@ -114,7 +114,7 @@ public class BoundaryExtractor extends A
             prevCount = removePrevCount(vars, refName);
             List<String> matches = extractMatches(previousResult, vars, matchNumber);
             matchCount = saveMatches(vars, refName, matchNumber, matchCount, matches);
-        } catch (RuntimeException e) {
+        } catch (RuntimeException e) { // NOSONAR
             if (log.isWarnEnabled()) {
                 log.warn("{}: Error while generating result. {}", getName(), e.toString()); // NOSONAR We don't want to be too verbose
             }
@@ -158,15 +158,16 @@ public class BoundaryExtractor extends A
     }
 
     private int saveMatches(JMeterVariables vars, String refName, int matchNumber, int matchCount, List<String> matches) {
+        int localMC = matchCount;
         if (matchNumber == 0) {
             saveRandomMatch(vars, refName, matches);
         } else if (matchNumber > 0) {
             saveOneMatch(vars, refName, matches);
         } else {
-            matchCount = matches.size();
+            localMC = matches.size();
             saveAllMatches(vars, refName, matches);
         }
-        return matchCount;
+        return localMC;
     }
 
     private void saveRandomMatch(JMeterVariables vars, String refName, List<String> matches) {