File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
visualvm/libs.profiler/profiler/src/org/graalvm/visualvm/lib/profiler Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -1339,25 +1339,18 @@ private Lookup.Provider findProjectForSnapshot(FileObject selectedFile) {
1339
1339
1340
1340
private LoadedSnapshot loadSnapshotFromFileObject (FileObject selectedFile )
1341
1341
throws IOException {
1342
- DataInputStream dis = null ;
1343
-
1344
- try {
1342
+ try (
1345
1343
InputStream is = selectedFile .getInputStream ();
1346
1344
BufferedInputStream bis = new BufferedInputStream (is );
1347
- dis = new DataInputStream (bis );
1348
-
1345
+ DataInputStream dis = new DataInputStream (bis );
1346
+ ) {
1349
1347
LoadedSnapshot ls = LoadedSnapshot .loadSnapshot (dis );
1350
1348
1351
1349
if (ls != null ) {
1352
1350
ls .setFile (FileUtil .toFile (selectedFile ));
1353
1351
ls .setProject (findProjectForSnapshot (selectedFile ));
1354
1352
}
1355
-
1356
1353
return ls ;
1357
- } finally {
1358
- if (dis != null ) {
1359
- dis .close ();
1360
- }
1361
1354
}
1362
1355
}
1363
1356
You can’t perform that action at this time.
0 commit comments