jsalvata    2004/02/09 14:00:16

  Modified:    src/core/org/apache/jmeter/config Arguments.java
  Log:
  Make config elements work for Arguments in cases where
  Arguments are actually a key->value map (such as for
  the Java Sampler.) (That's oposed to when Arguments is
  a set of {key,value} pairs, as in the HTTPSampler.)
  
  PR: 26605
  
  Revision  Changes    Path
  1.8       +6 -2      jakarta-jmeter/src/core/org/apache/jmeter/config/Arguments.java
  
  Index: Arguments.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/config/Arguments.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Arguments.java    29 Sep 2003 14:56:01 -0000      1.7
  +++ Arguments.java    9 Feb 2004 22:00:16 -0000       1.8
  @@ -131,7 +131,11 @@
           while (iter.hasNext())
           {
               Argument arg = (Argument) iter.next().getObjectValue();
  -            argMap.put(arg.getName(), arg.getValue());
  +            // Because CollectionProperty.mergeIn will not prevent adding two
  +            // properties of the same name, we need to select the first value so
  +            // that this element's values prevail over defaults provided by 
configuration
  +            // elements:
  +            if (! argMap.containsKey(arg.getName())) argMap.put(arg.getName(), 
arg.getValue());
           }
           return argMap;
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to