curcuru     2002/12/17 12:23:49

  Modified:    test/java/src/org/apache/qetest FileDatalet.java
  Log:
  setOptions now creates a new Properties(p) defaulting to the properties
  block that was passed in; this guards against testProps getting mistakenly
  mutated by any testlet that comes along
  
  Revision  Changes    Path
  1.7       +15 -5     
xml-xalan/test/java/src/org/apache/qetest/FileDatalet.java
  
  Index: FileDatalet.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/test/java/src/org/apache/qetest/FileDatalet.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- FileDatalet.java  17 Apr 2002 14:56:04 -0000      1.6
  +++ FileDatalet.java  17 Dec 2002 20:23:46 -0000      1.7
  @@ -193,11 +193,21 @@
   
       /** 
        * Accessor method for optional properties; settable.  
  -     * <p>Note this method simply points our options at the 
  -     * caller's Properties; it does not do a clone since that 
  -     * would be quite costly.</p>
  +     * <p>Note this method creates a new Properties that simply 
  +     * defaults to the passed in properties instead of cloning it.</p>
  +     * <p>This used to simply assign this variable to the passed 
  +     * in variable, but that leads to problems when errant 
  +     * Testlets mutate their Datalet's Options, which can result 
  +     * in the master test's testProps getting changed.</p>
  +     *
  +     * @param p Properties to set as our defaults; if null, we 
  +     * do not change anything
        */
  -    public void setOptions(Properties p) { options = p; }
  +    public void setOptions(Properties p) 
  +    { 
  +        if (null != p)
  +            options = new Properties(p);
  +    }
   
   
       /** 
  
  
  

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

Reply via email to