All Downloads are FREE. Search and download functionalities are using the official Maven repository.

resources.report.rules.pmd.EmptySynchronizedBlock.html Maven / Gradle / Ivy



EmptySynchronizedBlock


EmptySynchronizedBlock

Avoid empty synchronized blocks - they're useless.

This rule is defined by the following XPath expression:


//SynchronizedStatement/Block[1][count(*) = 0]

              

Example:

                

public class Foo {
 public void bar() {
  synchronized (this) {
   // empty!
  }
 }
}

      
            




© 2015 - 2025 Weber Informatics LLC | Privacy Policy