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. 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.

So, worthwhile or not?

Mike

Reply via email to