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!
  }
 }
}