Re: RFR: 8300916: Re-examine the initialization of JNU Charset in StaticProperty [v10]

2023-01-26 Thread Naoto Sato
> This issue was found during the review of this PR: > https://github.com/openjdk/jdk/pull/12132 where `Charset` class was > loaded/initialized at the phase 1 of the startup process. Since `Charset` > depends on `StaticProperty`, loading of `Charset` class should be delayed. I > basically moved

Re: RFR: 8300916: Re-examine the initialization of JNU Charset in StaticProperty [v9]

2023-01-26 Thread Naoto Sato
On Thu, 26 Jan 2023 12:07:20 GMT, Alan Bateman wrote: > Thanks for the updates/iterations, I think you've got this to a good place. > > One thing to think about is having System.initPhase3 read file.encoding and > if not UTF-8, it could call Charset.defaultCharset and if not the expected > val

Re: RFR: 8300916: Re-examine the initialization of JNU Charset in StaticProperty [v9]

2023-01-26 Thread Alan Bateman
On Thu, 26 Jan 2023 00:19:45 GMT, Naoto Sato wrote: >> This issue was found during the review of this PR: >> https://github.com/openjdk/jdk/pull/12132 where `Charset` class was >> loaded/initialized at the phase 1 of the startup process. Since `Charset` >> depends on `StaticProperty`, loading

Re: RFR: 8300916: Re-examine the initialization of JNU Charset in StaticProperty [v4]

2023-01-26 Thread Alan Bateman
On Thu, 26 Jan 2023 02:37:57 GMT, Ichiroh Takiguchi wrote: > Could you explain about fragile scenario ? Charset.defaultCharset does the lookup on the first usage. Since JDK 18, that first usage is in initPhase1 so it will always find the default charset in java.base. In JDK 9-17, the first us

Re: RFR: 8300916: Re-examine the initialization of JNU Charset in StaticProperty [v4]

2023-01-25 Thread Ichiroh Takiguchi
On Wed, 25 Jan 2023 18:58:40 GMT, Alan Bateman wrote: >> `Charset.defaultCharset()` now uses >> `standardProvider.charsetForName()` charset. > >> `Charset.defaultCharset()` now uses >> `standardProvider.charsetForName()` charset. > > I think this is the right thing to do. It can also be change

Re: RFR: 8300916: Re-examine the initialization of JNU Charset in StaticProperty [v9]

2023-01-25 Thread Mandy Chung
On Thu, 26 Jan 2023 00:19:45 GMT, Naoto Sato wrote: >> This issue was found during the review of this PR: >> https://github.com/openjdk/jdk/pull/12132 where `Charset` class was >> loaded/initialized at the phase 1 of the startup process. Since `Charset` >> depends on `StaticProperty`, loading

Re: RFR: 8300916: Re-examine the initialization of JNU Charset in StaticProperty [v9]

2023-01-25 Thread Naoto Sato
> This issue was found during the review of this PR: > https://github.com/openjdk/jdk/pull/12132 where `Charset` class was > loaded/initialized at the phase 1 of the startup process. Since `Charset` > depends on `StaticProperty`, loading of `Charset` class should be delayed. I > basically moved

Re: RFR: 8300916: Re-examine the initialization of JNU Charset in StaticProperty [v8]

2023-01-25 Thread Naoto Sato
On Wed, 25 Jan 2023 23:58:41 GMT, Mandy Chung wrote: >> Naoto Sato has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Restored doPriv > > src/java.base/share/classes/java/nio/charset/Charset.java line 662: > >> 660: } else

Re: RFR: 8300916: Re-examine the initialization of JNU Charset in StaticProperty [v8]

2023-01-25 Thread Mandy Chung
On Wed, 25 Jan 2023 20:50:21 GMT, Naoto Sato wrote: >> This issue was found during the review of this PR: >> https://github.com/openjdk/jdk/pull/12132 where `Charset` class was >> loaded/initialized at the phase 1 of the startup process. Since `Charset` >> depends on `StaticProperty`, loading

Re: RFR: 8300916: Re-examine the initialization of JNU Charset in StaticProperty [v8]

2023-01-25 Thread Naoto Sato
> This issue was found during the review of this PR: > https://github.com/openjdk/jdk/pull/12132 where `Charset` class was > loaded/initialized at the phase 1 of the startup process. Since `Charset` > depends on `StaticProperty`, loading of `Charset` class should be delayed. I > basically moved

Re: RFR: 8300916: Re-examine the initialization of JNU Charset in StaticProperty [v7]

2023-01-25 Thread Naoto Sato
> This issue was found during the review of this PR: > https://github.com/openjdk/jdk/pull/12132 where `Charset` class was > loaded/initialized at the phase 1 of the startup process. Since `Charset` > depends on `StaticProperty`, loading of `Charset` class should be delayed. I > basically moved

Re: RFR: 8300916: Re-examine the initialization of JNU Charset in StaticProperty [v5]

2023-01-25 Thread Naoto Sato
On Wed, 25 Jan 2023 20:13:06 GMT, Alan Bateman wrote: >> Naoto Sato has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Use StaticProperty.fileEncoding() & make the field @Stable > > src/java.base/share/classes/java/nio/charset/Charset.java

Re: RFR: 8300916: Re-examine the initialization of JNU Charset in StaticProperty [v6]

2023-01-25 Thread Naoto Sato
> This issue was found during the review of this PR: > https://github.com/openjdk/jdk/pull/12132 where `Charset` class was > loaded/initialized at the phase 1 of the startup process. Since `Charset` > depends on `StaticProperty`, loading of `Charset` class should be delayed. I > basically moved

Re: RFR: 8300916: Re-examine the initialization of JNU Charset in StaticProperty [v5]

2023-01-25 Thread Alan Bateman
On Wed, 25 Jan 2023 19:35:18 GMT, Naoto Sato wrote: >> This issue was found during the review of this PR: >> https://github.com/openjdk/jdk/pull/12132 where `Charset` class was >> loaded/initialized at the phase 1 of the startup process. Since `Charset` >> depends on `StaticProperty`, loading

Re: RFR: 8300916: Re-examine the initialization of JNU Charset in StaticProperty [v3]

2023-01-25 Thread Mandy Chung
On Wed, 25 Jan 2023 07:41:52 GMT, Alan Bateman wrote: > A simpler, and more reliable, would be to change Charset.defaultCharset to > use standardProvider.charsetForName with the value of "file.encoding", and > avoid the provider lookup completely. This is a good observation. The change looks

Re: RFR: 8300916: Re-examine the initialization of JNU Charset in StaticProperty [v5]

2023-01-25 Thread Naoto Sato
> This issue was found during the review of this PR: > https://github.com/openjdk/jdk/pull/12132 where `Charset` class was > loaded/initialized at the phase 1 of the startup process. Since `Charset` > depends on `StaticProperty`, loading of `Charset` class should be delayed. I > basically moved

Re: RFR: 8300916: Re-examine the initialization of JNU Charset in StaticProperty [v4]

2023-01-25 Thread Naoto Sato
On Wed, 25 Jan 2023 18:45:04 GMT, Naoto Sato wrote: >> This issue was found during the review of this PR: >> https://github.com/openjdk/jdk/pull/12132 where `Charset` class was >> loaded/initialized at the phase 1 of the startup process. Since `Charset` >> depends on `StaticProperty`, loading

Re: RFR: 8300916: Re-examine the initialization of JNU Charset in StaticProperty [v4]

2023-01-25 Thread Alan Bateman
On Wed, 25 Jan 2023 18:45:41 GMT, Naoto Sato wrote: > `Charset.defaultCharset()` now uses > `standardProvider.charsetForName()` charset. I think this is the right thing to do. It can also be changed to use StaticProperty.fileEncoding() and maybe the field can be changed to be a `@Stable` fiel

Re: RFR: 8300916: Re-examine the initialization of JNU Charset in StaticProperty [v4]

2023-01-25 Thread Naoto Sato
On Wed, 25 Jan 2023 18:45:04 GMT, Naoto Sato wrote: >> This issue was found during the review of this PR: >> https://github.com/openjdk/jdk/pull/12132 where `Charset` class was >> loaded/initialized at the phase 1 of the startup process. Since `Charset` >> depends on `StaticProperty`, loading

Re: RFR: 8300916: Re-examine the initialization of JNU Charset in StaticProperty [v4]

2023-01-25 Thread Naoto Sato
> This issue was found during the review of this PR: > https://github.com/openjdk/jdk/pull/12132 where `Charset` class was > loaded/initialized at the phase 1 of the startup process. Since `Charset` > depends on `StaticProperty`, loading of `Charset` class should be delayed. I > basically moved

Re: RFR: 8300916: Re-examine the initialization of JNU Charset in StaticProperty [v3]

2023-01-24 Thread Alan Bateman
On Tue, 24 Jan 2023 21:57:25 GMT, Naoto Sato wrote: >> This issue was found during the review of this PR: >> https://github.com/openjdk/jdk/pull/12132 where `Charset` class was >> loaded/initialized at the phase 1 of the startup process. Since `Charset` >> depends on `StaticProperty`, loading

Re: RFR: 8300916: Re-examine the initialization of JNU Charset in StaticProperty [v3]

2023-01-24 Thread Jaikiran Pai
On Tue, 24 Jan 2023 21:57:25 GMT, Naoto Sato wrote: >> This issue was found during the review of this PR: >> https://github.com/openjdk/jdk/pull/12132 where `Charset` class was >> loaded/initialized at the phase 1 of the startup process. Since `Charset` >> depends on `StaticProperty`, loading

Re: RFR: 8300916: Re-examine the initialization of JNU Charset in StaticProperty [v3]

2023-01-24 Thread Jaikiran Pai
On Tue, 24 Jan 2023 21:57:25 GMT, Naoto Sato wrote: >> This issue was found during the review of this PR: >> https://github.com/openjdk/jdk/pull/12132 where `Charset` class was >> loaded/initialized at the phase 1 of the startup process. Since `Charset` >> depends on `StaticProperty`, loading

Re: RFR: 8300916: Re-examine the initialization of JNU Charset in StaticProperty [v3]

2023-01-24 Thread Naoto Sato
> This issue was found during the review of this PR: > https://github.com/openjdk/jdk/pull/12132 where `Charset` class was > loaded/initialized at the phase 1 of the startup process. Since `Charset` > depends on `StaticProperty`, loading of `Charset` class should be delayed. I > basically moved

Re: RFR: 8300916: Re-examine the initialization of JNU Charset in StaticProperty [v2]

2023-01-24 Thread Naoto Sato
> This issue was found during the review of this PR: > https://github.com/openjdk/jdk/pull/12132 where `Charset` class was > loaded/initialized at the phase 1 of the startup process. Since `Charset` > depends on `StaticProperty`, loading of `Charset` class should be delayed. I > basically moved

RFR: 8300916: Re-examine the initialization of JNU Charset in StaticProperty

2023-01-24 Thread Naoto Sato
This issue was found during the review of this PR: https://github.com/openjdk/jdk/pull/12132 where `Charset` class was loaded/initialized at the phase 1 of the startup process. Since `Charset` depends on `StaticProperty`, loading of `Charset` class should be delayed. I basically moved cache for