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 2013/01/04 23:02:35 UTC

svn commit: r1429152 - in /jmeter/trunk: src/components/org/apache/jmeter/extractor/RegexExtractor.java xdocs/changes.xml

Author: pmouawad
Date: Fri Jan  4 22:02:35 2013
New Revision: 1429152

URL: http://svn.apache.org/viewvc?rev=1429152&view=rev
Log:
Bug 54375 Regular Expression Extractor : When regex syntax is wrong, post processing is stopped
Bugzilla Id: 54375

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/extractor/RegexExtractor.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/components/org/apache/jmeter/extractor/RegexExtractor.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/extractor/RegexExtractor.java?rev=1429152&r1=1429151&r2=1429152&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/extractor/RegexExtractor.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/extractor/RegexExtractor.java Fri Jan  4 22:02:35 2013
@@ -112,8 +112,9 @@ public class RegexExtractor extends Abst
         }
         Perl5Matcher matcher = JMeterUtils.getMatcher();
         String regex = getRegex();
-        Pattern pattern = JMeterUtils.getPatternCache().getPattern(regex, Perl5Compiler.READ_ONLY_MASK);
+        Pattern pattern = null;
         try {
+            pattern = JMeterUtils.getPatternCache().getPattern(regex, Perl5Compiler.READ_ONLY_MASK);
             List<MatchResult> matches = processMatches(pattern, regex, previousResult, matchNumber, vars);
             int prevCount = 0;
             String prevString = vars.get(refName + REF_MATCH_NR);
@@ -161,7 +162,7 @@ public class RegexExtractor extends Abst
                 log.warn("Error while generating result");
             }
         } catch (MalformedCachePatternException e) {
-            log.warn("Error in pattern: " + regex);
+            log.error("Error in pattern: " + regex);
         } finally {
             clearMatcherMemory(matcher, pattern);
         }
@@ -175,7 +176,9 @@ public class RegexExtractor extends Abst
      */
     private final void clearMatcherMemory(Perl5Matcher matcher, Pattern pattern) {
         try {
-            matcher.matches("", pattern); // $NON-NLS-1$
+            if(pattern != null) {
+                matcher.matches("", pattern); // $NON-NLS-1$
+            }
         } catch (Exception e) {
             // NOOP
         }

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1429152&r1=1429151&r2=1429152&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Fri Jan  4 22:02:35 2013
@@ -166,6 +166,7 @@ and right angle bracket (&gt;) in search
 <h3>Timers, Assertions, Config, Pre- &amp; Post-Processors</h3>
 <ul>
 <li><bugzilla>54058</bugzilla> - In HTTP Request Defaults, the value of field "Embedded URLs must match: is not saved if the check box "Retrieve All  Embedded Resources" is not checked.</li>
+<li><bugzilla>54375</bugzilla> - Regular Expression Extractor : When regex syntax is wrong, post processing is stopped</li>
 </ul>
 
 <h3>Functions</h3>