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 2016/12/21 14:03:08 UTC

svn commit: r1775422 - /jmeter/trunk/src/components/org/apache/jmeter/assertions/CompareAssertion.java

Author: pmouawad
Date: Wed Dec 21 14:03:08 2016
New Revision: 1775422

URL: http://svn.apache.org/viewvc?rev=1775422&view=rev
Log:
Sonar : Fix code smells

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

Modified: jmeter/trunk/src/components/org/apache/jmeter/assertions/CompareAssertion.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/assertions/CompareAssertion.java?rev=1775422&r1=1775421&r2=1775422&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/assertions/CompareAssertion.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/assertions/CompareAssertion.java Wed Dec 21 14:03:08 2016
@@ -142,17 +142,18 @@ public class CompareAssertion extends Ab
         buf.append("\n\n"); //$NON-NLS-1$
     }
 
-    private String filterString(String content) {
-        if (stringsToSkip == null || stringsToSkip.size() == 0) {
+    private String filterString(final String content) {
+        if (stringsToSkip == null || stringsToSkip.isEmpty()) {
             return content;
         } else {
+            String result = content;
             for (SubstitutionElement regex : stringsToSkip) {
                 emptySub.setSubstitution(regex.getSubstitute());
-                content = Util.substitute(JMeterUtils.getMatcher(), JMeterUtils.getPatternCache().getPattern(regex.getRegex()),
-                        emptySub, content, Util.SUBSTITUTE_ALL);
+                result = Util.substitute(JMeterUtils.getMatcher(), JMeterUtils.getPatternCache().getPattern(regex.getRegex()),
+                        emptySub, result, Util.SUBSTITUTE_ALL);
             }
+            return result;
         }
-        return content;
     }
 
     @Override
@@ -160,10 +161,6 @@ public class CompareAssertion extends Ab
         responses = new LinkedList<>();
     }
 
-    public void iterationEnd(LoopIterationEvent iterEvent) {
-        responses = null;
-    }
-
     /**
      * @return Returns the compareContent.
      */