Polish "Make JarURLConnection return entry's last modified time"

Closes gh-9893
This commit is contained in:
Andy Wilkinson
2017-07-28 15:40:25 +01:00
parent 7c7259beec
commit b7ac5f2eb2

View File

@@ -237,16 +237,15 @@ final class JarURLConnection extends java.net.JarURLConnection {
@Override
public long getLastModified() {
int defaultTime = 0;
if (this.jarFile == null || this.jarEntryName.isEmpty()) {
return defaultTime;
return 0;
}
try {
JarEntry entry = getJarEntry();
return (entry == null ? defaultTime : entry.getTime());
return (entry == null ? 0 : entry.getTime());
}
catch (IOException ex) {
return defaultTime;
return 0;
}
}