Overriding a default method
Talden
talden at gmail.com
Thu Aug 9 20:44:09 PDT 2012
With a varied degree of skill in the team, we do occasionally see
innappropriately applied @SuppressWarnings. The desire to eliminate
warnings is usually good but suppressing them is the wrong tool. A
more precise way to eliminate the warning is definitely preferable.
It would seem a minimal enhancement that could even be suggested in
compiler feedback.
--
Aaron Scott-Boddendijk
On Fri, Aug 10, 2012 at 12:24 PM, Brian Goetz <brian.goetz at oracle.com> wrote:
>> With a small @Override enhancement both would be resolvable (removing
>> from -Xlint results) without warning suppression.
>>
>> eg
>> class X implements A, B {
>> @Override({A.class, B.class}) public void m() { ... }
>> }
>>
>> This declares awareness of the collision for the Diamond case. -Xlint
>> can check them and behave appropriately.
>
> Yes, the EG has already discussed this as a possible (backward compatible) improvement. Our question is whether it would be used enough to be worthwhile.
>
>
More information about the lambda-dev
mailing list