On Mon, Feb 15, 2016 at 9:08 AM, Matt Sicker <boa...@gmail.com> wrote:

> Sounds good. Remko was mentioning how they could be combined by checking
> if get() returns an instanceof Message, but using the wildcard bounds like
> you show sounds like a better way (where possible).
>

Wasn't Remko talking about a different case?

Right now we have:

traceExit(MessageSupplier, R)
traceExit(Supplier<? extends Message>, R)

Both "MessageSupplier.get()" and "Supplier<? extends Message>" *do* return
a Message so I think we can remove traceExit(Supplier<? extends Message>,
R)  (which is not even used/tested ATM).

Gary

>
> On 15 February 2016 at 11:06, Gary Gregory <garydgreg...@gmail.com> wrote:
>
>> Since 2.4 we have:
>>
>> public interface MessageSupplier {
>>
>>     /**
>>      * Gets a Message.
>>      *
>>      * @return a Message
>>      */
>>     Message get();
>> }
>>
>> and
>>
>> public interface Supplier<T> {
>>
>>     /**
>>      * Gets a value.
>>      *
>>      * @return a value
>>      */
>>     T get();
>> }
>>
>> Which smells fishy to me. Instead I propose:
>>
>> public interface MessageSupplier extends Supplier<Message> {
>>     // empty
>> }
>>
>> Whether or not we do the above, we can replace:
>>
>> traceExit(R, Supplier<? extends Message>)
>>
>> with:
>>
>> traceExit(R, MessageSupplier)
>>
>> which we already have.
>>
>> A test search shows the above as the only instance of "Supplier<? extends
>> Message>" in our Java files.
>>
>> Thoughts?
>>
>> --
>> E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
>> Java Persistence with Hibernate, Second Edition
>> <http://www.manning.com/bauer3/>
>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>> Spring Batch in Action <http://www.manning.com/templier/>
>> Blog: http://garygregory.wordpress.com
>> Home: http://garygregory.com/
>> Tweet! http://twitter.com/GaryGregory
>>
>
>
>
> --
> Matt Sicker <boa...@gmail.com>
>



-- 
E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Reply via email to