From 265f69ae4156d37c18dcb7a0a9cb024443b76583 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Sun, 22 Dec 2024 12:17:46 +0800 Subject: [PATCH] Remove useless generic type of LockContext --- .../org/apache/shardingsphere/infra/lock/LockContext.java | 8 +++----- .../mode/manager/cluster/lock/ClusterLockContext.java | 2 +- .../manager/standalone/lock/StandaloneLockContext.java | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/lock/LockContext.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/lock/LockContext.java index a74f1411e3c4e..eb39e3b60f0b5 100644 --- a/infra/common/src/main/java/org/apache/shardingsphere/infra/lock/LockContext.java +++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/lock/LockContext.java @@ -19,10 +19,8 @@ /** * Lock context. - * - * @param type of lock definition */ -public interface LockContext { +public interface LockContext { /** * Try Lock. @@ -31,12 +29,12 @@ public interface LockContext { * @param timeoutMillis timeout milliseconds * @return is locked or not */ - boolean tryLock(T lockDefinition, long timeoutMillis); + boolean tryLock(LockDefinition lockDefinition, long timeoutMillis); /** * Unlock. * * @param lockDefinition lock definition */ - void unlock(T lockDefinition); + void unlock(LockDefinition lockDefinition); } diff --git a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/lock/ClusterLockContext.java b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/lock/ClusterLockContext.java index 10e978989b8d0..7bac7d79e6175 100644 --- a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/lock/ClusterLockContext.java +++ b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/lock/ClusterLockContext.java @@ -27,7 +27,7 @@ * Cluster lock context. */ @RequiredArgsConstructor -public final class ClusterLockContext implements LockContext { +public final class ClusterLockContext implements LockContext { private final LockPersistService globalLockPersistService; diff --git a/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/lock/StandaloneLockContext.java b/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/lock/StandaloneLockContext.java index 6b5e5a603dff1..45580b850ad22 100644 --- a/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/lock/StandaloneLockContext.java +++ b/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/lock/StandaloneLockContext.java @@ -23,7 +23,7 @@ /** * Standalone lock context. */ -public final class StandaloneLockContext implements LockContext { +public final class StandaloneLockContext implements LockContext { @Override public boolean tryLock(final LockDefinition lockDefinition, final long timeoutMillis) {