mirror of
https://github.com/tiennm99/lombok.git
synced 2026-09-15 14:19:47 +00:00
31 lines
608 B
Java
31 lines
608 B
Java
class SynchronizedOnStatic<Z> {
|
|
static class Inner {
|
|
private static Object LCK = new Object[0];
|
|
<clinit>() {
|
|
}
|
|
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();
|
|
}
|
|
} |