Skip to content
This repository was archived by the owner on Aug 17, 2018. It is now read-only.

Commit 454d89f

Browse files
author
Kin Man Chung
committed
TldScanner leaves jar files opened, causing undeploy to fail in Windows. svn path=/trunk/; revision=1375
1 parent 265706b commit 454d89f

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

impl/src/main/java/org/apache/jasper/runtime/TldScanner.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,11 @@ private void scanJar(JarURLConnection conn, List<String> tldNames,
426426

427427
// Optimize for most common cases: jars known to NOT have tlds
428428
if (tldInfos != null && tldInfos.length == 0) {
429+
try {
430+
conn.getJarFile().close();
431+
} catch (IOException ex) {
432+
//ignored
433+
}
429434
return;
430435
}
431436

@@ -434,7 +439,6 @@ private void scanJar(JarURLConnection conn, List<String> tldNames,
434439
JarFile jarFile = null;
435440
ArrayList<TldInfo> tldInfoA = new ArrayList<TldInfo>();
436441
try {
437-
conn.setUseCaches(false);
438442
jarFile = conn.getJarFile();
439443
if (tldNames != null) {
440444
for (String tldName : tldNames) {
@@ -681,6 +685,7 @@ private void scanJars() throws Exception {
681685
}
682686
}
683687
if (jconn != null) {
688+
jconn.setUseCaches(false);
684689
if (isLocal) {
685690
// For local jars, collect the jar files in the
686691
// Manifest Class-Path, to be scanned later.
@@ -700,6 +705,7 @@ private void scanJars() throws Exception {
700705
URL jarURL = new URL("jar:" + jar + "!/");
701706
JarURLConnection jconn =
702707
(JarURLConnection) jarURL.openConnection();
708+
jconn.setUseCaches(false);
703709
if (addManifestClassPath(extraJars,newJars,jconn)){
704710
scanJar(jconn, null, true);
705711
}

0 commit comments

Comments
 (0)