mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 10:15:53 +00:00
[fixes #678] @Synchronize an instance method on static variable no longer emits a warning.
This commit is contained in:
16 files changed
+156
-44
No files matched your search
@@ -0,0 +1,31 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user