jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1412123 - /jmeter/trunk/src/components/org/apache/jmeter/visualizers/RenderAsRegexp.java
Date Wed, 21 Nov 2012 14:26:08 GMT
Author: sebb
Date: Wed Nov 21 14:26:07 2012
New Revision: 1412123

URL: http://svn.apache.org/viewvc?rev=1412123&view=rev
Log:
Report regex syntax errors direct to the user (not particularly useful to log them).

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/RenderAsRegexp.java

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/RenderAsRegexp.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/RenderAsRegexp.java?rev=1412123&r1=1412122&r2=1412123&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/RenderAsRegexp.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/RenderAsRegexp.java Wed Nov
21 14:26:07 2012
@@ -44,6 +44,7 @@ import org.apache.jmeter.samplers.Sample
 import org.apache.jmeter.util.JMeterUtils;
 import org.apache.jorphan.gui.GuiUtils;
 import org.apache.jorphan.gui.JLabeledTextField;
+import org.apache.oro.text.MalformedCachePatternException;
 import org.apache.oro.text.PatternCacheLRU;
 import org.apache.oro.text.regex.MatchResult;
 import org.apache.oro.text.regex.Pattern;
@@ -116,7 +117,12 @@ public class RenderAsRegexp implements R
         PatternMatcherInput input = new PatternMatcherInput(textToParse);
 
         PatternCacheLRU pcLRU = new PatternCacheLRU();
-        Pattern pattern = pcLRU.getPattern(regexpField.getText(), Perl5Compiler.READ_ONLY_MASK);
+        Pattern pattern;
+        try {
+            pattern = pcLRU.getPattern(regexpField.getText(), Perl5Compiler.READ_ONLY_MASK);
+        } catch (MalformedCachePatternException e) {
+            return e.toString();
+        }
         List<MatchResult> matches = new LinkedList<MatchResult>();
         while (matcher.contains(input, pattern)) {
             matches.add(matcher.getMatch());



Mime
View raw message