kennknowles commented on issue #24098:
URL: https://github.com/apache/beam/issues/24098#issuecomment-1338017398

   `ScanResult` extends `Autocloseable` so the fix would be something like this:
   
   ```java
   @Override
     public List<String> detect(ClassLoader classLoader) {
       List<File> classpathContents;
       try (ScanResult scanResult =  classGraph
               .disableNestedJarScanning()
               .addClassLoader(classLoader)
               .scan(1)) {
         classpathContents = scanResult.getClasspathFiles();
       }
       scanResult.close();
   
       return 
classpathContents.stream().map(File::getAbsolutePath).collect(Collectors.toList());
     }
   ```
   
   @NianticRyan or @steveniemitz would you like to open a PR?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to