Commit 4191f84d authored by Shimi Zhang's avatar Shimi Zhang Committed by Commit Bot

[Mojo] Change the misleading comment for AutoCloseableRouter.

AutoCloseableRouter implements close() method from java.io.Closeable,
however close() will be called only when used with try-with-resources
statement. Normally this class won't be in a try-with-resources
statement unfortunately, so one needs to call close() explicitly.

Bug: None
Test: No logic change, only comments.
Change-Id: I9c0b36372b8b51f0d3610fb82799db42a1fb910d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2081012Reviewed-by: default avatarKen Rockot <rockot@google.com>
Commit-Queue: Shimi Zhang <ctzsm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746109}
parent cd71071e
...@@ -10,7 +10,9 @@ import org.chromium.mojo.system.MessagePipeHandle; ...@@ -10,7 +10,9 @@ import org.chromium.mojo.system.MessagePipeHandle;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
/** /**
* Wrapper around {@link Router} that will close the connection when not referenced anymore. * Wrapper around {@link Router}. Unlike the class name suggested, it doesn't auto-close the
* connection without a try-with-resources statement. If the callsite isn't using try-with-resources
* mechanism, it needs to call close() explicitly.
*/ */
class AutoCloseableRouter implements Router { class AutoCloseableRouter implements Router {
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment