- cached hash code of `Locale` and `Locale$LanguageRange` shouldn't be
volatile, even in case of race in the worst case it is recalculated at most
once per thread
- `defaultLocale` field is read multiple times in `initDefault()`
- `isoLanguages` is accessed multiple times in `getISOLanguages()`
-
On Mon, 6 Jun 2022 12:58:39 GMT, Сергей Цыпанов wrote:
> - cached hash code of `Locale` and `Locale$LanguageRange` shouldn't be
> volatile, even in case of race in the worst case it is recalculated at most
> once per thread
> - `defaultLocale` field is read multiple times in `initDefault()`
> -
On Mon, 6 Jun 2022 13:20:31 GMT, liach wrote:
>> - cached hash code of `Locale` and `Locale$LanguageRange` shouldn't be
>> volatile, even in case of race in the worst case it is recalculated at most
>> once per thread
>> - `defaultLocale` field is read multiple times in `initDefault()`
>> - `is
On Mon, 6 Jun 2022 13:32:21 GMT, liach wrote:
>> Shouldn't the fields annotated with `@Stable` be `final` as well?
>
> These fields can only be written once besides the default values, but they
> don't have to be written in the static initializer or constructor. So when a
> non-zero hash code i
On Mon, 6 Jun 2022 13:28:44 GMT, Сергей Цыпанов wrote:
>> src/java.base/share/classes/java/util/Locale.java line 2260:
>>
>>> 2258: * Calculated hashcode
>>> 2259: */
>>> 2260: private transient volatile int hashCodeValue;
>>
>> We can additionally annotate such cache fields with
On Mon, 6 Jun 2022 13:34:27 GMT, liach wrote:
>> These fields can only be written once besides the default values, but they
>> don't have to be written in the static initializer or constructor. So when a
>> non-zero hash code is written, it's cached as if it's a final field. For a
>> zero valu
> - cached hash code of `Locale` and `Locale$LanguageRange` shouldn't be
> volatile, even in case of race in the worst case it is recalculated at most
> once per thread
> - `defaultLocale` field is read multiple times in `initDefault()`
> - `isoLanguages` is accessed multiple times in `getISOLang
> - cached hash code of `Locale` and `Locale$LanguageRange` shouldn't be
> volatile, even in case of race in the worst case it is recalculated at most
> once per thread
> - `defaultLocale` field is read multiple times in `initDefault()`
> - `isoLanguages` is accessed multiple times in `getISOLang
On Mon, 6 Jun 2022 20:19:22 GMT, Сергей Цыпанов wrote:
>> - cached hash code of `Locale` and `Locale$LanguageRange` shouldn't be
>> volatile, even in case of race in the worst case it is recalculated at most
>> once per thread
>> - `defaultLocale` field is read multiple times in `initDefault()`
On Mon, 6 Jun 2022 14:36:03 GMT, Сергей Цыпанов wrote:
>> - cached hash code of `Locale` and `Locale$LanguageRange` shouldn't be
>> volatile, even in case of race in the worst case it is recalculated at most
>> once per thread
>> - `defaultLocale` field is read multiple times in `initDefault()`
On Mon, 6 Jun 2022 17:31:15 GMT, Naoto Sato wrote:
>> Сергей Цыпанов has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> 8287860: Mark hash fields with @Stable
>
> src/java.base/share/classes/java/util/Locale.java line 1084:
>
>> 1082:
11 matches
Mail list logo