GROOVY-8251: Implement withCloseable on AutoCloseable#572
Closed
jwagenleitner wants to merge 4 commits intoapache:masterfrom
Closed
GROOVY-8251: Implement withCloseable on AutoCloseable#572jwagenleitner wants to merge 4 commits intoapache:masterfrom
jwagenleitner wants to merge 4 commits intoapache:masterfrom
Conversation
Relocate withAutoCloseable from NIO subproject to core. Since AutoCloseable is not strictly an NIO related class and release 2.5.0 will target Java 7, the method should be available as part of core. Relocated withCloseable tests to core since that method has already been moved to core and is deprecated in the NIO module.
AutoCloseables and Closeables should both be handled consistently. Naming the method withCloseable is general enough to handle both cases without requiring distinct naming.
261bc17 to
2dfd785
Compare
Contributor
Author
|
Updated PR to also include GROOVY-8259 adding suppressed exceptions. |
Contributor
That was the reason (I think I merged the pull request.).
+1 no need to keep binary compatibility to a beta release. |
Contributor
|
+1 no need to keep binary compatibility with beta-1 |
asfgit
pushed a commit
that referenced
this pull request
Jul 18, 2017
Relocate withAutoCloseable from NIO subproject to core. Since AutoCloseable is not strictly an NIO related class and release 2.5.0 will target Java 7, the method should be available as part of core. Relocated withCloseable tests to core since that method has already been moved to core and is deprecated in the NIO module.
asfgit
pushed a commit
that referenced
this pull request
Jul 18, 2017
Relocate withAutoCloseable from NIO subproject to core. Since AutoCloseable is not strictly an NIO related class and release 2.5.0 will target Java 7, the method should be available as part of core. Relocated withCloseable tests to core since that method has already been moved to core and is deprecated in the NIO module.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NioGroovyMethods.withAutoCloseablewas added for 2.5.0 as part of GROOVY-7572. It appears it was originally placed there because at the time Java 6 was still used, but now 2.5.0 is 7+.First commit 9122001 proposes moving the method (as-is) into the core
IOGroovyMethodsclass. This is where thewithCloseable(java.io.Closeable...)method is located. This change also moves the tests for both methods from NIO to core. Since 2.5.0 has not been officially released there may not be a need to deprecate or worry about binary compatibility for thewithAutoCloseablemethod?Second commit 261bc17 proposes to rename the new but unreleased method from
withAutoCloseabletowithCloseableto be consistent with the existing method onjava.io.Closeable. See discussion on GROOVY-8251.