vgritsenko 02/01/15 10:40:08
Modified: src/java/org/apache/cocoon/matching
RegexpRequestAttributeMatcher.java
RegexpSessionAttributeMatcher.java
WildcardRequestAttributeMatcher.java
WildcardSessionAttributeMatcher.java
Log:
Fix NPE possibilities
Revision Changes Path
1.2 +2 -1
xml-cocoon2/src/java/org/apache/cocoon/matching/RegexpRequestAttributeMatcher.java
Index: RegexpRequestAttributeMatcher.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/matching/RegexpRequestAttributeMatcher.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RegexpRequestAttributeMatcher.java 12 Jan 2002 01:14:33 -0000
1.1
+++ RegexpRequestAttributeMatcher.java 15 Jan 2002 18:40:08 -0000
1.2
@@ -25,7 +25,7 @@
* </table>
*
* @author <a href="mailto:[EMAIL PROTECTED]">Vadim Gritsenko</a>
- * @version CVS $Revision: 1.1 $ $Date: 2002/01/12 01:14:33 $
+ * @version CVS $Revision: 1.2 $ $Date: 2002/01/15 18:40:08 $
*/
public class RegexpRequestAttributeMatcher extends AbstractRegexpMatcher
implements Configurable
@@ -50,6 +50,7 @@
Object result =
ObjectModelHelper.getRequest(objectModel).getAttribute(paramName);
if (result == null) {
getLogger().debug("Request attribute '" + paramName + "' not
set.");
+ return null;
}
return result.toString();
1.2 +2 -1
xml-cocoon2/src/java/org/apache/cocoon/matching/RegexpSessionAttributeMatcher.java
Index: RegexpSessionAttributeMatcher.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/matching/RegexpSessionAttributeMatcher.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RegexpSessionAttributeMatcher.java 12 Jan 2002 01:14:33 -0000
1.1
+++ RegexpSessionAttributeMatcher.java 15 Jan 2002 18:40:08 -0000
1.2
@@ -25,7 +25,7 @@
* </table>
*
* @author <a href="mailto:[EMAIL PROTECTED]">Vadim Gritsenko</a>
- * @version CVS $Revision: 1.1 $ $Date: 2002/01/12 01:14:33 $
+ * @version CVS $Revision: 1.2 $ $Date: 2002/01/15 18:40:08 $
*/
public class RegexpSessionAttributeMatcher extends AbstractRegexpMatcher
implements Configurable
@@ -50,6 +50,7 @@
Object result =
ObjectModelHelper.getRequest(objectModel).getSession().getAttribute(paramName);
if (result == null) {
getLogger().debug("Session attribute '" + paramName + "' not
set.");
+ return null;
}
return result.toString();
1.2 +2 -1
xml-cocoon2/src/java/org/apache/cocoon/matching/WildcardRequestAttributeMatcher.java
Index: WildcardRequestAttributeMatcher.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/matching/WildcardRequestAttributeMatcher.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- WildcardRequestAttributeMatcher.java 12 Jan 2002 01:14:33 -0000
1.1
+++ WildcardRequestAttributeMatcher.java 15 Jan 2002 18:40:08 -0000
1.2
@@ -27,7 +27,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Christian Haul</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Sylvain Wallez</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Vadim Gritsenko</a>
- * @version CVS $Revision: 1.1 $ $Date: 2002/01/12 01:14:33 $
+ * @version CVS $Revision: 1.2 $ $Date: 2002/01/15 18:40:08 $
*/
public class WildcardRequestAttributeMatcher extends AbstractWildcardMatcher
implements Configurable
@@ -52,6 +52,7 @@
Object result =
ObjectModelHelper.getRequest(objectModel).getAttribute(paramName);
if (result == null) {
getLogger().debug("Request attribute '" + paramName + "' not
set.");
+ return null;
}
return result.toString();
1.3 +2 -1
xml-cocoon2/src/java/org/apache/cocoon/matching/WildcardSessionAttributeMatcher.java
Index: WildcardSessionAttributeMatcher.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/matching/WildcardSessionAttributeMatcher.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- WildcardSessionAttributeMatcher.java 12 Jan 2002 01:14:33 -0000
1.2
+++ WildcardSessionAttributeMatcher.java 15 Jan 2002 18:40:08 -0000
1.3
@@ -26,7 +26,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Christian Haul</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Sylvain Wallez</a>
- * @version CVS $Revision: 1.2 $ $Date: 2002/01/12 01:14:33 $
+ * @version CVS $Revision: 1.3 $ $Date: 2002/01/15 18:40:08 $
*/
public class WildcardSessionAttributeMatcher extends AbstractWildcardMatcher
implements Configurable
@@ -51,6 +51,7 @@
Object result =
ObjectModelHelper.getRequest(objectModel).getSession().getAttribute(paramName);
if (result == null) {
getLogger().debug("Session attribute '" + paramName + "' not
set.");
+ return null;
}
return result.toString();
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]