jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1462788 - /jmeter/trunk/src/components/org/apache/jmeter/visualizers/RenderAsHTML.java
Date Sat, 30 Mar 2013 15:58:19 GMT
Author: pmouawad
Date: Sat Mar 30 15:58:18 2013
New Revision: 1462788

URL: http://svn.apache.org/r1462788
Log:
https://issues.apache.org/bugzilla/show_bug.cgi?id=54586
Display exception to indicate parsing
Bugzilla Id: 54586

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

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/RenderAsHTML.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/RenderAsHTML.java?rev=1462788&r1=1462787&r2=1462788&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/RenderAsHTML.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/RenderAsHTML.java Sat Mar 30
15:58:18 2013
@@ -32,8 +32,11 @@ import javax.swing.text.html.HTMLEditorK
 
 import org.apache.jmeter.samplers.SampleResult;
 import org.apache.jmeter.util.JMeterUtils;
+import org.apache.jorphan.logging.LoggingManager;
+import org.apache.log.Logger;
 
 public class RenderAsHTML extends SamplerResultTab implements ResultRenderer {
+    private static final Logger log = LoggingManager.getLoggerForClass();
 
     private static final String TEXT_HTML = "text/html"; // $NON-NLS-1$
 
@@ -104,7 +107,14 @@ public class RenderAsHTML extends Sample
             results.setText("Failed to parse HTML: " + rte.getMessage());
         }
         results.setCaretPosition(0);
-        resultsScrollPane.setViewportView(results);
+        try {
+            resultsScrollPane.setViewportView(results);
+        } catch (NumberFormatException e) {
+            // Java Bug : http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=9001188.
+            // See https://issues.apache.org/bugzilla/show_bug.cgi?id=54586
+            log.warn("An error occured rendering html code", e);
+            results.setText("Failed to render HTML: " + e.getMessage() +", use Text renderer");
           
+        }
     }
 
     private static class LocalHTMLEditorKit extends HTMLEditorKit {



Mime
View raw message