You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2004/02/22 20:13:15 UTC

cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/testelement/property FunctionProperty.java

sebb        2004/02/22 11:13:15

  Modified:    src/core/org/apache/jmeter/testelement/property
                        FunctionProperty.java
  Log:
  Only fetch context once per method
  
  Revision  Changes    Path
  1.14      +6 -4      jakarta-jmeter/src/core/org/apache/jmeter/testelement/property/FunctionProperty.java
  
  Index: FunctionProperty.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/testelement/property/FunctionProperty.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- FunctionProperty.java	13 Feb 2004 02:21:38 -0000	1.13
  +++ FunctionProperty.java	22 Feb 2004 19:13:15 -0000	1.14
  @@ -20,6 +20,7 @@
   
   import org.apache.jmeter.engine.util.CompoundVariable;
   import org.apache.jmeter.testelement.TestElement;
  +import org.apache.jmeter.threads.JMeterContext;
   import org.apache.jmeter.threads.JMeterContextService;
   
   /**
  @@ -76,8 +77,9 @@
       {
           log.debug("Calling getStringValue from FunctionProperty");
           log.debug("boogedy boogedy");
  +        JMeterContext ctx = JMeterContextService.getContext();//Expensive, so do once
           if (!isRunningVersion()
  -            || !JMeterContextService.getContext().isSamplingStarted())
  +            || !ctx.isSamplingStarted())
           {
               log.debug("Not running version, return raw function string");
               return function.getRawParameters();
  @@ -86,7 +88,7 @@
           {
               log.debug("Running version, executing function");
               int iter =
  -                JMeterContextService.getContext().getVariables().getIteration();
  +                ctx.getVariables().getIteration();
               if (iter < testIteration)
               {
                   testIteration = -1;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org