[
https://issues.apache.org/jira/browse/GROOVY-8373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18044393#comment-18044393
]
ASF GitHub Bot commented on GROOVY-8373:
----------------------------------------
blackdrag commented on PR #2352:
URL: https://github.com/apache/groovy/pull/2352#issuecomment-3641294794
Frankly the general Writable-concept has its problems. I was fixing the
issue in GROOVY-8373 only. If you look at:
-
https://github.com/apache/groovy/blob/2d9c467ade68da0e3e73e64c4db7f29d742162f9/src/main/org/codehaus/groovy/runtime/IOGroovyMethods.java#L1450
-
https://github.com/apache/groovy/blob/2d9c467ade68da0e3e73e64c4db7f29d742162f9/src/main/org/codehaus/groovy/runtime/IOGroovyMethods.java#L1490
then you have one readline that closes the writer, while the other returns a
writer, which you are, I guess, supposed to reuse. And in that manner it would
be wrong to have it closed in the method I changed. But does the API make sense
like this? Well, not part of the issue as I said ;)
> File.filterLine leaves hanging Reader
> -------------------------------------
>
> Key: GROOVY-8373
> URL: https://issues.apache.org/jira/browse/GROOVY-8373
> Project: Groovy
> Issue Type: Bug
> Components: groovy-jdk
> Reporter: Tim Yates
> Priority: Trivial
>
> Looks like the default method for {{new File('.').filterLine}} creates a
> {{newReader}} which is never closed, nor is it accessible for the user to
> close it themselves.
> https://github.com/apache/groovy/blob/2d9c467ade68da0e3e73e64c4db7f29d742162f9/src/main/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L2386
--
This message was sent by Atlassian Jira
(v8.20.10#820010)