ppkarwasz commented on PR #799: URL: https://github.com/apache/commons-io/pull/799#issuecomment-3403152970
@garydgregory, You initial concern about `CloseShieldChannel` being overly complex due to its use of proxies was spot on: the current implementation does **not** correctly handle many interfaces (like `AsynchronousByteChannel`). While it would be nice in theory to support every possible `Channel` sub-interface, the practical utility of doing so hasn’t really been demonstrated. So in this PR, I’ve taken a step back and simplified the design: * Limited the proxy to implement only those interfaces that are actually covered by unit tests. * Removed the generic `T wrap(T)` method: it can **never** be implemented correctly without generating class proxies (and that would be massive overkill here). * Introduced a simpler `Channel wrap(Channel)` method plus a few overloads for the most common interface types (those typically returned by `Files` and `Channels` factory methods). In practice, the only real-world use case I’ve found so far is wrapping a `ReadableByteChannel` to consume and close a `ChecksumInputStream` without closing its underlying channel. -- 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]
