On Tue, 3 Jun 2025 20:14:13 GMT, Stuart Marks <sma...@openjdk.org> wrote:

>> src/java.base/share/classes/java/util/SequencedMap.java line 296:
>> 
>>> 294:                 return view().hashCode();
>>> 295:             }
>>> 296:             public void addFirst(K k) { throw new 
>>> UnsupportedOperationException(); }
>> 
>> Any utility in adding `@Override` annotations to the methods to document 
>> intent?
>
> The `@Override` annotation has been inconsistently applied in the collections 
> implementations. In practice since so many methods are overridden, and some 
> test would likely fail if a method weren't overridden properly, the 
> annotation would mostly add clutter. Indeed I'm considering pulling out all 
> uses of `@Override` in certain areas because they're just clutter.

It would be helpful in situations like this to have the inverse annotation -- 
"All methods should be overridden, except the ones marked `@NoOverride`".

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25515#discussion_r2125580996

Reply via email to