|
13 | 13 | import java.nio.file.Files; |
14 | 14 | import java.nio.file.Path; |
15 | 15 | import java.nio.file.Paths; |
| 16 | +import java.nio.file.StandardOpenOption; |
16 | 17 | import java.util.Arrays; |
17 | 18 | import java.util.Collections; |
18 | 19 | import java.util.HashSet; |
@@ -294,18 +295,15 @@ protected void loadClass(String clazz) { |
294 | 295 | if (pathes != null && !pathes.isEmpty()) { |
295 | 296 | for (Path path : pathes) { |
296 | 297 | 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; |
309 | 307 | } |
310 | 308 | } |
311 | 309 | } |
|
0 commit comments