sylvain     2002/09/11 05:43:58

  Modified:    .        Tag: cocoon_2_0_3_branch changes.xml
               src/java/org/apache/cocoon/acting Tag: cocoon_2_0_3_branch
                        SessionPropagatorAction.java
               src/java/org/apache/cocoon/components/language/generator
                        Tag: cocoon_2_0_3_branch ProgramGeneratorImpl.java
               src/java/org/apache/cocoon/components/language/markup/xsp/java
                        Tag: cocoon_2_0_3_branch xsp.xsl
               src/java/org/apache/cocoon/generation Tag:
                        cocoon_2_0_3_branch AbstractServerPage.java
  Log:
  Fix a nasty bug in XSP recompilation : static fields were used for dependencies, 
meaning their value was shared by *all* XSP pages.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.138.2.48 +5 -1      xml-cocoon2/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/changes.xml,v
  retrieving revision 1.138.2.47
  retrieving revision 1.138.2.48
  diff -u -r1.138.2.47 -r1.138.2.48
  --- changes.xml       6 Sep 2002 03:35:33 -0000       1.138.2.47
  +++ changes.xml       11 Sep 2002 12:43:57 -0000      1.138.2.48
  @@ -39,6 +39,10 @@
    </devs>
   
    <release version="@version@" date="@date@">
  +  <action dev="SW" type="fix">
  +    AbstractServerPages used static fields for dependency tracking, which caused
  +    either non-modified XSPs to be recompiled, or modified XSPs not to be 
recompiled.
  +  </action>
     <action dev="VG" type="update">
       SearchGenerator now includes &lt;field name=""/&gt; elements into &lt;hit/&gt;
       element. These elements contain stored fields of a found Document,
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.7.2.1   +2 -2      
xml-cocoon2/src/java/org/apache/cocoon/acting/SessionPropagatorAction.java
  
  Index: SessionPropagatorAction.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/acting/SessionPropagatorAction.java,v
  retrieving revision 1.7
  retrieving revision 1.7.2.1
  diff -u -r1.7 -r1.7.2.1
  --- SessionPropagatorAction.java      22 Feb 2002 06:59:26 -0000      1.7
  +++ SessionPropagatorAction.java      11 Sep 2002 12:43:58 -0000      1.7.2.1
  @@ -84,7 +84,7 @@
   public class SessionPropagatorAction extends AbstractConfigurableAction implements 
ThreadSafe
   {
   
  -    private static Object[] defaults = {};
  +    private Object[] defaults = {};
   
       public void configure(Configuration conf) throws ConfigurationException {
           if (conf != null) {
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.15.2.3  +4 -2      
xml-cocoon2/src/java/org/apache/cocoon/components/language/generator/ProgramGeneratorImpl.java
  
  Index: ProgramGeneratorImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/generator/ProgramGeneratorImpl.java,v
  retrieving revision 1.15.2.2
  retrieving revision 1.15.2.3
  diff -u -r1.15.2.2 -r1.15.2.3
  --- ProgramGeneratorImpl.java 25 Jul 2002 14:00:31 -0000      1.15.2.2
  +++ ProgramGeneratorImpl.java 11 Sep 2002 12:43:58 -0000      1.15.2.3
  @@ -260,7 +260,9 @@
               if (programInstance != null && this.autoReload) {
                   // Autoreloading: Unload program if its source is modified
                   long lastModified = source.getLastModified();
  -                if (lastModified == 0 || 
programInstance.modifiedSince(lastModified)) {
  +                // Note : lastModified can be 0 if source is dynamically generated.
  +                // In that case, let the program instance decide if it is modified 
or not.
  +                if (programInstance.modifiedSince(lastModified)) {
                       // Release the component.
                       release(programInstance);
                       programInstance = null;
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.9.2.3   +9 -5      
xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl
  
  Index: xsp.xsl
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl,v
  retrieving revision 1.9.2.2
  retrieving revision 1.9.2.3
  diff -u -r1.9.2.2 -r1.9.2.3
  --- xsp.xsl   2 Aug 2002 02:18:06 -0000       1.9.2.2
  +++ xsp.xsl   11 Sep 2002 12:43:58 -0000      1.9.2.3
  @@ -133,13 +133,17 @@
        */
       public class <xsl:value-of select="@file-name"/> extends XSPGenerator {
   
  -        static {
  -            dateCreated = <xsl:value-of select="@creation-date"/>L;
  -            dependencies = new File[] {
  +        // Files this XSP depends on
  +        private static File[] _dependentFiles = new File[] {
             <xsl:for-each select="//xsp:dependency">
                     new File("<xsl:value-of select="translate(., '\','/')"/>"),
                   </xsl:for-each>
               };
  +
  +        // Initialize attributes used by modifiedSince() (see AbstractServerPage)
  +        {
  +            this.dateCreated = <xsl:value-of select="@creation-date"/>L;
  +            this.dependencies = _dependentFiles;
           }
   
           /* Built-in parameters available for use */
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.8.2.1   +8 -8      
xml-cocoon2/src/java/org/apache/cocoon/generation/AbstractServerPage.java
  
  Index: AbstractServerPage.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/generation/AbstractServerPage.java,v
  retrieving revision 1.8
  retrieving revision 1.8.2.1
  diff -u -r1.8 -r1.8.2.1
  --- AbstractServerPage.java   7 Apr 2002 18:48:12 -0000       1.8
  +++ AbstractServerPage.java   11 Sep 2002 12:43:58 -0000      1.8.2.1
  @@ -74,24 +74,24 @@
   public abstract class AbstractServerPage
     extends ServletGenerator implements CompiledComponent, Cacheable, Recomposable {
       /**
  -     * Code generators should produce a static
  +     * Code generators should produce a constructor
        * block that initializes the generator's
        * creation date and file dependency list.
        * Example:
        *
  -     *  static {
  -     *    dateCreated = 958058788948L;
  -     *    dependencies = new File[] {
  -     *      new File("source.xml"),
  +     *  {
  +     *    this.dateCreated = 958058788948L;
  +     *    this.dependencies = new File[] {
  +     *      new File("source.xml")
        *    };
        *  }
        *
        */
   
       /** The creation date */
  -    protected static long dateCreated = -1L;
  +    protected long dateCreated = -1L;
       /** The dependency file list */
  -    protected static File[] dependencies = null;
  +    protected File[] dependencies = null;
   
       /**
        * Recompose with the actual <code>ComponentManager</code> that should
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to