From ba6438377cf3dfde6dbdd5a2b3119d10b9d87f6b Mon Sep 17 00:00:00 2001 From: Satyen Subramaniam Date: Tue, 19 Nov 2024 20:12:24 +0000 Subject: [PATCH] 8321470: ThreadLocal.nextHashCode can be static final Backport-of: c42535f1110d60d1472080ad4fcadb8acbeb4c4b --- src/java.base/share/classes/java/lang/ThreadLocal.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/java.base/share/classes/java/lang/ThreadLocal.java b/src/java.base/share/classes/java/lang/ThreadLocal.java index ae696768395..848e3721dcf 100644 --- a/src/java.base/share/classes/java/lang/ThreadLocal.java +++ b/src/java.base/share/classes/java/lang/ThreadLocal.java @@ -90,7 +90,7 @@ public class ThreadLocal { * The next hash code to be given out. Updated atomically. Starts at * zero. */ - private static AtomicInteger nextHashCode = + private static final AtomicInteger nextHashCode = new AtomicInteger(); /**