• R/O
  • SSH
  • HTTPS

dbviewer: コミット


コミットメタ情報

リビジョン252 (tree)
日時2012-07-09 13:01:08
作者makopoppo

ログメッセージ

Added close() when searching for JDBC classes. I don't know what effect it will have though

変更サマリ

差分

--- DBViewer/branches/2.0.0/src/zigen/plugin/db/core/DriverSearcherThread.java (revision 251)
+++ DBViewer/branches/2.0.0/src/zigen/plugin/db/core/DriverSearcherThread.java (revision 252)
@@ -36,7 +36,7 @@
3636
3737 List driverList = new ArrayList();
3838 ZipInputStream in = null;
39-
39+
4040 try {
4141 for (int i = 0; i < classpaths.length; i++) {
4242 try {
@@ -45,15 +45,22 @@
4545 addDriverList(driverList, classpaths[i]);
4646
4747 } else {
48- JarFile jarFile = new JarFile(classpaths[i]);
49- Enumeration e = jarFile.entries();
50- while (e.hasMoreElements()) {
51- JarEntry entry = (JarEntry) e.nextElement();
52- addDriverList(driverList, entry.getName());
53- }
54-
48+ JarFile jarFile = null;
49+ try {
50+ jarFile = new JarFile(classpaths[i]);
51+ Enumeration e = jarFile.entries();
52+ while (e.hasMoreElements()) {
53+ JarEntry entry = (JarEntry) e.nextElement();
54+ addDriverList(driverList, entry.getName());
55+ }
56+ } finally {
57+ if (jarFile != null) {
58+ jarFile.close();
59+ }
60+ }
61+
5562 }
56-
63+
5764 } catch (IOException e) {
5865 }
5966
@@ -62,7 +69,7 @@
6269 } finally {
6370 try {
6471 if (in != null)
65- in.close();
72+ in.close();
6673 } catch (Exception e) {
6774 }
6875
旧リポジトリブラウザで表示