class SynchronizedOnStatic { static class Inner { private static Object LCK = new Object[0]; () { } Inner() { super(); } public @lombok.Synchronized("LCK") void foo() { synchronized (SynchronizedOnStatic.Inner.LCK) { System.out.println(); } } } class Inner2 { private Object LCK = new Object[0]; Inner2() { super(); } public @lombok.Synchronized("LCK") void foo() { synchronized (this.LCK) { System.out.println(); } } } SynchronizedOnStatic() { super(); } }