RFR 9: 8132394 : (process) ProcessBuilder support for a pipeline of processes
Roger.Riggs at Oracle.com
Mon Nov 9 18:55:39 UTC 2015
Hi Paul, Alan,
What are the chances that varargs will be updated at some point in the
future to use
Lists instead of arrays? It would be a bit of thrash to try to avoid
varargs if varargs
is likely to be updated. It is a bit awkward at the moment though.
I'd hope that at some point varargs caller syntax could handle
automatically the case where the method
invoked accepts either a List<T> or T. Currently, providing a T is
able to use the array as is.
It would make sense that it could also convert a List<T> to T as part
of code generation.
For the existing Arrays.asList( pb1, pb2) or JEP 269 List.of(pb1, pb2)
force the developer to
type extra stuff and create more objects than the current varargs usage.
Where is varargs going?
And, will List<T> toArray() ever be able to properly create T?
On 11/9/2015 7:18 AM, Paul Sandoz wrote:
>> On 9 Nov 2015, at 12:20, Alan Bateman <Alan.Bateman at oracle.com> wrote:
>> On 05/11/2015 21:56, Roger Riggs wrote:
>>> Please review the new ProcessBuilder.startPipeline API, implementation, and tests.
>>> javadoc of ProcessBuilder: only startPipeline is new:
>> I skimmed over the javadoc and it looks quite good.
>> The method name seems okay, I initially assumed it would be something like startProcesses but that doesn't convey how they are arranged.
>> Using varargs seem reasonable for the examples like you have in the javadoc but there may be other usages where this might be annoying.
> Good point. In light of the imminent (getting Stuart stressed here :-) ) arrival of the convenience collection factories it may be better to accept a List<ProcesssBuilder>, especially so since this is only really useful for two or more process builders.
More information about the core-libs-dev