File tree Expand file tree Collapse file tree
sources/net.sf.j2s.ui/src/net/sf/j2s/ui/classpath Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111import java .util .List ;
1212import java .util .Properties ;
1313
14+ import net .sf .j2s .core .compiler .FileUtil ;
15+
1416public class PathUtil {
1517 public static final String J2S_RESOURCES_LIST = "j2s.resources.list" ;
1618 public static final String J2S_ABANDOMED_RESOURCES_LIST = "j2s.abandoned.resources.list" ;
@@ -147,8 +149,9 @@ public static String joinArray(String[] list, String seperator) {
147149 public static Properties loadJZ (File file ) {
148150 Properties props = new Properties ();
149151 if (file .exists ()) {
152+ FileReader reader = null ;
150153 try {
151- FileReader reader = new FileReader (file );
154+ reader = new FileReader (file );
152155 char [] buf = new char [1024 ];
153156 StringBuffer buffer = new StringBuffer ();
154157 int read = 0 ;
@@ -184,6 +187,8 @@ public static Properties loadJZ(File file) {
184187 e1 .printStackTrace ();
185188 } catch (IOException e1 ) {
186189 e1 .printStackTrace ();
190+ } finally {
191+ FileUtil .close (reader );
187192 }
188193 }
189194 return props ;
You can’t perform that action at this time.
0 commit comments