Skip to content

Commit fdf170a

Browse files
committed
hopefully fixing channel closed issue
1 parent 1356126 commit fdf170a

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

soot-infoflow-summaries/src/soot/jimple/infoflow/methodSummary/data/provider/XMLSummaryProvider.java

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import java.nio.file.Files;
1414
import java.nio.file.Path;
1515
import java.nio.file.Paths;
16+
import java.nio.file.StandardOpenOption;
1617
import java.util.Arrays;
1718
import java.util.Collections;
1819
import java.util.HashSet;
@@ -294,18 +295,15 @@ protected void loadClass(String clazz) {
294295
if (pathes != null && !pathes.isEmpty()) {
295296
for (Path path : pathes) {
296297
if (fileToClass(getFileName(path)).equals(clazz)) {
297-
FileSystem fs = path.getFileSystem();
298-
if (fs != null && fs.isOpen()) {
299-
try (InputStream inputStream = fs.provider().newInputStream(path)) {
300-
ClassMethodSummaries classSummaries = new ClassMethodSummaries(clazz);
301-
summaryReader.read(new InputStreamReader(inputStream), classSummaries);
302-
addMethodSummaries(classSummaries);
303-
break;
304-
} catch (Exception e) {
305-
LoggerFactory.getLogger(getClass()).error(
306-
String.format("An error occurred while loading the summary of %s", clazz), e);
307-
hasLoadingErrors = true;
308-
}
298+
try (InputStream inputStream = Files.newInputStream(path, StandardOpenOption.READ)) {
299+
ClassMethodSummaries classSummaries = new ClassMethodSummaries(clazz);
300+
summaryReader.read(new InputStreamReader(inputStream), classSummaries);
301+
addMethodSummaries(classSummaries);
302+
break;
303+
} catch (Exception e) {
304+
LoggerFactory.getLogger(getClass())
305+
.error(String.format("An error occurred while loading the summary of %s", clazz), e);
306+
hasLoadingErrors = true;
309307
}
310308
}
311309
}

0 commit comments

Comments
 (0)