rvesse commented on code in PR #2310:
URL: https://github.com/apache/jena/pull/2310#discussion_r1514165130
##########
jena-arq/src/main/java/org/apache/jena/query/ResultSetFactory.java:
##########
@@ -65,12 +66,12 @@ public static ResultSet load(String filenameOrURI) {
* @param format
* @return ResultSet
*/
-
public static ResultSet load(String filenameOrURI, ResultsFormat format) {
if (format == null)
format = ResultsFormat.guessSyntax(filenameOrURI);
- InputStream in = IO.openFile(filenameOrURI) ;
- return load(in, format) ;
+ try ( InputStream in = IO.openFile(filenameOrURI) ) {
+ return load(in, format) ;
Review Comment:
I take it this doesn't prematurely close the `InputStream`, the runtime is
smart enough to understand that there's still an active reference to the
`InputStream` and not auto-close it in the happy path case?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]