UOSM - Use Of the 'synchronized' Modifier
The 'synchronized' modifier on methods can sometimes cause confusion during maintenance and debugging. This rule recommends to avoid using this modifier and encourages using 'synchronized' statements instead.
Wrong
public synchronized void method () {
// do something
}
}
Tip: Use synchronized statements instead of synchronized methods.
Right
public void method () {
synchronized(this) {
// do something
}
}
}