geirm       01/09/16 16:57:46

  Modified:    src/java/org/apache/velocity/runtime RuntimeInstance.java
               src/java/org/apache/velocity/util/introspection
                        Introspector.java
  Log:
  Stupid bug on my part, I never called the init() method to give
  the Introspector a RuntimeServices.  Eliminated that method, and
  just put it in the CTOR so that mistake isn't made again.
  
  Revision  Changes    Path
  1.4       +6 -2      
jakarta-velocity/src/java/org/apache/velocity/runtime/RuntimeInstance.java
  
  Index: RuntimeInstance.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/RuntimeInstance.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RuntimeInstance.java      2001/09/09 21:47:35     1.3
  +++ RuntimeInstance.java      2001/09/16 23:57:46     1.4
  @@ -143,7 +143,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: RuntimeInstance.java,v 1.3 2001/09/09 21:47:35 geirm Exp $
  + * @version $Id: RuntimeInstance.java,v 1.4 2001/09/16 23:57:46 geirm Exp $
    */
   public class RuntimeInstance implements RuntimeConstants, RuntimeServices
   {    
  @@ -231,7 +231,11 @@
   
           resourceManager = new ResourceManager( this );
           
  -        introspector = new Introspector();
  +        /*
  +         *  make an new introspector and initialize it
  +         */
  +         
  +        introspector = new Introspector( this );
       }
   
       /*
  
  
  
  1.15      +14 -7     
jakarta-velocity/src/java/org/apache/velocity/util/introspection/Introspector.java
  
  Index: Introspector.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/util/introspection/Introspector.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Introspector.java 2001/09/11 17:47:52     1.14
  +++ Introspector.java 2001/09/16 23:57:46     1.15
  @@ -89,10 +89,18 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Bob McWhirter</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Attila Szegedi</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Paulo Gaspar</a>
  - * @version $Id: Introspector.java,v 1.14 2001/09/11 17:47:52 geirm Exp $
  + * @version $Id: Introspector.java,v 1.15 2001/09/16 23:57:46 geirm Exp $
    */
   public class Introspector
   {
  +    /*
  +     *  define a public string so that it can be looked for
  +     *  if interested
  +     */
  +     
  +    public final static String CACHEDUMP_MSG = 
  +        "Introspector : detected classloader change. Dumping cache.";
  +    
       private RuntimeServices rsvc = null;
   
       /**
  @@ -110,7 +118,7 @@
       /**
        *  Recieves our RuntimeServices object
        */
  -    public void init( RuntimeServices r )
  +    public Introspector( RuntimeServices r )
       {
           this.rsvc = r;
       }
  @@ -143,7 +151,7 @@
                */
                
               if (classMap == null)
  -            {
  +            {                
                   if ( cachedClassNames.contains( c.getName() ))
                   {
                       /*
  @@ -151,9 +159,8 @@
                        * this class we are looking at.  This implies a 
                        * classloader change, so dump
                        */
  -                     
  -                    clearCache();
  -                    rsvc.info("Introspector : detected classloader change. Dumping 
cache.");
  +                    clearCache();                    
  +                    rsvc.info( CACHEDUMP_MSG );
                   }
                    
                   classMap = createClassMap(c);
  @@ -169,7 +176,7 @@
        * for later Classloader change detection.
        */
       private ClassMap createClassMap(Class c)
  -    {
  +    {        
           ClassMap classMap = new ClassMap(c);        
           classMethodMaps.put(c, classMap);
           cachedClassNames.add( c.getName() );
  
  
  

Reply via email to