geirm       00/11/26 21:34:43

  Modified:    src/java/org/apache/velocity/runtime Runtime.java
  Log:
  Changed how setDefaultProperites() behaved to be backwards compatible for current 
use in Torque / Turbine.
  
  Revision  Changes    Path
  1.56      +14 -4     
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.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- Runtime.java      2000/11/27 05:00:50     1.55
  +++ Runtime.java      2000/11/27 05:34:42     1.56
  @@ -160,7 +160,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Jeff Bowden</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Geir Magusson Jr.</a>
  - * @version $Id: Runtime.java,v 1.55 2000/11/27 05:00:50 geirm Exp $
  + * @version $Id: Runtime.java,v 1.56 2000/11/27 05:34:42 geirm Exp $
    */
   public class Runtime implements RuntimeConstants
   {
  @@ -270,10 +270,10 @@
               return;
           
           /*
  -         *  set the default properties
  +         *  set the default properties, and don't call assembleSourceInitializers()
            */
   
  -        setDefaultProperties();
  +        setDefaultProperties( false);
   
           /*
            *  now add the new ones from the calling app
  @@ -308,7 +308,7 @@
            *  life easy for users.
            */
           
  -        setDefaultProperties();
  +        setDefaultProperties( false );
                            
           /*
            * if we were passed propertis, try loading propertiesFile as a straight 
file first,
  @@ -494,13 +494,23 @@
        * The properties file may be in the file system proper,
        * or the properties file may be in the classpath.
        */
  +
       public static void setDefaultProperties()
       {
  +        setDefaultProperties( true );
  +    }
  +
  +    private  static void setDefaultProperties( boolean doAssoc)
  +    {
           ClassLoader classLoader = Runtime.class.getClassLoader();
           try
           {
               InputStream inputStream = classLoader.getResourceAsStream( 
DEFAULT_RUNTIME_PROPERTIES );
               VelocityResources.setPropertiesInputStream( inputStream );
  +
  +            if (doAssoc)
  +                assembleSourceInitializers();
  +
               info ("Default Properties File: " + new 
File(DEFAULT_RUNTIME_PROPERTIES).getPath());
           }
           catch (IOException ioe)
  
  
  

Reply via email to