Re: RFR: 8361300: Document exceptions for Unsafe offset methods [v4]

2025-07-08 Thread Doug Lea
On Tue, 8 Jul 2025 17:59:32 GMT, Alan Bateman wrote: >> Tracked in 8360541; I think we can implement in a separate patch. Don't know >> if this is worth backporting to MRs. > > Ah yes, I'd forgotten I created this issue to track clarifying the spec. Sure, the clarification is long past being us

Re: RFR: 8361300: Document exceptions for Unsafe offset methods [v4]

2025-07-08 Thread Alan Bateman
On Mon, 7 Jul 2025 12:06:54 GMT, Chen Liang wrote: >> @AlanBateman Yeah, I think that makes sense—IIRC it's been that way in >> practice since forever, but making it clear in documentation seems like the >> right thing to do. > > Tracked in 8360541; I think we can implement in a separate patch.

Re: RFR: 8361300: Document exceptions for Unsafe offset methods [v4]

2025-07-08 Thread Chen Liang
On Thu, 3 Jul 2025 18:41:27 GMT, Chen Liang wrote: >> Unsafe throws IAE for misusing static vs instance fields, and it's revealed >> that AtomicXxxFieldUpdaters are using this mechanism to reject static >> fields. This is not a good practice, but we can at least document this so we >> don't ac

Re: RFR: 8361300: Document exceptions for Unsafe offset methods [v4]

2025-07-07 Thread Chen Liang
On Mon, 7 Jul 2025 09:58:15 GMT, Viktor Klang wrote: >> src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java >> line 407: >> >>> 405: if (Modifier.isStatic(modifiers)) >>> 406: throw new IllegalArgumentException("Must not be a >>> s

Re: RFR: 8361300: Document exceptions for Unsafe offset methods [v4]

2025-07-07 Thread Chen Liang
On Mon, 7 Jul 2025 09:54:28 GMT, Per Minborg wrote: >> Chen Liang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Test to verify observed internal unsafe behaviors > > src/java.base/share/classes/java/util/concurrent/atomic/AtomicInteger

Re: RFR: 8361300: Document exceptions for Unsafe offset methods [v4]

2025-07-07 Thread Alan Bateman
On Thu, 3 Jul 2025 18:41:27 GMT, Chen Liang wrote: >> Unsafe throws IAE for misusing static vs instance fields, and it's revealed >> that AtomicXxxFieldUpdaters are using this mechanism to reject static >> fields. This is not a good practice, but we can at least document this so we >> don't ac

Re: RFR: 8361300: Document exceptions for Unsafe offset methods [v4]

2025-07-07 Thread Viktor Klang
On Mon, 7 Jul 2025 09:56:07 GMT, Alan Bateman wrote: >> Chen Liang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Test to verify observed internal unsafe behaviors > > src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntege

Re: RFR: 8361300: Document exceptions for Unsafe offset methods [v4]

2025-07-07 Thread Per Minborg
On Thu, 3 Jul 2025 18:41:27 GMT, Chen Liang wrote: >> Unsafe throws IAE for misusing static vs instance fields, and it's revealed >> that AtomicXxxFieldUpdaters are using this mechanism to reject static >> fields. This is not a good practice, but we can at least document this so we >> don't ac

Re: RFR: 8361300: Document exceptions for Unsafe offset methods [v4]

2025-07-06 Thread Chen Liang
On Sun, 6 Jul 2025 18:32:56 GMT, ExE Boss wrote: >> Chen Liang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Test to verify observed internal unsafe behaviors > > test/jdk/jdk/internal/misc/Unsafe/AddressComputationContractTest.java li

Re: RFR: 8361300: Document exceptions for Unsafe offset methods [v4]

2025-07-06 Thread ExE Boss
On Thu, 3 Jul 2025 18:41:27 GMT, Chen Liang wrote: >> Unsafe throws IAE for misusing static vs instance fields, and it's revealed >> that AtomicXxxFieldUpdaters are using this mechanism to reject static >> fields. This is not a good practice, but we can at least document this so we >> don't ac

Re: RFR: 8361300: Document exceptions for Unsafe offset methods [v4]

2025-07-03 Thread Chen Liang
> Unsafe throws IAE for misusing static vs instance fields, and it's revealed > that AtomicXxxFieldUpdaters are using this mechanism to reject static fields. > This is not a good practice, but we can at least document this so we don't > accidentally introduce problems. Chen Liang has updated th

Re: RFR: 8361300: Document exceptions for Unsafe offset methods

2025-07-03 Thread Chen Liang
On Thu, 26 Jun 2025 05:42:24 GMT, ExE Boss wrote: >> Unsafe throws IAE for misusing static vs instance fields, and it's revealed >> that AtomicXxxFieldUpdaters are using this mechanism to reject static >> fields. This is not a good practice, but we can at least document this so we >> don't acc

Re: RFR: 8361300: Document exceptions for Unsafe offset methods [v2]

2025-07-03 Thread Chen Liang
On Thu, 3 Jul 2025 13:56:24 GMT, Chen Liang wrote: >> Unsafe throws IAE for misusing static vs instance fields, and it's revealed >> that AtomicXxxFieldUpdaters are using this mechanism to reject static >> fields. This is not a good practice, but we can at least document this so we >> don't ac

Re: RFR: 8361300: Document exceptions for Unsafe offset methods [v3]

2025-07-03 Thread Chen Liang
> Unsafe throws IAE for misusing static vs instance fields, and it's revealed > that AtomicXxxFieldUpdaters are using this mechanism to reject static fields. > This is not a good practice, but we can at least document this so we don't > accidentally introduce problems. Chen Liang has updated th

Re: RFR: 8361300: Document exceptions for Unsafe offset methods [v2]

2025-07-03 Thread Chen Liang
> Unsafe throws IAE for misusing static vs instance fields, and it's revealed > that AtomicXxxFieldUpdaters are using this mechanism to reject static fields. > This is not a good practice, but we can at least document this so we don't > accidentally introduce problems. Chen Liang has updated th

Re: RFR: 8361300: Document exceptions for Unsafe offset methods

2025-07-02 Thread Alan Bateman
On Tue, 24 Jun 2025 00:04:54 GMT, Chen Liang wrote: > Unsafe throws IAE for misusing static vs instance fields, and it's revealed > that AtomicXxxFieldUpdaters are using this mechanism to reject static fields. > This is not a good practice, but we can at least document this so we don't > accid

Re: RFR: 8361300: Document exceptions for Unsafe offset methods

2025-07-02 Thread ExE Boss
On Tue, 24 Jun 2025 00:04:54 GMT, Chen Liang wrote: > Unsafe throws IAE for misusing static vs instance fields, and it's revealed > that AtomicXxxFieldUpdaters are using this mechanism to reject static fields. > This is not a good practice, but we can at least document this so we don't > accid

Re: RFR: 8361300: Document exceptions for Unsafe offset methods

2025-07-02 Thread Chen Liang
On Tue, 24 Jun 2025 00:04:54 GMT, Chen Liang wrote: > Unsafe throws IAE for misusing static vs instance fields, and it's revealed > that AtomicXxxFieldUpdaters are using this mechanism to reject static fields. > This is not a good practice, but we can at least document this so we don't > accid

Re: RFR: 8361300: Document exceptions for Unsafe offset methods

2025-07-02 Thread Chen Liang
On Tue, 24 Jun 2025 18:34:02 GMT, ExE Boss wrote: >> Unsafe throws IAE for misusing static vs instance fields, and it's revealed >> that AtomicXxxFieldUpdaters are using this mechanism to reject static >> fields. This is not a good practice, but we can at least document this so we >> don't acc

Re: RFR: 8361300: Document exceptions for Unsafe offset methods

2025-07-02 Thread Chen Liang
On Tue, 24 Jun 2025 18:16:29 GMT, Chen Liang wrote: >> src/java.base/share/classes/jdk/internal/misc/Unsafe.java line 1070: >> >>> 1068: * >>> 1069: * @throws NullPointerException if the field is {@code null} >>> 1070: * @throws IllegalArgumentException if the field is static >>

RFR: 8361300: Document exceptions for Unsafe offset methods

2025-07-02 Thread Chen Liang
Unsafe throws IAE for misusing static vs instance fields, and it's revealed that AtomicXxxFieldUpdaters are using this mechanism to reject static fields. This is not a good practice, but we can at least document this so we don't accidentally introduce problems. - Commit messages: