RFR: 8001647: In-place methods on Collection/List

Robert Field Robert.Field at oracle.com
Mon Dec 10 15:49:01 PST 2012


On 12/10/12 1:59 PM, Mike Duigou wrote:
> On Dec 10 2012, at 05:28 , Alan Bateman wrote:
>
>> On 08/12/2012 01:42, Akhil Arora wrote:
>>> As part of the Library Lambdafication, this patch adds the following
>>> default methods to Collections -
>>>
>> This may be bikeshed territory but we usually don't use the "public" modifier on methods defined by interfaces as they are public anyway.
> Adding "public" was at my suggestion.
>
>> It seems inconsistent to me to have it on the default methods. Perhaps this has been discussed before, in which case ignore this. BTW: The only reason I'm bringing this up is because there are lots of default methods to come and it would be nice to establish a convention and consistency from the start.
> Agreed that we should be consistent. The suggestion to add "public" isn't related specifically to the default but anticipates, perhaps prematurely, future addition of "package" "module" and "protected" modifiers. When those modifiers are added it will make sense to be explicit about the access of a method.
Maybe, maybe not, but at that point, if we want to be explicit, it 
should be on everything.  Doing it now just on new stuff in anticipation 
of a possible change seems premature.

> Additionally, some have complained about the difference in default access between interfaces and classes (public vs package) and prefer to explicit so that the intent is obvious and that method signature text in interfaces and classes look the same.

Frankly, that argument seems silly as that distinction is true of all 
methods, not just default methods.

-Robert

>
> So, worthwhile or not?
>
> Mike
>



More information about the lambda-dev mailing list