RFR(s): 8060192: Add default method Collection.toArray(generator) (original) (raw)
Stuart Marks stuart.marks at oracle.com
Tue Dec 12 02:02:24 UTC 2017
- Previous message: RFR(s): 8060192: Add default method Collection.toArray(generator)
- Next message: RFR(s): 8060192: Add default method Collection.toArray(generator)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Frankly, I think the JDK is just sloppy here. Most of the existing implementations didn't use @Override -- possibly because they were introduced before annotations existed -- and later on, whoever implemented the overrides of the Java 8 default methods decided to add @Override.
Part of it is that Doug and I are not huge fans of @Override. Is the gain in safety really worth the added verbosity? If we do decide to mandate the use of @Override in all of openjdk, then the errorprone project has a bug pattern check for you, which will provide more safety yet.
As I said, I don't think there's a rule that requires @Override. Thanks for verifying this. :-)
I'm not proposing adding such a rule either. I agree, it adds little benefit, at least for the JDK, and it adds clutter.
A quick grep reveals over 33,000 occurrences of @Override in the JDK sources. That seems like a lot, but if we were to add it to all locations where it could be applied, this might add hundreds if not thousands more occurrences. I'm not sure it's worth the effort to do either the additions or the removals that'd be necessary to make things consistent. Oh well.
s'marks
- Previous message: RFR(s): 8060192: Add default method Collection.toArray(generator)
- Next message: RFR(s): 8060192: Add default method Collection.toArray(generator)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]