[ISSUE #9631] return value of putIfAbsent ignored, value passed to putIfAbsent reused (#9633)

Signed-off-by: zume0127 <790589151@qq.com>

Signed-off-by: zume0127 <790589151@qq.com>
This commit is contained in:
zume0127 2022-11-28 09:28:00 +08:00 committed by GitHub
parent 0e346f0024
commit 62b03ff915
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -173,8 +173,8 @@ public class ClientTrackService {
return record; return record;
} }
ClientRecord clientRecord = new ClientRecord(clientIp); ClientRecord clientRecord = new ClientRecord(clientIp);
clientRecords.putIfAbsent(clientIp, clientRecord); record = clientRecords.putIfAbsent(clientIp, clientRecord);
return clientRecord; return null == record ? clientRecord : record;
} }
public static void refreshClientRecord() { public static void refreshClientRecord() {