Return-Path: Delivered-To: apmail-xml-cocoon-cvs-archive@xml.apache.org Received: (qmail 66536 invoked by uid 500); 11 Sep 2002 12:44:00 -0000 Mailing-List: contact cocoon-cvs-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: cocoon-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cocoon-cvs@xml.apache.org Received: (qmail 66527 invoked by uid 500); 11 Sep 2002 12:43:59 -0000 Delivered-To: apmail-xml-cocoon2-cvs@apache.org Date: 11 Sep 2002 12:43:58 -0000 Message-ID: <20020911124358.70663.qmail@icarus.apache.org> From: sylvain@apache.org To: xml-cocoon2-cvs@apache.org Subject: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/generation AbstractServerPage.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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 @@ + + AbstractServerPages used static fields for dependency tracking, which caused + either non-modified XSPs to be recompiled, or modified XSPs not to be recompiled. + SearchGenerator now includes <field name=""/> elements into <hit/> 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 extends XSPGenerator { - static { - dateCreated = L; - dependencies = new File[] { + // Files this XSP depends on + private static File[] _dependentFiles = new File[] { new File(""), }; + + // Initialize attributes used by modifiedSince() (see AbstractServerPage) + { + this.dateCreated = 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 ComponentManager that should ---------------------------------------------------------------------- In case of troubles, e-mail: webmaster@xml.apache.org To unsubscribe, e-mail: cocoon-cvs-unsubscribe@xml.apache.org For additional commands, e-mail: cocoon-cvs-help@xml.apache.org