ASF Bugzilla – Attachment 23819 Details for
Bug 47377
[Patch] Make ClassFinder more robust and close zipfile resources
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
ClassFinder.java.patch (text/plain), 1.49 KB, created by
benoit.wiart
on 2009-06-16 12:42:50 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
benoit.wiart
Created:
2009-06-16 12:42:50 UTC
Size:
1.49 KB
patch
obsolete
>Index: src/jorphan/org/apache/jorphan/reflect/ClassFinder.java >=================================================================== >--- src/jorphan/org/apache/jorphan/reflect/ClassFinder.java (revision 780105) >+++ src/jorphan/org/apache/jorphan/reflect/ClassFinder.java (working copy) >@@ -411,12 +411,22 @@ > if (file.isDirectory()) { > findClassesInPathsDir(strPath, file, listClasses); > } else if (file.exists()) { >- ZipFile zipFile = new ZipFile(file); >- Enumeration entries = zipFile.entries(); >- while (entries.hasMoreElements()) { >- String strEntry = entries.nextElement().toString(); >- if (strEntry.endsWith(DOT_CLASS)) { >- listClasses.add(fixClassName(strEntry)); >+ ZipFile zipFile = null; >+ try { >+ zipFile = new ZipFile(file); >+ Enumeration entries = zipFile.entries(); >+ while (entries.hasMoreElements()) { >+ String strEntry = entries.nextElement().toString(); >+ if (strEntry.endsWith(DOT_CLASS)) { >+ listClasses.add(fixClassName(strEntry)); >+ } >+ } >+ } catch (Exception e) { >+ log.warn("Can not open the jar " + strPath); >+ } >+ finally { >+ if(zipFile != null) { >+ try {zipFile.close();} catch (Exception e) {} > } > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 47377
: 23819