File tree 1 file changed +12
-11
lines changed
src/main/java/me/coley/recaf/workspace
1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -63,19 +63,20 @@ protected Map<String, byte[]> loadClasses() throws IOException {
63
63
// This may not always be ideal, but this way has one major bonus. It totally ignores CRC validity.
64
64
// It also ignores a few other zip entry values.
65
65
// Since somebody can intentionally write bogus data there to crash "ZipInputStream" this way works.
66
- ZipFile zf = new ZipFile (getPath ().toString ());
67
- Enumeration <? extends ZipEntry > entries = zf .entries ();
68
- while (entries .hasMoreElements ()) {
69
- ZipEntry entry = entries .nextElement ();
66
+ try ( ZipFile zf = new ZipFile (getPath ().toString ())) {
67
+ Enumeration <? extends ZipEntry > entries = zf .entries ();
68
+ while (entries .hasMoreElements ()) {
69
+ ZipEntry entry = entries .nextElement ();
70
70
71
- if (shouldSkip (entry .getName ()))
72
- continue ;
73
- if (!loader .isValidClassEntry (entry ))
74
- continue ;
71
+ if (shouldSkip (entry .getName ()))
72
+ continue ;
73
+ if (!loader .isValidClassEntry (entry ))
74
+ continue ;
75
75
76
- InputStream zis = zf .getInputStream (entry );
77
- byte [] in = IOUtil .toByteArray (zis );
78
- loader .onClass (entry .getName (), in );
76
+ InputStream zis = zf .getInputStream (entry );
77
+ byte [] in = IOUtil .toByteArray (zis );
78
+ loader .onClass (entry .getName (), in );
79
+ }
79
80
}
80
81
}
81
82
}
You can’t perform that action at this time.
0 commit comments