RFR: 8001647: In-place methods on Collection/List
david.holmes at oracle.com
Tue Dec 11 11:41:00 UTC 2012
On 11/12/2012 7:59 AM, 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. 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?
I think not. No matter what modifiers come in the future the default
will always have to remain "public".
But if you are going to add it then add it to all the methods in the
interfaces being updated.
More information about the core-libs-dev