[Mono-bugs] [Bug 53872][Wis] New - NullReferenceException in CacheDependency

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 4 Feb 2004 11:42:54 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by mono-bug@jerryweb.info.

http://bugzilla.ximian.com/show_bug.cgi?id=53872

--- shadow/53872	2004-02-04 11:42:54.000000000 -0500
+++ shadow/53872.tmp.13621	2004-02-04 11:42:54.000000000 -0500
@@ -0,0 +1,92 @@
+Bug#: 53872
+Product: Mono/Class Libraries
+Version: unspecified
+OS: GNU/Linux [Other]
+OS Details: Gentoo 1.4
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Sys.Web
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: mono-bug@jerryweb.info               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: NullReferenceException in CacheDependency
+
+NullReferenceException in CacheDependency
+
+Steps to reproduce the problem:
+Execute this ASP.NET page:
+
+==================================================================================
+<%@ Page Language="C#" %>
+<script runat="server" >
+   private string Pokus() {
+      string key = "test";
+      System.Web.Caching.Cache cache =  HttpRuntime.Cache;
+      string retVal = cache[key] as string;
+      if(retVal == null)
+      {
+         Response.Write("retVal = null<br />");
+         retVal = "abcd";
+         CacheDependency cd = new CacheDependency(null, new string[] {
+"/abcd" });
+         cache.Add(
+            key,
+            retVal,
+            null,
+            DateTime.MaxValue,
+            TimeSpan.FromSeconds(10),
+            CacheItemPriority.Default,
+            null);
+         cd = new CacheDependency(null, new string[] { "/defg" });
+         cache.Add(
+            key + "2",
+            retVal,
+            null,
+            DateTime.MaxValue,
+            TimeSpan.FromSeconds(10),
+            CacheItemPriority.Default,
+            null);
+      }
+      return retVal;
+   }
+</script><?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title></title>
+</head>
+<body>
+<p>
+<% Response.Write(Pokus()); %></p>
+</body>
+<html>
+==================================================================================
+
+Actual Results:
+System.NullReferenceException: A null value was found where an object
+instance was required
+in <0x000ff> System.Web.Caching.CacheDependency:.ctor
+(string[],string[],System.Web.Caching.CacheDependency,System.DateTime)
+in <0x0003e> System.Web.Caching.CacheDependency:.ctor (string[],string[])
+in <0x0010c> ASP.test_aspx:Pokus ()
+in <0x0003a> ASP.test_aspx:__RenderTree
+(System.Web.UI.HtmlTextWriter,System.Web.UI.Control)
+in <0x0005a> (wrapper delegate-invoke)
+System.MulticastDelegate:invoke_void_HtmlTextWriter_Control
+(System.Web.UI.HtmlTextWriter,System.Web.UI.Control)
+in <0x00049> System.Web.UI.Control:RenderChildren
+(System.Web.UI.HtmlTextWriter)
+in <0x00011> System.Web.UI.Control:Render (System.Web.UI.HtmlTextWriter)
+in <0x0001c> System.Web.UI.Control:RenderControl (System.Web.UI.HtmlTextWriter)
+in <0x0041f> System.Web.UI.Page:InternalProcessRequest ()
+in <0x0008f> System.Web.UI.Page:ProcessRequest (System.Web.HttpContext)
+in <0x00186> .ExecuteHandlerState:Execute ()
+in <0x00084> .StateMachine:ExecuteState
+(System.Web.HttpApplication/IStateHandler,bool&)