curcuru     02/02/12 09:59:19

  Modified:    test/java/src/org/apache/qetest/xsl
                        BugzillaTestletDriver.java
  Log:
  Cache a clone() of the system properties instead of just the
  user.dir in case a Bugzilla testlet changes other properties as well
  
  Revision  Changes    Path
  1.3       +8 -5      
xml-xalan/test/java/src/org/apache/qetest/xsl/BugzillaTestletDriver.java
  
  Index: BugzillaTestletDriver.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/test/java/src/org/apache/qetest/xsl/BugzillaTestletDriver.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BugzillaTestletDriver.java        12 Dec 2001 22:07:51 -0000      1.2
  +++ BugzillaTestletDriver.java        12 Feb 2002 17:59:18 -0000      1.3
  @@ -94,7 +94,7 @@
    *
    *
    * @author [EMAIL PROTECTED]
  - * @version $Id: BugzillaTestletDriver.java,v 1.2 2001/12/12 22:07:51 
curcuru Exp $
  + * @version $Id: BugzillaTestletDriver.java,v 1.3 2002/02/12 17:59:18 
curcuru Exp $
    */
   public class BugzillaTestletDriver extends StylesheetTestletDriver
   {
  @@ -399,8 +399,12 @@
           final String USER_DIR = "user.dir";
           try
           {
  -            String cacheDir = System.getProperty(USER_DIR);
  +            // Note: we must actually keep a cloned copy of the 
  +            //  whole system properties block to replace later 
  +            //  in case a Bugzilla testlet changes any other 
  +            //  properties during it's execution
               Properties p = System.getProperties();
  +            Properties cacheProps = (Properties)p.clone();
               // This should, I hope, properly get the correct path 
               //  for what the inputDir would be, whether it's a 
               //  relative or absolute path from where we are now
  @@ -419,9 +423,8 @@
               // Now just execute the Testlet from here
               t.execute(d);
   
  -            // Replace the user.dir to be polite!
  -            p.put(USER_DIR, cacheDir);
  -            System.setProperties(p);
  +            // Replace the system properties to be polite!
  +            System.setProperties(cacheProps);
           } 
           catch (SecurityException se)
           {
  
  
  

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

Reply via email to