geirm       01/03/14 20:39:28

  Modified:    src/java/org/apache/velocity/runtime/resource
                        ResourceManager.java
  Log:
  Moved the 'how old' precheck, as the new multi-path managment stuff prevents
  us from knowing until the resource is processed.  This brings back the problem
  that the resource *can* change between load and timestamp getting, but
  that is improbable, and we will revisit later. (too tired...)
  
  Revision  Changes    Path
  1.17      +15 -10    
jakarta-velocity/src/java/org/apache/velocity/runtime/resource/ResourceManager.java
  
  Index: ResourceManager.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/resource/ResourceManager.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- ResourceManager.java      2001/03/14 22:07:46     1.16
  +++ ResourceManager.java      2001/03/15 04:39:28     1.17
  @@ -77,7 +77,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Paulo Gaspar</a>
  - * @version $Id: ResourceManager.java,v 1.16 2001/03/14 22:07:46 jvanzyl Exp $
  + * @version $Id: ResourceManager.java,v 1.17 2001/03/15 04:39:28 geirm Exp $
    */
   public class ResourceManager
   {
  @@ -318,15 +318,20 @@
                       Runtime.info("Attempting to find " + resourceName + 
                           " with " + resourceLoader.getClassName());
                       
  -                    /*
  -                     *  read how old the resource is _before_
  -                     *  processing (=>reading) it
  -                     */
  -
  -                    howOldItWas = resourceLoader.getLastModified( resource );
  -
  + 
                       if (resource.process())
  +                    {
  +                        /*
  +                         *  FIXME  (gmj)
  +                         *  moved in here - technically still a problem - but the 
resource needs to be 
  +                         *  processed before the loader can figure it out due to to 
the new 
  +                         *  multi-path support - will revisit and fix
  +                         */
  +
  +                        howOldItWas = resourceLoader.getLastModified( resource );
                           break;
  +                    }
  +
                   }
                   
                   /*
  @@ -334,9 +339,9 @@
                    */
                   if (resource.getData() == null)
                       throw new ResourceNotFoundException("Can't find " + 
resourceName + "!");
  -                
  +
                   resource.setLastModified( howOldItWas );
  -                
  +                 
                   resource.setModificationCheckInterval(
                       resourceLoader.getModificationCheckInterval());
                   
  
  
  

Reply via email to