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

Reply via email to