jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: svn commit: r1240583 - /jmeter/trunk/src/components/org/apache/jmeter/visualizers/BSFListener.java
Date Sat, 04 Feb 2012 23:35:01 GMT
On 4 February 2012 18:34,  <pmouawad@apache.org> wrote:
> Author: pmouawad
> Date: Sat Feb  4 18:34:15 2012
> New Revision: 1240583
>
> URL: http://svn.apache.org/viewvc?rev=1240583&view=rev
> Log:
> Ensure terminate is called

Good catch.

BTW, no harm in having separate commits for each of these, but since
the same (simple) change was made to each, a combined commit would be
OK as well.

> Modified:
>    jmeter/trunk/src/components/org/apache/jmeter/visualizers/BSFListener.java
>
> Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/BSFListener.java
> URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/BSFListener.java?rev=1240583&r1=1240582&r2=1240583&view=diff
> ==============================================================================
> --- jmeter/trunk/src/components/org/apache/jmeter/visualizers/BSFListener.java (original)
> +++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/BSFListener.java Sat Feb
 4 18:34:15 2012
> @@ -37,8 +37,9 @@ public class BSFListener extends BSFTest
>     private static final long serialVersionUID = 234L;
>
>     public void sampleOccurred(SampleEvent event) {
> +        BSFManager mgr =null;
>         try {
> -            BSFManager mgr = getManager();
> +            mgr = getManager();
>             if (mgr == null) {
>                 log.error("Problem creating BSF manager");
>                 return;
> @@ -47,9 +48,12 @@ public class BSFListener extends BSFTest
>             SampleResult result = event.getResult();
>             mgr.declareBean("sampleResult", result, SampleResult.class);
>             processFileOrScript(mgr);
> -            mgr.terminate();
>         } catch (BSFException e) {
>             log.warn("Problem in BSF script "+e);
> +        } finally {
> +            if (mgr != null) {
> +                mgr.terminate();
> +            }
>         }
>     }
>
>
>

Mime
View raw message