You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2022/02/09 12:21:58 UTC

[GitHub] [lucene] mocobeta commented on a change in pull request #643: LUCENE-10400: revise binary dictionaries' constructor in kuromoji

mocobeta commented on a change in pull request #643:
URL: https://github.com/apache/lucene/pull/643#discussion_r802603983



##########
File path: lucene/core/src/java/org/apache/lucene/util/IOUtils.java
##########
@@ -526,4 +526,17 @@ public static void fsync(Path fileToSync, boolean isDir) throws IOException {
   public interface IOFunction<T, R> {
     R apply(T t) throws IOException;
   }
+
+  /**
+   * A resource supplier function that may throw an IOException.
+   *
+   * <p>Note that this would open a resource such as a File. Consumers should make sure to close the
+   * resource (e.g., use try-with-resources)
+   *
+   * @see java.util.function.Supplier
+   */
+  @FunctionalInterface

Review comment:
       I didn't notice there is `o.a.l.util.IOSupplier`. It's confusing to have two interfaces with the same signature.
   
   Also, there are other functional interfaces in `o.a.l.util.IOUtils` corresponding to Java stdlib's Consumer and Function.
   I think it might be better to move all functional interfaces in `o.a.l.util.IOUtils` to top-level interfaces? @uschindler 
   




-- 
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@lucene.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org