<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
On 04/08/2022 20:35, Holo The Sage Wolf wrote:<br>
<blockquote type="cite" cite="mid:CAKswmE68NDCTPCY_cNnQNAwzBkXR1dM0PNfOjSk3PV0a9Poa-A@mail.gmail.com">
<div dir="ltr">
<div class="markdown-here-wrapper" style=""><code></code>
<p style="margin:0px 0px 1.2em!important">Some implementations
of <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">Collection</code>
that will always fail, some will always succeed, and some
implementations (like <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">HashSet</code>)
may be non-deterministic.<br>
For the uninformed this method makes sense, for each <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">PartitiableAction</code>
I create some kind of a new “<code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">Executor</code>“
that everyone is talking about, if one of the parts fails,
the whole calculation of this specific <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">PartitiableAction</code>
will stop running, and I am waiting for everything to end.<br>
</p>
</div>
</div>
</blockquote>
<br>
You may be right that someone may choose to ignore the javadoc, the
examples, and the recommendation to use try-with-resources but that
isn't a slam dunk argument for changing that API to use lambda
expressions and all the usability issues that it would bring. The
example is a bit strange, it seems to assume that any action can
process any input. Also the iteration order of "actions" can be
deterministic and it will still fail because it will attempt to
close the scopes in iteration order when it should be closing them
in reverse iteration order. So you should see an exception at
runtime if actions contains more than one element.<br>
<br>
In any case, I think this is just another reminder that having
language support that would somehow enforce the use of
try-with-resources would be very helpful here.<br>
<br>
-Alan<br>
</body>
</html>