RFR[8243488]: 'Add tests for set/get SendBufferSize and getReceiveBufferSize in DatagramSocket'
Patrick Concannon
patrick.concannon at oracle.com
Fri May 1 15:53:19 UTC 2020
Hi,
I've refactored the test to use the name 'DatagramSocketSupplier'
instead of 'DSF' for the @FunctionalInterface, and used the supplier
method as Daniel suggested.
The updates can be found in the patch below.
http://cr.openjdk.java.net/~pconcannon/8243488/webrevs/webrev.03/
Kind regards,
Patrick
On 30/04/2020 12:32, Daniel Fuchs wrote:
> On 30/04/2020 12:24, Alan Bateman wrote:
>> It's a naming issue mostly. If DSF is renamed to something like
>> DatagramSocketSupplier then it might be a bit clearer. We have
>> something similar in PrintSupportedOptions - I was reminded of that
>> with the changes for ADQ that are currently under discussion here.
>
> OK - the poor name is mostly an attempt to avoid too long
> lines because of the required cast in the data provider.
> But maybe we could work around that by moving the of method
> in the outer class - something like:
>
> @FunctionalInterface
> interface DatagramSocketSupplier {
> DatagramSocket open() throws IOException;
> }
>
> static DatagramSocketSupplier supplier(DatagramSocketSupplier ds) {
> return ds;
> }
>
> ...
> { "DatagramSocket", supplier(() -> new DatagramSocket()) }
>
>
> best regards,
>
> -- daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/net-dev/attachments/20200501/303e57dc/attachment.htm>
More information about the net-dev
mailing list