-
Type:
Bug
-
Resolution: Fixed
-
Priority:
P5
-
Affects Version/s: 11, 17, 21
-
Component/s: core-libs
Field 'sun.nio.ch.Invoker.myGroupAndInvokeCount' uses anonymous class which overrides 'initialValue' method. But vanilla ThreadLocal.initialValue does the same - just returns 'null'.
private static final ThreadLocal<GroupAndInvokeCount> myGroupAndInvokeCount =
new ThreadLocal<GroupAndInvokeCount>() {
@Override protected GroupAndInvokeCount initialValue() {
return null;
}
};
It means we can replace it with plain ThreadLocal constructor.
private static final ThreadLocal<GroupAndInvokeCount> myGroupAndInvokeCount =
new ThreadLocal<>();
private static final ThreadLocal<GroupAndInvokeCount> myGroupAndInvokeCount =
new ThreadLocal<GroupAndInvokeCount>() {
@Override protected GroupAndInvokeCount initialValue() {
return null;
}
};
It means we can replace it with plain ThreadLocal constructor.
private static final ThreadLocal<GroupAndInvokeCount> myGroupAndInvokeCount =
new ThreadLocal<>();