garydgregory commented on code in PR #799:
URL: https://github.com/apache/commons-io/pull/799#discussion_r2434096053


##########
src/main/java/org/apache/commons/io/channels/CloseShieldChannel.java:
##########
@@ -53,11 +57,10 @@ private static Set<Class<?>> collectChannelInterfaces(final 
Class<?> type, final
      * Wraps a channel to shield it from being closed.
      *
      * @param channel The underlying channel to shield, not {@code null}.
-     * @param <T>     Any Channel type (interface or class).
      * @return A proxy that shields {@code close()} and enforces closed 
semantics on other calls.
      */
     @SuppressWarnings({ "unchecked", "resource" }) // caller closes
-    public static <T extends Channel> T wrap(final T channel) {
+    public static Channel wrap(final Channel channel) {

Review Comment:
   I don't think losing the generics is a good thing, at all, as exemplified by 
the added typecasting in the tests and a random set of new factory methods 
("random" since there are many more Channel interfaces).
   
   This change only exists because this factory is implemented using proxies. 
We can document this for the curious reader.



-- 
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