mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 14:16:11 +00:00
Add tests for Locked annotations
This commit is contained in:
25 files changed
+634
No files matched your search
@@ -0,0 +1,41 @@
|
||||
class LockedOnStatic<Z> {
|
||||
static class Inner {
|
||||
private static final java.util.concurrent.locks.ReentrantLock LCK = new java.util.concurrent.locks.ReentrantLock();
|
||||
<clinit>() {
|
||||
}
|
||||
Inner() {
|
||||
super();
|
||||
}
|
||||
public @lombok.experimental.Locked("LCK") void foo() {
|
||||
LockedOnStatic.Inner.LCK.lock();
|
||||
try
|
||||
{
|
||||
System.out.println();
|
||||
}
|
||||
finally
|
||||
{
|
||||
LockedOnStatic.Inner.LCK.unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
class Inner2 {
|
||||
private final java.util.concurrent.locks.ReentrantLock LCK = new java.util.concurrent.locks.ReentrantLock();
|
||||
Inner2() {
|
||||
super();
|
||||
}
|
||||
public @lombok.experimental.Locked("LCK") void foo() {
|
||||
this.LCK.lock();
|
||||
try
|
||||
{
|
||||
System.out.println();
|
||||
}
|
||||
finally
|
||||
{
|
||||
this.LCK.unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
LockedOnStatic() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user