jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1295110 - in /jmeter/trunk: src/monitor/model/org/apache/jmeter/monitor/parser/MonitorHandler.java src/monitor/model/org/apache/jmeter/monitor/parser/ParserImpl.java xdocs/changes.xml
Date Wed, 29 Feb 2012 13:59:01 GMT
Author: sebb
Date: Wed Feb 29 13:59:00 2012
New Revision: 1295110

URL: http://svn.apache.org/viewvc?rev=1295110&view=rev
Log:
Bug 52796 - MonitorHandler fails to clear variables when starting a new parse

Modified:
    jmeter/trunk/src/monitor/model/org/apache/jmeter/monitor/parser/MonitorHandler.java
    jmeter/trunk/src/monitor/model/org/apache/jmeter/monitor/parser/ParserImpl.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/monitor/model/org/apache/jmeter/monitor/parser/MonitorHandler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/monitor/model/org/apache/jmeter/monitor/parser/MonitorHandler.java?rev=1295110&r1=1295109&r2=1295110&view=diff
==============================================================================
--- jmeter/trunk/src/monitor/model/org/apache/jmeter/monitor/parser/MonitorHandler.java (original)
+++ jmeter/trunk/src/monitor/model/org/apache/jmeter/monitor/parser/MonitorHandler.java Wed
Feb 29 13:59:00 2012
@@ -37,48 +37,49 @@ import org.apache.jmeter.monitor.model.W
 public class MonitorHandler extends DefaultHandler {
     // private boolean startDoc = false;
     // private boolean endDoc = false;
-    private Stack<Object> stacktree = new Stack<Object>();
+    private final ObjectFactory factory;
 
-    private ObjectFactory factory = null;
+    private Stack<Object> stacktree;
 
-    private Status status = null;
+    private Status status;
 
-    private Jvm jvm = null;
+    private Jvm jvm;
 
-    private Memory memory = null;
+    private Memory memory;
 
-    private Connector connector = null;
+    private Connector connector;
 
-    private ThreadInfo threadinfo = null;
+    private ThreadInfo threadinfo;
 
-    private RequestInfo requestinfo = null;
+    private RequestInfo requestinfo;
 
-    private Worker worker = null;
+    private Worker worker;
 
-    private Workers workers = null;
+    private Workers workers;
 
-    // private List workerslist = null;
+    // private List workerslist;
 
     /**
      *
      */
-    public MonitorHandler() {
+    public MonitorHandler(ObjectFactory factory) {
         super();
-    }
-
-    /**
-     * Set the ObjectFactory used to create new
-     *
-     * @param factory
-     */
-    public void setObjectFactory(ObjectFactory factory) {
         this.factory = factory;
     }
 
-    /** {@inheritDoc} */
     @Override
     public void startDocument() throws SAXException {
         // this.startDoc = true;
+        // Reset all work variables so reusing the instance starts afresh.
+        this.stacktree = new Stack<Object>();
+        this.status = null;
+        this.jvm = null;
+        this.memory = null;
+        this.connector = null;
+        this.threadinfo = null;
+        this.requestinfo = null;
+        this.worker = null;
+        this.workers = null;   
     }
 
     /** {@inheritDoc} */

Modified: jmeter/trunk/src/monitor/model/org/apache/jmeter/monitor/parser/ParserImpl.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/monitor/model/org/apache/jmeter/monitor/parser/ParserImpl.java?rev=1295110&r1=1295109&r2=1295110&view=diff
==============================================================================
--- jmeter/trunk/src/monitor/model/org/apache/jmeter/monitor/parser/ParserImpl.java (original)
+++ jmeter/trunk/src/monitor/model/org/apache/jmeter/monitor/parser/ParserImpl.java Wed Feb
29 13:59:00 2012
@@ -54,8 +54,7 @@ public abstract class ParserImpl impleme
         try {
             SAXParserFactory parserFactory = SAXParserFactory.newInstance();
             parser = parserFactory.newSAXParser();
-            handler = new MonitorHandler();
-            handler.setObjectFactory(this.FACTORY);
+            handler = new MonitorHandler(this.FACTORY);
         } catch (SAXException e) {
             log.error("Failed to create the parser",e);
         } catch (ParserConfigurationException e) {

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1295110&r1=1295109&r2=1295110&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Wed Feb 29 13:59:00 2012
@@ -72,6 +72,7 @@ When doing replacement of User Defined V
 <ul>
 <li>Bug 52613 - Using Raw Post Body option, text gets encoded</li>
 <li>Bug 52781 - Content-Disposition header garbled even if browser compatible headers
is checked (HC4) </li>
+<li>Bug 52796 - MonitorHandler fails to clear variables when starting a new parse</li>
 </ul>
 
 <h3>Other Samplers</h3>



Mime
View raw message