http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1591 *** shadow/1591 Sun May 20 17:26:34 2001 --- shadow/1591.tmp.5494 Wed Jun 27 09:38:29 2001 *************** *** 1,19 **** ! Bug#: 1591 ! Product: XalanJ2 ! Version: 2.0.0 ! Platform: Sun ! OS/Version: Solaris ! Status: NEW ! Resolution: ! Severity: Normal ! Priority: Medium ! Component: org.apache.xalan.xsltc ! AssignedTo: [EMAIL PROTECTED] ! ReportedBy: [EMAIL PROTECTED] ! URL: ! Cc: ! Summary: xsltc DOMcache not being updated when document modified ! The cached DOM was not being updated after the document was modified, because the getLastModified(uri) method used in DocumentCache.java only works with remote URIs. When the URI is for a local file, the method was returning 0 --- 1,19 ---- ! +============================================================================+ ! | xsltc DOMcache not being updated when document modified | ! +----------------------------------------------------------------------------+ ! | Bug #: 1591 Product: XalanJ2 | ! | Status: NEW Version: 2.0.0 | ! | Resolution: Platform: Sun | ! | Severity: Normal OS/Version: Solaris | ! | Priority: Medium Component: org.apache.xalan.xsltc | ! +----------------------------------------------------------------------------+ ! | Assigned To: [EMAIL PROTECTED] | ! | Reported By: [EMAIL PROTECTED] | ! | CC list: Cc: | ! +----------------------------------------------------------------------------+ ! | URL: | ! +============================================================================+ ! | DESCRIPTION | The cached DOM was not being updated after the document was modified, because the getLastModified(uri) method used in DocumentCache.java only works with remote URIs. When the URI is for a local file, the method was returning 0 *************** *** 87,89 **** --- 87,107 ---- minutes? This check probably isn't needed at all. The DocumentCache program is a quick implementation of caching. According to Morten Jorgensen, more research should be done on caching algorithms and implemented in the future. + + ------- Additional Comments From [EMAIL PROTECTED] 2001-06-27 09:38 ------- + Toms proposed fix may not work since the filename he'll pull out will be + the URI escaped version. Also would be better relying on the internal + string mangling which picks up the protocol/file parts of a URI. + Probably best to do: + + // from start of old fix + if (timestamp == 0){ // get 0 for local URI + if ("file".equals(url.getProtocol())){ + File localfile = new File(UrlDecoder.decode(url.getFile())); + timestamp = localfile.lastModified(); + return (timestamp); + } + return(System.currentTimeMillis()); + }else{ + return(timestamp); + }
