Re: RFR: 8343962: [REDO] Move getChars to DecimalDigits [v12]

2025-01-18 Thread Shaojin Wen
> This PR is a resubmission after PR #21593 was rolled back, and the unsafe > offset overflow issue has been fixed. > > 1) Move getChars methods of StringLatin1 and StringUTF16 to DecimalDigits to > reduce duplication. > > 2) HexDigits and OctalDigits also include getCharsLatin1 and getCharsUTF

Re: RFR: 8343962: [REDO] Move getChars to DecimalDigits [v7]

2025-01-18 Thread Claes Redestad
On Sat, 18 Jan 2025 21:48:39 GMT, Chen Liang wrote: >> The doc of `Unsafe::putChar()` delegates to the doc of `Unsafe::putInt()` >> which clearly states that the `Object` and `offset` arguments must locate a >> variable of the same type as the one of argument `x`, which is not the case >> here

Re: RFR: 8343962: [REDO] Move getChars to DecimalDigits [v7]

2025-01-18 Thread Chen Liang
On Fri, 17 Jan 2025 16:05:32 GMT, Raffaello Giulietti wrote: >> src/java.base/share/classes/jdk/internal/util/DecimalDigits.java line 434: >> >>> 432: >>> 433: private static void putCharUTF16(byte[] buf, int charPos, int c) { >>> 434: UNSAFE.putChar(buf, ARRAY_BYTE_BASE_OFFSET + (

Re: Factory methods for SequencedSet and SequencedMap

2025-01-18 Thread Archie Cobbs
On Fri, Jan 17, 2025 at 7:50 PM David Alayachew wrote: > I guess my next question is, there is no bridge method, which is why this > fails. Why not add a bridge method? What is stopping Java from doing this? > In Java class files it's possible to have two methods that differ only in their return

Re: RFR: JDK-8348030 : Extend Math.min to support multiple parameters

2025-01-18 Thread Aviad Zer
On Wed, 15 Jan 2025 14:26:32 GMT, Aviad Zer wrote: > This change extends the Math.min function to support multiple parameters, > improving its usability and code readability. > > Previously, finding the minimum value among multiple variables required using > nested Math.min calls or converting

RFR: JDK-8348030 : Extend Math.min to support multiple parameters

2025-01-18 Thread Aviad Zer
This change extends the Math.min function to support multiple parameters, improving its usability and code readability. Previously, finding the minimum value among multiple variables required using nested Math.min calls or converting the variables into an array and iterating through it. This en