cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sylv...@apache.org
Subject svn commit: rev 54557 - cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/matching
Date Mon, 11 Oct 2004 10:48:34 GMT
Author: sylvain
Date: Mon Oct 11 03:48:33 2004
New Revision: 54557

Modified:
   cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/matching/MountTableMatcher.java
Log:
Fix bug #31637 : NPE when mounttable source has no validity

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/matching/MountTableMatcher.java
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/matching/MountTableMatcher.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/matching/MountTableMatcher.java
Mon Oct 11 03:48:33 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];
             }

Mime
View raw message