UnsynchronizedOverridesSynchronized is not restricted to immediate parent
- Dominant language
- Java
- Stars
- 7.2k
- Forks
- 820
- Avg merge
- 5h 9m
- Merged PRs (30d)
- 50
Description
The following code triggers UnsynchronizedOverridesSynchronized:
``` java
java.util.logging.ConsoleHandler stdout = new java.util.logging.ConsoleHandler() {
@Override
public void publish(java.util.logging.LogRecord record) {
if (!stderr.isLoggable(record)) {
super.publish(record);
}
}
};
```
But in this case the synchronized keyword has been already removed in the class we extend (java.util.logging.ConsoleHandler) and can only be found in grandparent class (java.util.logging.StreamHandler).
So we think this check should be restricted to immediate super class, and not the whole ancestry tree.
Contributor guide
Assessment
This issue has not been assessed yet.