stephan 2002/07/26 05:43:23
Modified: src/scratchpad/src/org/apache/cocoon/generation
TextParserGenerator.java
src/scratchpad/src/org/apache/cocoon/components/source/impl
SlideSource.java
Log:
A exception occurs if a null SourceValidity were added to an
AggregatedValidity
(http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11202).
Corrected the implemenation of getValidity from the SlideSource.
Revision Changes Path
1.4 +11 -3
xml-cocoon2/src/scratchpad/src/org/apache/cocoon/generation/TextParserGenerator.java
Index: TextParserGenerator.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/generation/TextParserGenerator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TextParserGenerator.java 24 Jul 2002 16:46:08 -0000 1.3
+++ TextParserGenerator.java 26 Jul 2002 12:43:23 -0000 1.4
@@ -214,9 +214,17 @@
* component is currently not cacheable.
*/
public SourceValidity generateValidity() {
+ SourceValidity inputsourcevalidity = this.inputSource.getValidity();
+ SourceValidity grammarsourcevalidity =
this.grammarSource.getValidity();
+
+ if ((inputsourcevalidity==null) && (grammarsourcevalidity==null))
+ return null;
+
AggregatedValidity validity = new AggregatedValidity();
- validity.add(this.inputSource.getValidity());
- validity.add(this.grammarSource.getValidity());
+ if (inputsourcevalidity!=null)
+ validity.add(inputsourcevalidity);
+ if (grammarsourcevalidity!=null)
+ validity.add(grammarsourcevalidity);
return validity;
}
1.13 +6 -2
xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/SlideSource.java
Index: SlideSource.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/SlideSource.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- SlideSource.java 21 Jul 2002 22:50:55 -0000 1.12
+++ SlideSource.java 26 Jul 2002 12:43:23 -0000 1.13
@@ -305,12 +305,15 @@
* <code>null</code> is returned.
*/
public SourceValidity getValidity() {
+
try {
- if ((validity!=null) && (this.revisionDescriptor!=null)) {
+ if ((this.validity==null) && (this.revisionDescriptor!=null)) {
this.validity = new TimeStampValidity(
this.revisionDescriptor.getLastModifiedAsDate().getTime());
}
} catch (Exception e) {
+ getLogger().debug("Could not create SourceValidity", e);
+
return null;
}
return this.validity;
@@ -321,6 +324,7 @@
* content has changed.
*/
public void discardValidity() {
+
this.validity = null;
}
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]