You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by sy...@apache.org on 2004/10/11 12:52:54 UTC
svn commit: rev 54558 - cocoon/trunk/src/java/org/apache/cocoon/matching
Author: sylvain
Date: Mon Oct 11 03:52:53 2004
New Revision: 54558
Modified:
cocoon/trunk/src/java/org/apache/cocoon/matching/MountTableMatcher.java
Log:
Fix bug #31637 : NPE when mounttable source has no validity
Modified: cocoon/trunk/src/java/org/apache/cocoon/matching/MountTableMatcher.java
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/matching/MountTableMatcher.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/matching/MountTableMatcher.java Mon Oct 11 03:52:53 2004
@@ -72,7 +72,7 @@
* table, but not fail if it does not exist.
*
* @author <a href="http://www.apache.org/~sylvain/">Sylvain Wallez</a>
- * @version CVS $Id: MountTableMatcher.java,v 1.7 2004/03/05 13:02:56 bdelacretaz Exp $
+ * @version CVS $Id$
*/
public class MountTableMatcher extends AbstractLogEnabled implements Matcher, ThreadSafe, Serviceable, Parameterizable {
@@ -110,13 +110,16 @@
if (values != null) {
// Check validity
SourceValidity oldValidity = (SourceValidity)values[1];
- int valid = oldValidity.isValid();
- if (valid == 1) {
+
+ int valid = oldValidity != null ? oldValidity.isValid() : SourceValidity.INVALID;
+
+ if (valid == SourceValidity.VALID) {
// Valid without needing the new validity
return (Map)values[0];
}
- if (valid == 0 && oldValidity.isValid(source.getValidity()) == 1) {
+ if (valid == SourceValidity.UNKNOWN &&
+ oldValidity.isValid(source.getValidity()) == SourceValidity.VALID) {
// Valid after comparing with the new validity
return (Map)values[0];
}