https://issues.apache.org/bugzilla/show_bug.cgi?id=51745
Bug #: 51745
Summary: getLastModified of compilation context returns 0 on
Android and it issues all time recompilation
Product: Tomcat 7
Version: 7.0.20
Platform: Other
OS/Version: other
Status: NEW
Severity: normal
Priority: P2
Component: Jasper
AssignedTo: [email protected]
ReportedBy: [email protected]
Classification: Unclassified
URLConnection implementation
org.apache.harmony.luni.internal.net.www.protocol.file.FileURLConnection
returns 0 for getLastModified and it breaks normal working of the wrapper
method in compilation context. It seems happens on Android platfrom 2.1 and can
happen for other. So I modified the method to avoid the problem like below:
try {
URL jspUrl = getResource(resource);
if (jspUrl == null) {
incrementRemoved();
return Long.valueOf(result);
}
File resFile = new File(jspUrl.getFile()); // TJWS on Android
if (resFile.exists()) {
result = resFile.lastModified();
} else {
uc = jspUrl.openConnection();
if (uc instanceof JarURLConnection) {
result = ((JarURLConnection) uc).getJarEntry().getTime();
} else {
result = uc.getLastModified();
}
}
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]