jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1696257 - /jmeter/trunk/src/components/org/apache/jmeter/extractor/HtmlExtractor.java
Date Mon, 17 Aug 2015 12:13:48 GMT
Author: sebb
Date: Mon Aug 17 12:13:48 2015
New Revision: 1696257

URL: http://svn.apache.org/r1696257
Log:
Simplify - let the outer try block catch the exception
Log the exception string

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

Modified: jmeter/trunk/src/components/org/apache/jmeter/extractor/HtmlExtractor.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/extractor/HtmlExtractor.java?rev=1696257&r1=1696256&r2=1696257&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/extractor/HtmlExtractor.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/extractor/HtmlExtractor.java Mon Aug 17
12:13:48 2015
@@ -120,36 +120,31 @@ public class HtmlExtractor extends Abstr
                 }
             }
             int matchCount=0;// Number of refName_n variable sets to keep
-            try {
-                String match;
-                if (matchNumber >= 0) {// Original match behaviour
-                    match = getCorrectMatch(matches, matchNumber);
+            String match;
+            if (matchNumber >= 0) {// Original match behaviour
+                match = getCorrectMatch(matches, matchNumber);
+                if (match != null) {
+                    vars.put(refName, match);
+                } 
+            } else // < 0 means we save all the matches
+            {
+                matchCount = matches.size();
+                vars.put(refName + REF_MATCH_NR, Integer.toString(matchCount));// Save the
count
+                for (int i = 1; i <= matchCount; i++) {
+                    match = getCorrectMatch(matches, i);
                     if (match != null) {
-                        vars.put(refName, match);
-                    } 
-                } else // < 0 means we save all the matches
-                {
-                    matchCount = matches.size();
-                    vars.put(refName + REF_MATCH_NR, Integer.toString(matchCount));// Save
the count
-                    for (int i = 1; i <= matchCount; i++) {
-                        match = getCorrectMatch(matches, i);
-                        if (match != null) {
-                            final String refName_n = new StringBuilder(refName).append(UNDERSCORE).append(i).toString();
-                            vars.put(refName_n, match);
-                        }
+                        final String refName_n = new StringBuilder(refName).append(UNDERSCORE).append(i).toString();
+                        vars.put(refName_n, match);
                     }
                 }
-                // Remove any left-over variables
-                for (int i = matchCount + 1; i <= prevCount; i++) {
-                    final String refName_n = new StringBuilder(refName).append(UNDERSCORE).append(i).toString();
-                    vars.remove(refName_n);
-                }
-            } catch (RuntimeException e) {
-                log.warn(getName()+":Error while generating result");
             }
-
+            // Remove any left-over variables
+            for (int i = matchCount + 1; i <= prevCount; i++) {
+                final String refName_n = new StringBuilder(refName).append(UNDERSCORE).append(i).toString();
+                vars.remove(refName_n);
+            }
         } catch (RuntimeException e) {
-            log.warn(getName()+":Error while generating result");
+            log.warn(getName()+":Error while generating result " + e);
         }
 
     }



Mime
View raw message