aboutsummaryrefslogtreecommitdiff
path: root/src/lombok/eclipse/handlers/HandleSynchronized.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/lombok/eclipse/handlers/HandleSynchronized.java')
-rw-r--r--src/lombok/eclipse/handlers/HandleSynchronized.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lombok/eclipse/handlers/HandleSynchronized.java b/src/lombok/eclipse/handlers/HandleSynchronized.java
index 28e8bd1f..e1d4ed6a 100644
--- a/src/lombok/eclipse/handlers/HandleSynchronized.java
+++ b/src/lombok/eclipse/handlers/HandleSynchronized.java
@@ -48,7 +48,8 @@ public class HandleSynchronized implements EclipseAnnotationHandler<Synchronized
return true;
}
- char[] lockName = method.isStatic() ? STATIC_LOCK_NAME : INSTANCE_LOCK_NAME;
+ char[] lockName = annotation.getInstance().value().toCharArray();
+ if ( lockName.length == 0 ) lockName = method.isStatic() ? STATIC_LOCK_NAME : INSTANCE_LOCK_NAME;
if ( fieldExists(new String(lockName), methodNode) == MemberExistsResult.NOT_EXISTS ) {
FieldDeclaration fieldDecl = new FieldDeclaration(lockName, 0, -1);