Consistent Lock field declaration (instead of ReentrantLock field type)

(cherry picked from commit b4153618a4)
This commit is contained in:
Juergen Hoeller
2024-02-13 11:07:20 +01:00
parent 7ec5c994c1
commit 452973fbbd
3 changed files with 12 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@ import java.util.Set;
import java.util.TreeMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import org.apache.commons.logging.Log;
@@ -98,7 +99,7 @@ public class SubProtocolWebSocketHandler
private volatile long lastSessionCheckTime = System.currentTimeMillis();
private final ReentrantLock sessionCheckLock = new ReentrantLock();
private final Lock sessionCheckLock = new ReentrantLock();
private final DefaultStats stats = new DefaultStats();
@@ -268,7 +269,7 @@ public class SubProtocolWebSocketHandler
@Override
public final void start() {
Assert.isTrue(this.defaultProtocolHandler != null || !this.protocolHandlers.isEmpty(), "No handlers");
Assert.state(this.defaultProtocolHandler != null || !this.protocolHandlers.isEmpty(), "No handlers");
synchronized (this.lifecycleMonitor) {
this.clientOutboundChannel.subscribe(this);