Skip to main content

Added missing synchronized keyword (Sonar)


ImportanceReview GuidanceRequires Scanning Tool
MEDIUMMerge After Cursory ReviewYes (Sonar)

This change adds missing synchronized keyword to methods that override a synchronized method in the parent class. Our changes look something like this:

  interface AcmeParent {
synchronized void doThing();

class AcmeChild implements AcmeParent {

- void doThing() {
+ synchronized void doThing() {



Are there other ways to implement this?

There are a number of different ways to fix this, but essentially we need to make this code thread-safe. This is important when the parent interface implies something is synchronized, signaling an expectation of thread-safety, when an implementation is not.