Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v13]

2024-05-17 Thread Claes Redestad
On Wed, 15 May 2024 11:17:42 GMT, Claes Redestad wrote: >> This PR suggests refactoring the implementation classes of >> java.lang.constant into a new package jdk.internal.constant to enable >> sharing some trusted static factory methods with users elsewhere in >> java.base, such as java.lang.

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v13]

2024-05-17 Thread Adam Sotona
On Wed, 15 May 2024 11:17:42 GMT, Claes Redestad wrote: >> This PR suggests refactoring the implementation classes of >> java.lang.constant into a new package jdk.internal.constant to enable >> sharing some trusted static factory methods with users elsewhere in >> java.base, such as java.lang.

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v13]

2024-05-15 Thread Claes Redestad
On Wed, 15 May 2024 11:17:42 GMT, Claes Redestad wrote: >> This PR suggests refactoring the implementation classes of >> java.lang.constant into a new package jdk.internal.constant to enable >> sharing some trusted static factory methods with users elsewhere in >> java.base, such as java.lang.

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v9]

2024-05-15 Thread Chen Liang
On Wed, 15 May 2024 07:16:37 GMT, Claes Redestad wrote: >> src/java.base/share/classes/java/lang/constant/ClassDesc.java line 226: >> >>> 224: for (int i = 0; i < rank; i++) { >>> 225: sb.append('['); >>> 226: } >> >> Would `sb.repeat("[", rank);` be better here? >>

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v13]

2024-05-15 Thread Claes Redestad
> This PR suggests refactoring the implementation classes of java.lang.constant > into a new package jdk.internal.constant to enable sharing some trusted > static factory methods with users elsewhere in java.base, such as > java.lang.invoke and java.lang.classfile. The refactoring also adds some

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v12]

2024-05-15 Thread ExE Boss
On Wed, 15 May 2024 10:55:31 GMT, Claes Redestad wrote: >> This PR suggests refactoring the implementation classes of >> java.lang.constant into a new package jdk.internal.constant to enable >> sharing some trusted static factory methods with users elsewhere in >> java.base, such as java.lang.

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v10]

2024-05-15 Thread ExE Boss
On Wed, 15 May 2024 07:20:37 GMT, Claes Redestad wrote: >> This PR suggests refactoring the implementation classes of >> java.lang.constant into a new package jdk.internal.constant to enable >> sharing some trusted static factory methods with users elsewhere in >> java.base, such as java.lang.

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v12]

2024-05-15 Thread Claes Redestad
> This PR suggests refactoring the implementation classes of java.lang.constant > into a new package jdk.internal.constant to enable sharing some trusted > static factory methods with users elsewhere in java.base, such as > java.lang.invoke and java.lang.classfile. The refactoring also adds some

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v10]

2024-05-15 Thread Claes Redestad
On Wed, 15 May 2024 09:51:13 GMT, Adam Sotona wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Use sb.repeat, consolidate > > src/java.base/share/classes/java/lang/constant/ClassDesc.java line 341: > >> 339:

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v11]

2024-05-15 Thread Claes Redestad
> This PR suggests refactoring the implementation classes of java.lang.constant > into a new package jdk.internal.constant to enable sharing some trusted > static factory methods with users elsewhere in java.base, such as > java.lang.invoke and java.lang.classfile. The refactoring also adds some

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v10]

2024-05-15 Thread Adam Sotona
On Wed, 15 May 2024 07:20:37 GMT, Claes Redestad wrote: >> This PR suggests refactoring the implementation classes of >> java.lang.constant into a new package jdk.internal.constant to enable >> sharing some trusted static factory methods with users elsewhere in >> java.base, such as java.lang.

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v10]

2024-05-15 Thread Claes Redestad
> This PR suggests refactoring the implementation classes of java.lang.constant > into a new package jdk.internal.constant to enable sharing some trusted > static factory methods with users elsewhere in java.base, such as > java.lang.invoke and java.lang.classfile. The refactoring also adds some

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v9]

2024-05-15 Thread Claes Redestad
On Tue, 14 May 2024 20:20:59 GMT, Chen Liang wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Add microbenchmark for ClassDesc methods + a few optimizations > > src/java.base/share/classes/java/lang/constant/Class

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v9]

2024-05-14 Thread Chen Liang
On Tue, 14 May 2024 17:25:37 GMT, Claes Redestad wrote: >> This PR suggests refactoring the implementation classes of >> java.lang.constant into a new package jdk.internal.constant to enable >> sharing some trusted static factory methods with users elsewhere in >> java.base, such as java.lang.

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v9]

2024-05-14 Thread Claes Redestad
On Tue, 14 May 2024 17:25:37 GMT, Claes Redestad wrote: >> This PR suggests refactoring the implementation classes of >> java.lang.constant into a new package jdk.internal.constant to enable >> sharing some trusted static factory methods with users elsewhere in >> java.base, such as java.lang.

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v9]

2024-05-14 Thread Claes Redestad
> This PR suggests refactoring the implementation classes of java.lang.constant > into a new package jdk.internal.constant to enable sharing some trusted > static factory methods with users elsewhere in java.base, such as > java.lang.invoke and java.lang.classfile. The refactoring also adds some

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v8]

2024-05-14 Thread Claes Redestad
> This PR suggests refactoring the implementation classes of java.lang.constant > into a new package jdk.internal.constant to enable sharing some trusted > static factory methods with users elsewhere in java.base, such as > java.lang.invoke and java.lang.classfile. The refactoring also adds some

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v7]

2024-05-14 Thread Claes Redestad
On Fri, 10 May 2024 08:50:07 GMT, Claes Redestad wrote: >> This PR suggests refactoring the implementation classes of >> java.lang.constant into a new package jdk.internal.constant to enable >> sharing some trusted static factory methods with users elsewhere in >> java.base, such as java.lang.

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v7]

2024-05-10 Thread Claes Redestad
> This PR suggests refactoring the implementation classes of java.lang.constant > into a new package jdk.internal.constant to enable sharing some trusted > static factory methods with users elsewhere in java.base, such as > java.lang.invoke and java.lang.classfile. The refactoring also adds some

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v6]

2024-05-08 Thread Chen Liang
On Thu, 9 May 2024 02:28:16 GMT, ExE Boss wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Validate after copying to avoid TOCTOU > > src/java.base/share/classes/jdk/internal/constant/MethodTypeDescImpl.java > li

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v6]

2024-05-08 Thread ExE Boss
On Wed, 8 May 2024 20:17:18 GMT, Claes Redestad wrote: >> This PR suggests refactoring the implementation classes of >> java.lang.constant into a new package jdk.internal.constant to enable >> sharing some trusted static factory methods with users elsewhere in >> java.base, such as java.lang.i

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v6]

2024-05-08 Thread Claes Redestad
On Wed, 8 May 2024 20:24:52 GMT, Chen Liang wrote: > This patch allows us to merge parsing logic for invoke, constant, and > classfile in the future, all in jdk.internal. Thanks for reviewing! Yes, that's the idea. - PR Comment: https://git.openjdk.org/jdk/pull/19105#issuecomment-

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v6]

2024-05-08 Thread Chen Liang
On Wed, 8 May 2024 20:17:18 GMT, Claes Redestad wrote: >> This PR suggests refactoring the implementation classes of >> java.lang.constant into a new package jdk.internal.constant to enable >> sharing some trusted static factory methods with users elsewhere in >> java.base, such as java.lang.i

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v5]

2024-05-08 Thread Claes Redestad
On Wed, 8 May 2024 19:06:35 GMT, ExE Boss wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Refactor to further avoid re-validating arguments > > src/java.base/share/classes/jdk/internal/constant/MethodTypeDescImpl

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v6]

2024-05-08 Thread Claes Redestad
> This PR suggests refactoring the implementation classes of java.lang.constant > into a new package jdk.internal.constant to enable sharing some trusted > static factory methods with users elsewhere in java.base, such as > java.lang.invoke and java.lang.classfile. The refactoring also adds some

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v5]

2024-05-08 Thread ExE Boss
On Wed, 8 May 2024 10:42:27 GMT, Claes Redestad wrote: >> This PR suggests refactoring the implementation classes of >> java.lang.constant into a new package jdk.internal.constant to enable >> sharing some trusted static factory methods with users elsewhere in >> java.base, such as java.lang.i

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v5]

2024-05-08 Thread Claes Redestad
> This PR suggests refactoring the implementation classes of java.lang.constant > into a new package jdk.internal.constant to enable sharing some trusted > static factory methods with users elsewhere in java.base, such as > java.lang.invoke and java.lang.classfile. The refactoring also adds some

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v4]

2024-05-07 Thread Chen Liang
On Tue, 7 May 2024 16:40:08 GMT, ExE Boss wrote: >> `currentDepth` must be 0 in this case, so `rank` or `netRank` doesn't >> matter. Overriding in `PrimitiveClassDescImpl` sounds reasonable, but then >> perhaps default method should be removed, too, since it would look strange >> to have the d

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v4]

2024-05-07 Thread ExE Boss
On Mon, 6 May 2024 15:18:17 GMT, Claes Redestad wrote: >> src/java.base/share/classes/java/lang/constant/ClassDesc.java line 222: >> >>> 220: } >>> 221: if (desc.length() == 1 && desc.charAt(0) == 'V') { >>> 222: throw new IllegalArgumentException(String.format("not a

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v4]

2024-05-07 Thread Chen Liang
On Tue, 7 May 2024 14:59:21 GMT, Claes Redestad wrote: >> This PR suggests refactoring the implementation classes of >> java.lang.constant into a new package jdk.internal.constant to enable >> sharing some trusted static factory methods with users elsewhere in >> java.base, such as java.lang.i

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v4]

2024-05-07 Thread Claes Redestad
> This PR suggests refactoring the implementation classes of java.lang.constant > into a new package jdk.internal.constant to enable sharing some trusted > static factory methods with users elsewhere in java.base, such as > java.lang.invoke and java.lang.classfile. The refactoring also adds some

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v3]

2024-05-06 Thread Chen Liang
On Mon, 6 May 2024 15:15:36 GMT, Claes Redestad wrote: >> This PR suggests refactoring the implementation classes of >> java.lang.constant into a new package jdk.internal.constant to enable >> sharing some trusted static factory methods with users elsewhere in >> java.base, such as java.lang.i

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v3]

2024-05-06 Thread Claes Redestad
On Mon, 6 May 2024 14:58:02 GMT, Chen Liang wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Rename ofTrusted to ofValidated, remove accidental module-info exports > > src/java.base/share/classes/java/lang/constan

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v3]

2024-05-06 Thread Claes Redestad
> This PR suggests refactoring the implementation classes of java.lang.constant > into a new package jdk.internal.constant to enable sharing some trusted > static factory methods with users elsewhere in java.base, such as > java.lang.invoke and java.lang.classfile. The refactoring also adds some

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v2]

2024-05-06 Thread Chen Liang
On Mon, 6 May 2024 15:03:53 GMT, Claes Redestad wrote: >> src/java.base/share/classes/jdk/internal/constant/ReferenceClassDescImpl.java >> line 68: >> >>> 66: * @jvms 4.3.2 Field Descriptors >>> 67: */ >>> 68: public static ReferenceClassDescImpl ofTrusted(String descriptor) { >>

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v2]

2024-05-06 Thread Claes Redestad
> This PR suggests refactoring the implementation classes of java.lang.constant > into a new package jdk.internal.constant to enable sharing some trusted > static factory methods with users elsewhere in java.base, such as > java.lang.invoke and java.lang.classfile. The refactoring also adds some

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package

2024-05-06 Thread Claes Redestad
On Mon, 6 May 2024 14:51:17 GMT, Chen Liang wrote: >> This PR suggests refactoring the implementation classes of >> java.lang.constant into a new package jdk.internal.constant to enable >> sharing some trusted static factory methods with users elsewhere in >> java.base, such as java.lang.invok

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package

2024-05-06 Thread Claes Redestad
On Mon, 6 May 2024 14:46:09 GMT, Chen Liang wrote: >> This PR suggests refactoring the implementation classes of >> java.lang.constant into a new package jdk.internal.constant to enable >> sharing some trusted static factory methods with users elsewhere in >> java.base, such as java.lang.invok

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package

2024-05-06 Thread Chen Liang
On Mon, 6 May 2024 14:39:08 GMT, Claes Redestad wrote: > This PR suggests refactoring the implementation classes of java.lang.constant > into a new package jdk.internal.constant to enable sharing some trusted > static factory methods with users elsewhere in java.base, such as > java.lang.invok

RFR: 8331724: Refactor j.l.constant implementation to internal package

2024-05-06 Thread Claes Redestad
This PR suggests refactoring the implementation classes of java.lang.constant into a new package jdk.internal.constant to enable sharing some trusted static factory methods with users elsewhere in java.base, such as java.lang.invoke and java.lang.classfile. The refactoring also adds some "truste