Code review request
Dan Smith
daniel.smith at oracle.com
Tue Feb 26 11:10:36 PST 2013
On Feb 26, 2013, at 8:59 AM, Stephen Colebourne <scolebourne at joda.org> wrote:
> On 26 February 2013 15:41, Paul Sandoz <paul.sandoz at oracle.com> wrote:
>> On Feb 26, 2013, at 2:50 PM, Remi Forax <forax at univ-mlv.fr> wrote:
>>> I propose the following code convention for abstract/default method in interface.
>>> All methods in interface are marked public (just because we may support private static method in jdk9),
>>> default method should be 'public default' and not 'default public', like we have public static, visibility modifier first,
>>> and abstract methods in the same interface should be declared only 'public'.
>>
>> I do not relish your proposal of changing all abstract methods in interfaces to be declared redundantly public because of potential future features, even if such features are highly likely, we should have that discussion when those feature arrive.
>
> I am also of the opinion that abstract interface methods should now
> explicitly be declared "public". I'd strongly recommend at least
> starting with all methods within any interface that has a default
> method.
Just to be clear, everything in an interface is public in Java 8, just like it has always been. Default methods don't have anything to do with access flags. (We've talked about the fact that they _enable_ and _encourage_ a separate feature to support different accessibilities in interfaces, but that is still a separate feature, and is not planned as part of Java 8.)
The more relevant coding convention debate to be had, if any, is whether "abstract" should be used on abstract methods, now that not every method in an interface is "abstract".
—Dan
More information about the lambda-dev
mailing list