You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "remeio (via GitHub)" <gi...@apache.org> on 2023/04/17 12:16:20 UTC

[GitHub] [commons-lang] remeio opened a new pull request, #1057: Feature add NOP for TriFunction

remeio opened a new pull request, #1057:
URL: https://github.com/apache/commons-lang/pull/1057

   NOP for TriFunction is necessary?


-- 
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: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-lang] aherbert commented on pull request #1057: Feature add NOP for TriFunction

Posted by "aherbert (via GitHub)" <gi...@apache.org>.
aherbert commented on PR #1057:
URL: https://github.com/apache/commons-lang/pull/1057#issuecomment-1511251988

   If `TriFunction` is the three-arity specialization of `Function` then this interface should support the methods in the JDK and not add more. `java.util.function.BiFunction` does not have a `nop()` method in the latest LTS (JDK 17).
   
   A no-op makes sense for a consumer with a void return. When returning a result, even specifying `null` is an operation.


-- 
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: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-lang] remeio commented on pull request #1057: Feature add NOP for TriFunction

Posted by "remeio (via GitHub)" <gi...@apache.org>.
remeio commented on PR #1057:
URL: https://github.com/apache/commons-lang/pull/1057#issuecomment-1511303884

   I get it. : )


-- 
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: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-lang] remeio commented on pull request #1057: Feature add NOP for TriFunction

Posted by "remeio (via GitHub)" <gi...@apache.org>.
remeio commented on PR #1057:
URL: https://github.com/apache/commons-lang/pull/1057#issuecomment-1511293247

   I had repaired it.


-- 
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: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-lang] aherbert commented on pull request #1057: Feature add NOP for TriFunction

Posted by "aherbert (via GitHub)" <gi...@apache.org>.
aherbert commented on PR #1057:
URL: https://github.com/apache/commons-lang/pull/1057#issuecomment-1511296581

   The `noop` was added for [LANG-1568](https://issues.apache.org/jira/browse/LANG-1568) which was to add failable equivalents of JDK functional interfaces. There is not a `noop` in the JDK. Why the method was added is not clear and it has no use case in the library.


-- 
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: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-lang] remeio commented on pull request #1057: Feature add NOP for TriFunction

Posted by "remeio (via GitHub)" <gi...@apache.org>.
remeio commented on PR #1057:
URL: https://github.com/apache/commons-lang/pull/1057#issuecomment-1511262424

   I agree the  ` When returning a result, even specifying null is an operation.` But in package `org.apache.commons.lang3.function`, there seems to be some kind of agreement.
   
   - NOP for Function: (t, u) -> null;
   - NOP for Consumer: (t, u) -> {/* NOP */};
   
   Such as For Function:
   ```java
   public interface FailableBiFunction<T, U, R, E extends Throwable> {
   
       /** NOP singleton */
       @SuppressWarnings("rawtypes")
       FailableBiFunction NOP = (t, u) -> null;
   }
   ``` 
   For Consumer: 
   ```java
   @FunctionalInterface
   public interface FailableBiConsumer<T, U, E extends Throwable> {
   
       /** NOP singleton */
       @SuppressWarnings("rawtypes")
       FailableBiConsumer NOP = (t, u) -> {/* NOP */};
   }
   ```


-- 
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: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-lang] garydgregory commented on pull request #1057: Feature add NOP for TriFunction

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #1057:
URL: https://github.com/apache/commons-lang/pull/1057#issuecomment-1511406709

   > If `TriFunction` is the three-arity specialization of `Function` then this interface should support the methods in the JDK and not add more. `java.util.function.BiFunction` does not have a `nop()` method in the latest LTS (JDK 17).
   > 
   > A no-op makes sense for a consumer with a void return. When returning a result, even specifying `null` is an operation.
   
   I agree.


-- 
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: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-lang] remeio closed pull request #1057: Feature add NOP for TriFunction

Posted by "remeio (via GitHub)" <gi...@apache.org>.
remeio closed pull request #1057: Feature add NOP for TriFunction
URL: https://github.com/apache/commons-lang/pull/1057


-- 
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: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-lang] garydgregory commented on pull request #1057: Feature add NOP for TriFunction

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #1057:
URL: https://github.com/apache/commons-lang/pull/1057#issuecomment-1511285230

   This PR breaks the build.
   


-- 
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: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org