From 0457674be209739092b6459d54d36acb38e9fd2a Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Wed, 3 Mar 2021 18:21:11 +0200 Subject: [PATCH] APIBuilder: Unlock RW-lock in remove() The remove() function accidentally calls lock() in the finally block, leaving the RW-lock unlocked. Refs: scylladb/scylla#7991 (cherry picked from commit 59fd4d2b03476553e72564a38266926e02e28079) --- src/main/java/com/scylladb/jmx/utils/APIBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/scylladb/jmx/utils/APIBuilder.java b/src/main/java/com/scylladb/jmx/utils/APIBuilder.java index 5fe3f51..08a9f48 100644 --- a/src/main/java/com/scylladb/jmx/utils/APIBuilder.java +++ b/src/main/java/com/scylladb/jmx/utils/APIBuilder.java @@ -172,7 +172,7 @@ public class APIBuilder extends MBeanServerBuilder { logger.log(SEVERE, "Unexpected error.", x); } } finally { - lock.writeLock().lock(); + lock.writeLock().unlock(); } } }