@DoNotOverride for interface default methods
Open
- Dominant language
- Java
- Stars
- 7.2k
- Forks
- 820
- Avg merge
- 5h 9m
- Merged PRs (30d)
- 50
Description
`@DoNotOverride` for interface default methods would be neat, e.g. for something like this, which for better composability one wouldn't want to have to create an abstract class for, and would want ensure is never changed by implementing classes:
```java
public interface Hashable {
@DoNotOverride
default Multihash hash() {
var hasher = Hasher.sha512();
hash(hasher);
return hasher.hash(Multihash.Type.sha2_512);
}
void hash(Hasher hasher);
}
```
Just a thought.
Contributor guide
Assessment
This issue has not been assessed yet.