Re: RFR: 8275338: Add JFR events for notable serialization situations [v4]

2024-01-10 Thread Raffaello Giulietti
On Wed, 10 Jan 2024 16:58:43 GMT, Roger Riggs wrote: >> I'm not sure that a `native` method is not considered effective by >> serialization. I have to check. > > The spec is silent about methods being 'native'; it would generally be > impractical to implement native methods for these purposes,

Re: RFR: 8275338: Add JFR events for notable serialization situations [v13]

2024-01-10 Thread Raffaello Giulietti
On Wed, 10 Jan 2024 16:55:58 GMT, Roger Riggs wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Changes according to reviewers feedback. > > src/j

Re: RFR: 8275338: Add JFR events for notable serialization situations [v12]

2024-01-10 Thread Raffaello Giulietti
On Wed, 10 Jan 2024 16:49:50 GMT, Roger Riggs wrote: >> Conceptually, these are independent types. There's no logical relationship >> between them. Sharing a zero length array would convey a false sense of >> logical sharing. > > true, but its wasted space and IMHO ok as a local and private

Re: RFR: 8275338: Add JFR events for notable serialization situations [v13]

2024-01-10 Thread Raffaello Giulietti
> Adds serialization misdeclaration events to JFR. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Changes according to reviewers feedback. - Changes: - all: https://git.openjdk.org/jdk/pull/17129/files -

Re: RFR: 8310813: Simplify and modernize equals, hashCode, and compareTo for BigInteger [v11]

2024-01-10 Thread Raffaello Giulietti
On Wed, 10 Jan 2024 14:48:21 GMT, Roger Riggs wrote: >> Pavel Rappo has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 20 commits: >> >> - Use Integer.compareUnsigned >> - Update copyright years and headers >> - Merge branch

Re: RFR: 8275338: Add JFR events for notable serialization situations [v12]

2024-01-10 Thread Raffaello Giulietti
On Tue, 9 Jan 2024 18:31:49 GMT, Daniel Fuchs wrote: >> Yes, that's perhaps clearer, will do. > > Typically in other places in the JDK we use `priviledgedXxx` for naming > methods that are simple wrappers that call `xxx` from within a > `doPrivileged`. The method is called privileged because

Re: RFR: 8310813: Simplify and modernize equals, hashCode, and compareTo for BigInteger [v10]

2024-01-09 Thread Raffaello Giulietti
On Tue, 2 Jan 2024 14:37:27 GMT, Pavel Rappo wrote: >> Please review this PR to use modern APIs and language features to simplify >> equals, hashCode, and compareTo for BigInteger. If you have any performance >> concerns, please raise them. >> >> This PR is cherry-picked from a bigger,

Re: RFR: 8275338: Add JFR events for notable serialization situations [v12]

2024-01-09 Thread Raffaello Giulietti
On Mon, 8 Jan 2024 18:15:36 GMT, Roger Riggs wrote: >> Raffaello Giulietti has updated the pull request with a new target base due >> to a merge or a rebase. The incremental webrev excludes the unrelated >> changes brought in by the merge/rebase. The pull request contains

Re: RFR: 8275338: Add JFR events for notable serialization situations [v12]

2024-01-09 Thread Raffaello Giulietti
On Mon, 8 Jan 2024 18:38:52 GMT, Roger Riggs wrote: >> Raffaello Giulietti has updated the pull request with a new target base due >> to a merge or a rebase. The incremental webrev excludes the unrelated >> changes brought in by the merge/rebase. The pull request contains

Re: RFR: 8275338: Add JFR events for notable serialization situations [v12]

2024-01-08 Thread Raffaello Giulietti
> Adds serialization misdeclaration events to JFR. Raffaello Giulietti has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 15 additional commits si

Re: RFR: 8068958: Timestamp.from(Instant) should throw when conversion is not possible [v3]

2023-12-23 Thread Raffaello Giulietti
On Sat, 23 Dec 2023 15:22:58 GMT, Eamonn McManus wrote: >> Multiplying with `*` never produces `ArithmeticException`, so the catch in >> the existing code is never triggered. `Math.multiplyExact` does produce >> `ArithmeticException` if the multiplication overflows. So we can use that, >> and

Re: RFR: 8068958: Timestamp.from(Instant) should throw when conversion is not possible [v2]

2023-12-22 Thread Raffaello Giulietti
On Fri, 22 Dec 2023 22:55:09 GMT, Eamonn McManus wrote: >> Multiplying with `*` never produces `ArithmeticException`, so the catch in >> the existing code is never triggered. `Math.multiplyExact` does produce >> `ArithmeticException` if the multiplication overflows. So we can use that, >> and

Re: RFR: 8316662: Remove one allocation per conversion in Double.toString(double) and Float.toString(float) [v3]

2023-12-22 Thread Raffaello Giulietti
On Fri, 27 Oct 2023 12:10:07 GMT, Raffaello Giulietti wrote: >> By correctly sizing an intermediate `byte[]` and making use of the internal >> `newStringNoRepl()` method, one allocation per conversion can be avoided >> when the runtime uses compact strings. > > Raffael

Re: RFR: 8068958: Timestamp.from(Instant) should throw when conversion is not possible

2023-12-22 Thread Raffaello Giulietti
On Thu, 21 Dec 2023 21:51:10 GMT, Eamonn McManus wrote: > Multiplying with `*` never produces `ArithmeticException`, so the catch in > the existing code is never triggered. `Math.multiplyExact` does produce > `ArithmeticException` if the multiplication overflows. So we can use that, > and

Re: RFR: 8275338: Add JFR events for notable serialization situations [v11]

2023-12-21 Thread Raffaello Giulietti
> Adds serialization misdeclaration events to JFR. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Simplified event messages. Remove ckecker allocation. - Changes: - all: https://git.openjdk.org/jdk/p

Re: RFR: 8275338: Add JFR events for notable serialization situations [v10]

2023-12-21 Thread Raffaello Giulietti
On Thu, 21 Dec 2023 21:24:43 GMT, Roger Riggs wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Corrected @Label of event and of field. > > src/java.base/share/classes/java/io/O

Re: RFR: JDK-8311009: Long.toUnsignedString(long, int) doesn't have to create a BigInteger [v2]

2023-12-21 Thread Raffaello Giulietti
On Wed, 28 Jun 2023 07:57:25 GMT, Tingjun Yuan wrote: >> This PR changes the implementation of `Long.toUnsignedString(long, int)` for >> "default" radices, which avoids creating a `BigInteger` and makes use of >> `Long.divideUnsigned` and `Long.remainderUnsigned`. >> >> I've run the test on

Re: RFR: 8275338: Add JFR events for notable serialization situations [v10]

2023-12-21 Thread Raffaello Giulietti
> Adds serialization misdeclaration events to JFR. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Corrected @Label of event and of field. - Changes: - all: https://git.openjdk.org/jdk/pull/17129/files -

Re: RFR: 8275338: Add JFR events for notable serialization situations [v9]

2023-12-21 Thread Raffaello Giulietti
> Adds serialization misdeclaration events to JFR. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Removed @module from test. - Changes: - all: https://git.openjdk.org/jdk/pull/17129/files - new: ht

Re: RFR: 8275338: Add JFR events for notable serialization situations [v8]

2023-12-20 Thread Raffaello Giulietti
> Adds serialization misdeclaration events to JFR. Raffaello Giulietti has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 11 additional commits si

Re: RFR: 8275338: Add JFR events for notable serialization situations [v7]

2023-12-20 Thread Raffaello Giulietti
> Adds serialization misdeclaration events to JFR. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Minor changes. - Changes: - all: https://git.openjdk.org/jdk/pull/17129/files - new: https://git.openjdk.

Re: RFR: 8275338: Add JFR events for notable serialization situations [v6]

2023-12-20 Thread Raffaello Giulietti
> Adds serialization misdeclaration events to JFR. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Removed event kind. serialVersionUID must have type long. Test now base on keyword search in event message. Commen

Re: RFR: 8275338: Add JFR events for notable serialization situations [v3]

2023-12-20 Thread Raffaello Giulietti
On Wed, 20 Dec 2023 14:17:19 GMT, Roger Riggs wrote: >> Same remark here about finality as >> https://github.com/openjdk/jdk/pull/17129#discussion_r1432400888. public >> statics should be final. > > I'd also remove the error codes, the string messages will be pretty stable > and the extra

Re: RFR: 8275338: Add JFR events for notable serialization situations [v5]

2023-12-20 Thread Raffaello Giulietti
On Wed, 20 Dec 2023 14:28:39 GMT, Roger Riggs wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Changes according to reviewer's comments. > > It would also be useful/interesting

Re: RFR: 8275338: Add JFR events for notable serialization situations [v4]

2023-12-20 Thread Raffaello Giulietti
On Tue, 19 Dec 2023 19:19:35 GMT, Roger Riggs wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Better name for a label, corrected name of removed field. > > src/j

Re: RFR: 8275338: Add JFR events for notable serialization situations [v5]

2023-12-19 Thread Raffaello Giulietti
On Tue, 19 Dec 2023 17:15:40 GMT, Erik Gahlin wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Changes according to reviewer's comments. > > src/j

Re: RFR: 8275338: Add JFR events for notable serialization situations [v5]

2023-12-19 Thread Raffaello Giulietti
On Tue, 19 Dec 2023 16:45:04 GMT, Raffaello Giulietti wrote: >> Adds serialization misdeclaration events to JFR. > > Raffaello Giulietti has updated the pull request incrementally with one > additional commit since the last revision: > > Changes according to reviewer'

Re: RFR: 8275338: Add JFR events for notable serialization situations [v3]

2023-12-19 Thread Raffaello Giulietti
On Tue, 19 Dec 2023 17:13:58 GMT, Erik Gahlin wrote: >> The intent is that they are stable and for programmatic usage, whereas the >> message is more for human consumption. The codes are used in the test, for >> example, and are declared as public static in the event classes. >> >>

Re: RFR: 8275338: Add JFR events for notable serialization situations [v5]

2023-12-19 Thread Raffaello Giulietti
> Adds serialization misdeclaration events to JFR. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Changes according to reviewer's comments. - Changes: - all: https://git.openjdk.org/jdk/pull/17129/fi

Re: RFR: 8275338: Add JFR events for notable serialization situations [v4]

2023-12-19 Thread Raffaello Giulietti
On Tue, 19 Dec 2023 15:56:39 GMT, Raffaello Giulietti wrote: > > Is it per class for each classloader that loads it? Or is it per class per > > JVM? It's more out of curiosity than anything else because I don't think it > > makes a big difference (I don't expect too

Re: RFR: 8275338: Add JFR events for notable serialization situations [v4]

2023-12-19 Thread Raffaello Giulietti
On Tue, 19 Dec 2023 14:39:47 GMT, Jaikiran Pai wrote: > Is it per class for each classloader that loads it? Or is it per class per > JVM? It's more out of curiosity than anything else because I don't think it > makes a big difference (I don't expect too many classloaders that would lead > to

Re: RFR: 8275338: Add JFR events for notable serialization situations [v4]

2023-12-19 Thread Raffaello Giulietti
> Adds serialization misdeclaration events to JFR. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Better name for a label, corrected name of removed field. - Changes: - all: https://git.openjdk.org/jdk/p

Re: RFR: 8275338: Add JFR events for notable serialization situations [v3]

2023-12-19 Thread Raffaello Giulietti
On Tue, 19 Dec 2023 10:43:57 GMT, Erik Gahlin wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Event enabled on profile.jfc but disabled on default.jfc. > > src/jdk.jf

Re: RFR: 8275338: Add JFR events for notable serialization situations [v3]

2023-12-18 Thread Raffaello Giulietti
> Adds serialization misdeclaration events to JFR. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Event enabled on profile.jfc but disabled on default.jfc. - Changes: - all: https://git.openjdk.org/jdk/p

Re: RFR: 8275338: Add JFR events for notable serialization situations [v2]

2023-12-18 Thread Raffaello Giulietti
On Sat, 16 Dec 2023 01:27:17 GMT, Erik Gahlin wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Restrict accessibility of nested classes. > > It seems correct to have the event d

Re: RFR: 8275338: Add JFR events for notable serialization situations [v2]

2023-12-15 Thread Raffaello Giulietti
> Adds serialization misdeclaration events to JFR. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Restrict accessibility of nested classes. - Changes: - all: https://git.openjdk.org/jdk/pull/17129/fi

Re: Regexp with word-boundary followed by unicode character doesn't work in 19, 21

2023-12-15 Thread Raffaello Giulietti
By default, a word boundary only considers ASCII letters and digits. See "Predefined character classes" in the documentation. To add Unicode support, you have a choice between adding a flag as a 2nd argument to the compile() method Pattern p = Pattern.compile("(\\b" + word + "\\b)",

RFR: 8275338: Add JFR events for notable serialization situations

2023-12-15 Thread Raffaello Giulietti
Adds serialization misdeclaration events to JFR. - Commit messages: - Make use of EventNames. - Merge branch 'master' into 8275338 - 8275338: Add JFR events for notable serialization situations Changes: https://git.openjdk.org/jdk/pull/17129/files Webrev:

Re: RFR: 8275338: Add JFR events for notable serialization situations

2023-12-15 Thread Raffaello Giulietti
On Fri, 15 Dec 2023 17:34:53 GMT, Raffaello Giulietti wrote: > Adds serialization misdeclaration events to JFR. A serialization misdeclaration on one of the following fields or methods means that they are not declared according to the Java Object Serialization Specification (J

Re: RFR: 8321180: Condition for non-latin1 string size too large exception is off by one [v3]

2023-12-09 Thread Raffaello Giulietti
On Fri, 8 Dec 2023 22:35:30 GMT, Roger Riggs wrote: >> In the compact string implementation of non-latin1 (UTF16) strings the >> length is constrained by VM implementation limit on the size a byte array >> that can be allocated. To produce a useful exception the implementation >> checks the

Re: RFR: 8321180: Condition for non-latin1 string size too large exception is off by one [v2]

2023-12-08 Thread Raffaello Giulietti
On Fri, 8 Dec 2023 19:50:30 GMT, Roger Riggs wrote: >> In the compact string implementation of non-latin1 (UTF16) strings the >> length is constrained by VM implementation limit on the size a byte array >> that can be allocated. To produce a useful exception the implementation >> checks the

Re: RFR: 8321180: Condition for non-latin1 string size too large exception is off by one

2023-12-08 Thread Raffaello Giulietti
On Fri, 8 Dec 2023 16:28:21 GMT, ExE Boss wrote: >> In the compact string implementation of non-latin1 (UTF16) strings the >> length is constrained by VM implementation limit on the size a byte array >> that can be allocated. To produce a useful exception the implementation >> checks the

Re: RFR: 8320759: Creation of random BigIntegers can be made faster [v3]

2023-12-06 Thread Raffaello Giulietti
On Wed, 6 Dec 2023 15:07:59 GMT, fabioromano1 wrote: >> So, item 1 is a non-issue and item 2 is not likely a problem in practice. >> What, if anything, will be done about item 3? > > @bplb Maybe an assertion at the end of `randomBits(int, Random)` method, or a > test class. @fabioromano1 As

Re: RFR: 8320759: Creation of random BigIntegers can be made faster [v3]

2023-12-05 Thread Raffaello Giulietti
On Tue, 5 Dec 2023 12:46:49 GMT, fabioromano1 wrote: >> Relaying comments from a colleague: >> >> 1. Half of the random bits are wasted by the use of `nextInt()`, which by >> default invokes `nextLong()` and throws away the lower 32 bits. Not sure if >> complicating the code to use all the 64

Re: RFR: 8320759: Creation of random BigIntegers can be made faster [v3]

2023-12-05 Thread Raffaello Giulietti
On Tue, 5 Dec 2023 10:46:41 GMT, fabioromano1 wrote: >> Relaying comments from a colleague: >> >> 1. Half of the random bits are wasted by the use of `nextInt()`, which by >> default invokes `nextLong()` and throws away the lower 32 bits. Not sure if >> complicating the code to use all the 64

Re: RFR: 8311906: Improve robustness of String constructors with mutable array inputs [v13]

2023-11-28 Thread Raffaello Giulietti
On Mon, 27 Nov 2023 19:09:40 GMT, Roger Riggs wrote: >> Strings, after construction, are immutable but may be constructed from >> mutable arrays of bytes, characters, or integers. >> The string constructors should guard against the effects of mutating the >> arrays during construction that

Re: RFR: 8311906: Improve robustness of String constructors with mutable array inputs [v10]

2023-11-20 Thread Raffaello Giulietti
On Mon, 20 Nov 2023 19:35:27 GMT, Roger Riggs wrote: >> Strings, after construction, are immutable but may be constructed from >> mutable arrays of bytes, characters, or integers. >> The string constructors should guard against the effects of mutating the >> arrays during construction that

Re: RFR: 8311906: Improve robustness of String constructors with mutable array inputs [v8]

2023-11-16 Thread Raffaello Giulietti
On Thu, 16 Nov 2023 20:27:11 GMT, Roger Riggs wrote: >> Strings, after construction, are immutable but may be constructed from >> mutable arrays of bytes, characters, or integers. >> The string constructors should guard against the effects of mutating the >> arrays during construction that

Re: RFR: 8311906: Improve robustness of String constructors with mutable array inputs [v5]

2023-11-16 Thread Raffaello Giulietti
On Wed, 15 Nov 2023 22:15:54 GMT, Roger Riggs wrote: >> Strings, after construction, are immutable but may be constructed from >> mutable arrays of bytes, characters, or integers. >> The string constructors should guard against the effects of mutating the >> arrays during construction that

Re: RFR: 8311906: Improve robustness of String constructors with mutable array inputs [v5]

2023-11-16 Thread Raffaello Giulietti
On Wed, 15 Nov 2023 22:15:54 GMT, Roger Riggs wrote: >> Strings, after construction, are immutable but may be constructed from >> mutable arrays of bytes, characters, or integers. >> The string constructors should guard against the effects of mutating the >> arrays during construction that

Re: RFR: 8311906: Improve robustness of String constructors with mutable array inputs [v4]

2023-11-16 Thread Raffaello Giulietti
On Wed, 15 Nov 2023 15:25:21 GMT, Raffaello Giulietti wrote: >> Roger Riggs has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update PPC implementation of string_compress to return the index of the >> non-l

Re: RFR: 8311906: Improve robustness of String constructors with mutable array inputs [v4]

2023-11-16 Thread Raffaello Giulietti
On Wed, 15 Nov 2023 22:08:19 GMT, Roger Riggs wrote: >> test/jdk/java/lang/String/StringRacyConstructor.java line 190: >> >>> 188: if (printWarningCount == 0) { >>> 189: printWarningCount = 1; >>> 190:

Re: RFR: 8311906: Improve robustness of String constructors with mutable array inputs [v4]

2023-11-15 Thread Raffaello Giulietti
On Tue, 14 Nov 2023 16:05:51 GMT, Roger Riggs wrote: >> Strings, after construction, are immutable but may be constructed from >> mutable arrays of bytes, characters, or integers. >> The string constructors should guard against the effects of mutating the >> arrays during construction that

Re: RFR: 8311906: Improve robustness of String constructors with mutable array inputs [v2]

2023-11-10 Thread Raffaello Giulietti
On Thu, 9 Nov 2023 04:16:25 GMT, Roger Riggs wrote: >> Strings, after construction, are immutable but may be constructed from >> mutable arrays of bytes, characters, or integers. >> The string constructors should guard against the effects of mutating the >> arrays during construction that

Re: RFR: 8311906: Improve robustness of String constructors with mutable array inputs [v2]

2023-11-10 Thread Raffaello Giulietti
On Thu, 9 Nov 2023 04:16:25 GMT, Roger Riggs wrote: >> Strings, after construction, are immutable but may be constructed from >> mutable arrays of bytes, characters, or integers. >> The string constructors should guard against the effects of mutating the >> arrays during construction that

Integrated: 8319174: Enhance robustness of some j.m.BigInteger constructors

2023-11-10 Thread Raffaello Giulietti
On Wed, 1 Nov 2023 12:32:24 GMT, Raffaello Giulietti wrote: > Enhance `java.math.BigInteger` constructors taking a `byte[]` argument by > improving guarantees of internal invariants. This pull request has now been integrated. Changeset: a64fc48e Author:Raffaello Giuliett

Integrated: 8318915: Enhance checks in BigDecimal.toPlainString()

2023-11-08 Thread Raffaello Giulietti
On Wed, 1 Nov 2023 17:40:04 GMT, Raffaello Giulietti wrote: > Prevent a `NegativeArraySizeException` in `BigDecimal.toPlainString()`, > throwing `OutOfMemoryError` instead to indicate that the resulting `String` > would be too large. This pull request has now been integrated.

Re: RFR: JDK-8295391: Add discussion of binary <-> decimal conversion issues [v2]

2023-11-08 Thread Raffaello Giulietti
On Wed, 8 Nov 2023 18:41:15 GMT, Joe Darcy wrote: >> Add discussion of some of the common pitfalls related to decimal <-> binary >> conversion. > > Joe Darcy has updated the pull request incrementally with one additional > commit since the last revision: > > Address issues found by

Re: RFR: 8311906: Improve robustness of String constructors with mutable array inputs

2023-11-08 Thread Raffaello Giulietti
On Mon, 30 Oct 2023 18:34:44 GMT, Roger Riggs wrote: > Strings, after construction, are immutable but may be constructed from > mutable arrays of bytes, characters, or integers. > The string constructors should guard against the effects of mutating the > arrays during construction that might

Re: RFR: JDK-8295391: Add discussion of binary <-> decimal conversion issues

2023-11-08 Thread Raffaello Giulietti
On Wed, 8 Nov 2023 17:29:28 GMT, Joe Darcy wrote: > Add discussion of some of the common pitfalls related to decimal <-> binary > conversion. src/java.base/share/classes/java/lang/Double.java line 257: > 255: * // Numeric values listed are exact values > 256: * oneTenthApproxAsFloat =

Re: RFR: 8318915: Enhance checks in BigDecimal.toPlainString() [v2]

2023-11-08 Thread Raffaello Giulietti
On Wed, 8 Nov 2023 00:23:22 GMT, Brian Burkhalter wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Using repeat() instead of loop. > > src/java.base/share/classes/java/

Re: RFR: 8318915: Enhance checks in BigDecimal.toPlainString() [v2]

2023-11-07 Thread Raffaello Giulietti
On Tue, 7 Nov 2023 18:22:08 GMT, Roger Riggs wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Using repeat() instead of loop. > > src/java.base/share/classes/java/math/BigDeci

Re: RFR: 8318915: Enhance checks in BigDecimal.toPlainString() [v2]

2023-11-07 Thread Raffaello Giulietti
> Prevent a `NegativeArraySizeException` in `BigDecimal.toPlainString()`, > throwing `OutOfMemoryError` instead to indicate that the resulting `String` > would be too large. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last

Re: RFR: 8319174: Enhance robustness of some j.m.BigInteger constructors [v5]

2023-11-03 Thread Raffaello Giulietti
> Enhance `java.math.BigInteger` constructors taking a `byte[]` argument by > improving guarantees of internal invariants. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Changed behavior on len == 0. - C

Re: RFR: 8319174: Enhance robustness of some j.m.BigInteger constructors [v3]

2023-11-03 Thread Raffaello Giulietti
On Fri, 3 Nov 2023 09:01:48 GMT, Raffaello Giulietti wrote: >> src/java.base/share/classes/java/math/BigInteger.java line 344: >> >>> 342: * @param len the number of bytes to use. >>> 343: * @throws NumberFormatException {@code va

Re: RFR: 8319174: Enhance robustness of some j.m.BigInteger constructors [v4]

2023-11-03 Thread Raffaello Giulietti
> Enhance `java.math.BigInteger` constructors taking a `byte[]` argument by > improving guarantees of internal invariants. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Better formatting for empty loop

Re: RFR: 8319174: Enhance robustness of some j.m.BigInteger constructors [v3]

2023-11-03 Thread Raffaello Giulietti
On Thu, 2 Nov 2023 22:21:15 GMT, Roger Riggs wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Restored ordering of exceptions. > > src/java.base/share/classes/java/math/BigIn

Re: RFR: 8319174: Enhance robustness of some j.m.BigInteger constructors [v3]

2023-11-02 Thread Raffaello Giulietti
> Enhance `java.math.BigInteger` constructors taking a `byte[]` argument by > improving guarantees of internal invariants. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Restored ordering of exce

RFR: 8318915: Enhance checks in BigDecimal.toPlainString()

2023-11-01 Thread Raffaello Giulietti
Prevent a `NegativeArraySizeException` in `BigDecimal.toPlainString()`, throwing `OutOfMemoryError` instead to indicate that the resulting `String` would be too large. - Commit messages: - 8318915: Enhance checks in BigDecimal.toPlainString() Changes:

Re: RFR: 8319174: Enhance robustness of some j.m.BigInteger constructors [v2]

2023-11-01 Thread Raffaello Giulietti
> Enhance `java.math.BigInteger` constructors taking a `byte[]` argument by > improving guarantees of internal invariants. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Static Random instance. - C

RFR: 8319174: Enhance robustness of some j.m.BigInteger constructors

2023-11-01 Thread Raffaello Giulietti
Enhance `java.math.BigInteger` constructors taking a `byte[]` argument by improving guarantees of internal invariants. - Commit messages: - Added @bug to test. - Refactored test to JUnit. - 8319174: Enhance robustness of some j.m.BigInteger constructors - Merge branch 'master'

Re: RFR: 8313621: test/jdk/jdk/internal/math/FloatingDecimal/TestFloatingDecimal should use RandomFactory [v3]

2023-10-30 Thread Raffaello Giulietti
On Mon, 30 Oct 2023 17:55:47 GMT, Brian Burkhalter wrote: >> Change test to use `RandomFactory` instead of `new Random()` and convert it >> to JUnit 5. > > Brian Burkhalter has updated the pull request incrementally with one > additional commit since the last revision: > > 8313621:

Re: RFR: 8313621: test/jdk/jdk/internal/math/FloatingDecimal/TestFloatingDecimal should use RandomFactory [v2]

2023-10-30 Thread Raffaello Giulietti
On Wed, 11 Oct 2023 15:45:29 GMT, Brian Burkhalter wrote: >> Change test to use `RandomFactory` instead of `new Random()` and convert it >> to JUnit 5. > > Brian Burkhalter has updated the pull request incrementally with one > additional commit since the last revision: > > 8313621:

Re: RFR: 8316662: Remove one allocation per conversion in Double.toString(double) and Float.toString(float) [v3]

2023-10-27 Thread Raffaello Giulietti
> By correctly sizing an intermediate `byte[]` and making use of the internal > `newStringNoRepl()` method, one allocation per conversion can be avoided when > the runtime uses compact strings. Raffaello Giulietti has updated the pull request with a new target base due to a merge or

Re: RFR: 8318646: Integer#parseInt("") throws empty NumberFormatException message [v2]

2023-10-24 Thread Raffaello Giulietti
On Mon, 23 Oct 2023 22:15:48 GMT, Uwe Schindler wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Remove 2 extraneous files from commit > > Marked as reviewed by uschindler (Auth

Integrated: 8318646: Integer#parseInt("") throws empty NumberFormatException message

2023-10-24 Thread Raffaello Giulietti
On Mon, 23 Oct 2023 18:04:35 GMT, Raffaello Giulietti wrote: > Please review this simple fix to restore the original exception message that > existed before [16050](https://github.com/openjdk/jdk/pull/16050). This pull request has now been integrated. Changeset: 9bfa0829 Author:Raf

Re: RFR: 8318646: Integer#parseInt("") throws empty NumberFormatException message [v2]

2023-10-23 Thread Raffaello Giulietti
> Please review this simple fix to restore the original exception message that > existed before [16050](https://github.com/openjdk/jdk/pull/16050). Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Remove 2 extraneous

RFR: 8318646: Integer#parseInt("") throws empty NumberFormatException message

2023-10-23 Thread Raffaello Giulietti
Please review this simple fix to restore the original exception message that existed before [16050](https://github.com/openjdk/jdk/pull/16050). - Commit messages: - Merge branch 'master' into 8318646 - 8318646: Integer#parseInt("") throws empty NumberFormatException message -

Re: RFR: JDK-8318476: Add resource consumption note to BigInteger and BigDecimal [v2]

2023-10-23 Thread Raffaello Giulietti
On Mon, 23 Oct 2023 03:46:54 GMT, Joe Darcy wrote: >> Add informative notes to BigInteger and BigDecimal about possible running >> times, etc. > > Joe Darcy has updated the pull request incrementally with one additional > commit since the last revision: > > Respond to review feedback.

Re: RFR: JDK-8318476: Add resource consumption note to BigInteger and BigDecimal [v2]

2023-10-23 Thread Raffaello Giulietti
On Mon, 23 Oct 2023 09:55:16 GMT, Raffaello Giulietti wrote: >> Joe Darcy has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Respond to review feedback. > > src/java.base/share/classes/java/math/BigIn

Re: RFR: 8317515: Unify the code of the parse*() families of methods in j.l.Integer and j.l.Long [v3]

2023-10-23 Thread Raffaello Giulietti
On Mon, 23 Oct 2023 08:17:43 GMT, Uwe Schindler wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Using compareUnsigned() rather than open logic. > > This caused issue s

Re: RFR: JDK-8318476: Add resource consumption note to BigInteger and BigDecimal

2023-10-22 Thread Raffaello Giulietti
On Sat, 21 Oct 2023 00:56:21 GMT, Joe Darcy wrote: > Add informative notes to BigInteger and BigDecimal about possible running > times, etc. src/java.base/share/classes/java/math/BigDecimal.java line 310: > 308: * time of operations can screen out {@code BigDecimal} values with > 309: *

Re: RFR: 8316704: Regex-free parsing of Formatter and FormatProcessor specifiers [v3]

2023-10-20 Thread Raffaello Giulietti
On Fri, 20 Oct 2023 11:04:28 GMT, Shaojin Wen wrote: >> src/java.base/share/classes/java/util/FormatProcessor.java line 247: >> >>> 245: throw new MissingFormatArgumentException(group + " is >>> not immediately followed by an embedded expression"); >>> 246: } else {

Re: RFR: 8316704: Regex-free parsing of Formatter and FormatProcessor specifiers [v3]

2023-10-20 Thread Raffaello Giulietti
On Thu, 19 Oct 2023 06:38:35 GMT, Shaojin Wen wrote: >> @cl4es made performance optimizations for the simple specifiers of >> String.format in PR https://github.com/openjdk/jdk/pull/2830. Based on the >> same idea, I continued to make improvements. I made patterns like %2d %02d >> also be

Re: RFR: 8315585: Optimization for decimal to string [v7]

2023-10-19 Thread Raffaello Giulietti
On Wed, 18 Oct 2023 15:59:31 GMT, Claes Redestad wrote: >> Shaojin Wen has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Use StringConcatFactory.makeConcatWithConstants > > I've opened up #16244 for review - thanks for helping with

Re: RFR: 8316704: Regex-free parsing of Formatter and FormatProcessor specifiers

2023-10-17 Thread Raffaello Giulietti
On Sun, 17 Sep 2023 16:01:33 GMT, Shaojin Wen wrote: > @cl4es made performance optimizations for the simple specifiers of > String.format in PR https://github.com/openjdk/jdk/pull/2830. Based on the > same idea, I continued to make improvements. I made patterns like %2d %02d > also be

Re: RFR: 8318200: String::newStringNoRepl and String::getBytesNoRepl does not throw CharacterCodingException [v4]

2023-10-17 Thread Raffaello Giulietti
On Tue, 17 Oct 2023 11:11:52 GMT, Shaojin Wen wrote: >> When calling String::newStringNoRepl and String::getBytesNoRepl, we need to >> use try...catch to handle CharacterCodingException and throw >> IllegalArgumentException instead of CharacterCodingException to make the >> calling code

Re: RFR: 8317993: Add capturing factories to classes in java.util.function package

2023-10-17 Thread Raffaello Giulietti
On Tue, 17 Oct 2023 13:12:08 GMT, Raffaello Giulietti wrote: >> This PR proposes to add a number of "capturing factories" in classes in the >> `java.util.function` package. >> >> The PR additionally (an optionally) proposes to add a new function >>

Re: RFR: 8317993: Add capturing factories to classes in java.util.function package

2023-10-17 Thread Raffaello Giulietti
On Tue, 17 Oct 2023 08:05:09 GMT, Per Minborg wrote: > This PR proposes to add a number of "capturing factories" in classes in the > `java.util.function` package. > > The PR additionally (an optionally) proposes to add a new function > `UnaryOperator::andThenUnary` to allow composition while

Re: RFR: 8317993: Add capturing factories to classes in java.util.function package

2023-10-17 Thread Raffaello Giulietti
On Tue, 17 Oct 2023 12:16:54 GMT, ExE Boss wrote: >> This PR proposes to add a number of "capturing factories" in classes in the >> `java.util.function` package. >> >> The PR additionally (an optionally) proposes to add a new function >> `UnaryOperator::andThenUnary` to allow composition

Re: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v21]

2023-10-17 Thread Raffaello Giulietti
On Mon, 16 Oct 2023 19:16:41 GMT, Aggelos Biboudis wrote: >> This is the proposed patch for Primitive types in patterns, instanceof, and >> switch (Preview). >> >> Draft spec here: >> https://cr.openjdk.org/~abimpoudis/instanceof/jep443-20231010/specs/instanceof-jls.html > > Aggelos Biboudis

Re: RFR: 8316704: Regex-free parsing of Formatter and FormatProcessor specifiers

2023-10-16 Thread Raffaello Giulietti
On Mon, 25 Sep 2023 12:20:36 GMT, Shaojin Wen wrote: >>> The reason why I split it into multiple small methods is to avoid a single >>> method codeSize > 325. After merging small methods, the performance will >>> decrease. >> >> Yes, I can refactor to keep the same structure and verify

Re: RFR: 8316704: Regex-free parsing of Formatter and FormatProcessor specifiers

2023-10-16 Thread Raffaello Giulietti
On Sun, 17 Sep 2023 16:01:33 GMT, Shaojin Wen wrote: > @cl4es made performance optimizations for the simple specifiers of > String.format in PR https://github.com/openjdk/jdk/pull/2830. Based on the > same idea, I continued to make improvements. I made patterns like %2d %02d > also be

Re: RFR: JDK-8316708: Augment WorstCaseTests with more cases

2023-10-16 Thread Raffaello Giulietti
On Fri, 22 Sep 2023 05:36:02 GMT, Joe Darcy wrote: > A new paper > > "Accuracy of Mathematical Functions in Single, Double, Double Extended, and > Quadruple Precision" > by Brian Gladman, Vincenzo Innocente and Paul Zimmermann > https://members.loria.fr/PZimmermann/papers/accuracy.pdf > >

Re: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v19]

2023-10-13 Thread Raffaello Giulietti
On Wed, 11 Oct 2023 15:43:19 GMT, Aggelos Biboudis wrote: >> This is the first draft of a patch for Primitive types in patterns, >> instanceof, and switch (Preview). >> >> Draft spec here: >> https://cr.openjdk.org/~abimpoudis/instanceof/jep443-20231010/specs/instanceof-jls.html > > Aggelos

Re: RFR: 8317980: Optimization for Integer.parseInt and Long.parseLong

2023-10-12 Thread Raffaello Giulietti
On Thu, 12 Oct 2023 08:58:18 GMT, Chen Liang wrote: >> While only optimizing the fast path is a good idea, I think it is important >> to make sure there is no regression on the slow path - as @schlosna pointed >> out, it's a common way to check if a string can be converted to an int. > > This

Re: RFR: 8313621: test/jdk/jdk/internal/math/FloatingDecimal/TestFloatingDecimal should use RandomFactory

2023-10-11 Thread Raffaello Giulietti
On Tue, 10 Oct 2023 23:21:42 GMT, Brian Burkhalter wrote: > Change test to use `RandomFactory` instead of `new Random()` and convert it > to JUnit 5. test/jdk/jdk/internal/math/FloatingDecimal/TestFloatingDecimal.java line 115: > 113: } > 114: > 115: assertTrue(failures ==

Integrated: 8317515: Unify the code of the parse*() families of methods in j.l.Integer and j.l.Long

2023-10-06 Thread Raffaello Giulietti
On Thu, 5 Oct 2023 09:28:22 GMT, Raffaello Giulietti wrote: > See the [JBS issue](https://bugs.openjdk.org/browse/JDK-8317515) for the > details. This pull request has now been integrated. Changeset: b62e774e Author:Raffaello Giulietti URL: https://git.openjdk.org/jdk/

Re: RFR: 8317515: Unify the code of the parse*() families of methods in j.l.Integer and j.l.Long [v3]

2023-10-06 Thread Raffaello Giulietti
> See the [JBS issue](https://bugs.openjdk.org/browse/JDK-8317515) for the > details. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Using compareUnsigned() rather than open logic. - Changes: - all:

Re: RFR: 8317515: Unify the code of the parse*() families of methods in j.l.Integer and j.l.Long [v2]

2023-10-06 Thread Raffaello Giulietti
On Fri, 6 Oct 2023 10:12:53 GMT, Quan Anh Mai wrote: >> @merykitty For a `String` input that would mean copying the suffix, which >> could be quite long, or make use of the method that accepts a >> `CharSequence`, which has different (although more complete) exception >> messages. Perhaps in

<    1   2   3   4   5   6   >