ryandens / sonar-example

0 stars 0 forks source link

Added missing synchronized keyword (Sonar) #3

Closed pixeebot[bot] closed 7 months ago

pixeebot[bot] commented 7 months ago

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 {

    @Override
-    void doThing() {
+    synchronized void doThing() {
      thing();
    }

  }
More reading * [https://rules.sonarsource.com/java/RSPEC-3551/](https://rules.sonarsource.com/java/RSPEC-3551/) * [https://wiki.sei.cmu.edu/confluence/display/java/TSM00-J.+Do+not+override+thread-safe+methods+with+methods+that+are+not+thread-safe](https://wiki.sei.cmu.edu/confluence/display/java/TSM00-J.+Do+not+override+thread-safe+methods+with+methods+that+are+not+thread-safe)

Powered by: pixeebot (codemod ID: sonar:java/overrides-match-synchronization-s3551)

sonarcloud[bot] commented 7 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud