From 37d15e05d8858b9b3dc60f6251e29dd428f07e7f Mon Sep 17 00:00:00 2001 From: tedyu Date: Fri, 22 Jan 2016 02:49:04 -0800 Subject: [PATCH] HBASE-15148 Resolve IS2_INCONSISTENT_SYNC findbugs warning in AuthenticationTokenSecretManager (Yu Li) --- .../security/token/AuthenticationTokenSecretManager.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/AuthenticationTokenSecretManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/AuthenticationTokenSecretManager.java index 09b88464371..0951093f192 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/AuthenticationTokenSecretManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/AuthenticationTokenSecretManager.java @@ -287,6 +287,10 @@ public class AuthenticationTokenSecretManager } } + synchronized long getLastKeyUpdate() { + return lastKeyUpdate; + } + public static SecretKey createSecretKey(byte[] raw) { return SecretManager.createSecretKey(raw); } @@ -340,10 +344,7 @@ public class AuthenticationTokenSecretManager // clear any expired removeExpiredKeys(); - long localLastKeyUpdate; - synchronized (this) { - localLastKeyUpdate = lastKeyUpdate; - } + long localLastKeyUpdate = getLastKeyUpdate(); if (localLastKeyUpdate + keyUpdateInterval < now) { // roll a new master key rollCurrentKey();