velocity-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject cvs commit: jakarta-velocity/src/java/org/apache/velocity/runtime Runtime.java
Date Tue, 06 Mar 2001 19:26:26 GMT
geirm       01/03/06 11:26:25

  Modified:    src/java/org/apache/velocity/runtime Runtime.java
  Log:
  Tiny fix for small bug noticed by David Esposito <esposito@newnetco.com>
  
  Simply protects the other Runtime.init() methods to prevent the properties
  from being set twice - the Configuration class converts scalar values
  to vector values if the same property is set twice.
  
  This can happen if you call init( filename ) or init( Properties ) more
  than once - ex, a mult-servlet webapp when the servlet is based on
  the VelocityServlet base class.
  
  It's also good to protect ourselves this way from any application type.
  
  This will fix it for any servlet user until Jason gets the Configuration
  fixed (he knows about it...)
  
  Revision  Changes    Path
  1.92      +11 -5     jakarta-velocity/src/java/org/apache/velocity/runtime/Runtime.java
  
  Index: Runtime.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/Runtime.java,v
  retrieving revision 1.91
  retrieving revision 1.92
  diff -u -r1.91 -r1.92
  --- Runtime.java	2001/03/05 11:45:08	1.91
  +++ Runtime.java	2001/03/06 19:26:24	1.92
  @@ -172,7 +172,7 @@
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
    * @author <a href="mailto:jlb@houseofdistraction.com">Jeff Bowden</a>
    * @author <a href="mailto:geirm@optonline.net">Geir Magusson Jr.</a>
  - * @version $Id: Runtime.java,v 1.91 2001/03/05 11:45:08 jvanzyl Exp $
  + * @version $Id: Runtime.java,v 1.92 2001/03/06 19:26:24 geirm Exp $
    */
   public class Runtime implements RuntimeConstants
   {    
  @@ -297,8 +297,11 @@
       public synchronized static void init( Properties props )
           throws Exception
       {
  -        overridingProperties = props;
  -        init();
  +        if( initialized == false )
  +        {
  +            overridingProperties = props;
  +            init();
  +        }
       }
   
       /**
  @@ -311,8 +314,11 @@
       public synchronized static void init( String props )
           throws Exception
       {
  -        setProperties(props);
  -        init();
  +        if (initialized == false)
  +        {
  +            setProperties(props);
  +            init();
  +        }
       }
   
       /**
  
  
  

Mime
View raw message