Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message [v5]

2021-07-23 Thread Pavel Rappo
On Tue, 2 Mar 2021 18:07:24 GMT, Stuart Marks wrote: >> test/jdk/jdk/internal/util/ArraysSupport/NewLength.java line 100: >> >>> 98: int r = ArraysSupport.newLength(old, min, pref); >>> 99: fail("expected OutOfMemoryError, got normal return value of >>> " + r); >>> 100:

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message [v5]

2021-03-02 Thread Stuart Marks
On Tue, 2 Mar 2021 15:05:51 GMT, Pavel Rappo wrote: >> Stuart Marks has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update copyright year. > > src/java.base/share/classes/jdk/internal/util/ArraysSupport.java line 579: > >> 577: /**

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message [v6]

2021-03-02 Thread Stuart Marks
> This rewrites the doc of ArraysSupport.newLength, adds detail to the > exception message, and adds a test. In addition to some renaming and a bit of > refactoring of the actual code, I also made two changes of substance to the > code: > > 1. I fixed a problem with overflow checking. In the

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message [v5]

2021-03-02 Thread Pavel Rappo
On Tue, 2 Mar 2021 06:29:07 GMT, Stuart Marks wrote: >> This rewrites the doc of ArraysSupport.newLength, adds detail to the >> exception message, and adds a test. In addition to some renaming and a bit >> of refactoring of the actual code, I also made two changes of substance to >> the code:

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message [v5]

2021-03-02 Thread Roger Riggs
On Tue, 2 Mar 2021 06:29:07 GMT, Stuart Marks wrote: >> This rewrites the doc of ArraysSupport.newLength, adds detail to the >> exception message, and adds a test. In addition to some renaming and a bit >> of refactoring of the actual code, I also made two changes of substance to >> the code:

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message [v5]

2021-03-01 Thread Stuart Marks
> This rewrites the doc of ArraysSupport.newLength, adds detail to the > exception message, and adds a test. In addition to some renaming and a bit of > refactoring of the actual code, I also made two changes of substance to the > code: > > 1. I fixed a problem with overflow checking. In the

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message [v4]

2021-03-01 Thread Stuart Marks
> This rewrites the doc of ArraysSupport.newLength, adds detail to the > exception message, and adds a test. In addition to some renaming and a bit of > refactoring of the actual code, I also made two changes of substance to the > code: > > 1. I fixed a problem with overflow checking. In the

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message [v3]

2021-03-01 Thread Stuart Marks
> This rewrites the doc of ArraysSupport.newLength, adds detail to the > exception message, and adds a test. In addition to some renaming and a bit of > refactoring of the actual code, I also made two changes of substance to the > code: > > 1. I fixed a problem with overflow checking. In the

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message [v2]

2021-01-24 Thread Martin Buchholz
On Sun, 24 Jan 2021 20:14:04 GMT, Martin Buchholz wrote: >> Stuart Marks has updated the pull request incrementally with one additional >> commit since the last revision: >> >> fix typo, clarify asserts disabled, test prefGrowth==0 > > Marked as reviewed by martin (Reviewer). The new docs

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message [v2]

2021-01-24 Thread Martin Buchholz
On Tue, 8 Dec 2020 06:14:35 GMT, Stuart Marks wrote: >> This rewrites the doc of ArraysSupport.newLength, adds detail to the >> exception message, and adds a test. In addition to some renaming and a bit >> of refactoring of the actual code, I also made two changes of substance to >> the code:

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message [v2]

2021-01-24 Thread Martin Buchholz
On Fri, 4 Dec 2020 17:31:20 GMT, Stuart Marks wrote: >> src/java.base/share/classes/jdk/internal/util/ArraysSupport.java line 654: >> >>> 652: return SOFT_MAX_ARRAY_LENGTH; >>> 653: } else { >>> 654: return minLength; >> >> Isn't this last `else if... then..

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message [v2]

2021-01-24 Thread Martin Buchholz
On Tue, 8 Dec 2020 06:14:35 GMT, Stuart Marks wrote: >> This rewrites the doc of ArraysSupport.newLength, adds detail to the >> exception message, and adds a test. In addition to some renaming and a bit >> of refactoring of the actual code, I also made two changes of substance to >> the code:

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message [v2]

2021-01-24 Thread Martin Buchholz
On Tue, 8 Dec 2020 06:14:35 GMT, Stuart Marks wrote: >> This rewrites the doc of ArraysSupport.newLength, adds detail to the >> exception message, and adds a test. In addition to some renaming and a bit >> of refactoring of the actual code, I also made two changes of substance to >> the code:

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message [v2]

2021-01-24 Thread Martin Buchholz
On Wed, 9 Dec 2020 00:32:37 GMT, Paul Sandoz wrote: >> Stuart Marks has updated the pull request incrementally with one additional >> commit since the last revision: >> >> fix typo, clarify asserts disabled, test prefGrowth==0 > >

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message [v2]

2021-01-24 Thread Martin Buchholz
On Tue, 8 Dec 2020 06:14:35 GMT, Stuart Marks wrote: >> This rewrites the doc of ArraysSupport.newLength, adds detail to the >> exception message, and adds a test. In addition to some renaming and a bit >> of refactoring of the actual code, I also made two changes of substance to >> the code:

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message [v2]

2020-12-16 Thread Stuart Marks
On Wed, 9 Dec 2020 00:32:44 GMT, Paul Sandoz wrote: >> Stuart Marks has updated the pull request incrementally with one additional >> commit since the last revision: >> >> fix typo, clarify asserts disabled, test prefGrowth==0 > > Marked as reviewed by psandoz (Reviewer). @Martin-Buchholz

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message [v2]

2020-12-08 Thread Paul Sandoz
On Tue, 8 Dec 2020 06:14:35 GMT, Stuart Marks wrote: >> This rewrites the doc of ArraysSupport.newLength, adds detail to the >> exception message, and adds a test. In addition to some renaming and a bit >> of refactoring of the actual code, I also made two changes of substance to >> the code:

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message [v2]

2020-12-08 Thread Roger Riggs
On Tue, 8 Dec 2020 06:14:35 GMT, Stuart Marks wrote: >> This rewrites the doc of ArraysSupport.newLength, adds detail to the >> exception message, and adds a test. In addition to some renaming and a bit >> of refactoring of the actual code, I also made two changes of substance to >> the code:

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message [v2]

2020-12-08 Thread Roger Riggs
On Tue, 8 Dec 2020 00:48:55 GMT, Stuart Marks wrote: >> The algorithm can be well defined for minGrowth and prefGrowth == 0 without >> extra checks or exceptions with a careful look at the inequality checks. >> For example, as currently coded, if both are zero, it returns >>

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message [v2]

2020-12-07 Thread Stuart Marks
> This rewrites the doc of ArraysSupport.newLength, adds detail to the > exception message, and adds a test. In addition to some renaming and a bit of > refactoring of the actual code, I also made two changes of substance to the > code: > > 1. I fixed a problem with overflow checking. In the

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message

2020-12-07 Thread Stuart Marks
On Mon, 7 Dec 2020 16:05:11 GMT, Roger Riggs wrote: >> The origin of this code is in collections like ArrayList that have an >> existing array (hence oldLength >= 0) and that need it to grow (hence >> minGrowth > 0). Those were the prevailing assumptions in the code from which >> this was

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message

2020-12-07 Thread Roger Riggs
On Sat, 5 Dec 2020 02:37:55 GMT, Stuart Marks wrote: >> Is there a reason the code would not naturally work when either min or >> preferred is zero? >> Why are their preconditions? What do they allow? >> These methods are used in enough places that a slip in any of the clients >> would be

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message

2020-12-04 Thread Stuart Marks
On Fri, 4 Dec 2020 16:02:33 GMT, Roger Riggs wrote: >> This rewrites the doc of ArraysSupport.newLength, adds detail to the >> exception message, and adds a test. In addition to some renaming and a bit >> of refactoring of the actual code, I also made two changes of substance to >> the code:

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message

2020-12-04 Thread Stuart Marks
On Fri, 4 Dec 2020 19:13:45 GMT, Roger Riggs wrote: >> The preconditions aren't checked, because this is an internal method, and >> the code size is minimized in order to help inlining. That's also why >> `hugeLength` is a separate method. (I guess I could add comments to this >> effect.)

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message

2020-12-04 Thread Roger Riggs
On Fri, 4 Dec 2020 17:49:25 GMT, Stuart Marks wrote: >> src/java.base/share/classes/jdk/internal/util/ArraysSupport.java line 640: >> >>> 638: int prefLength = oldLength + Math.max(minGrowth, prefGrowth); >>> // might overflow >>> 639: if (0 < prefLength && prefLength <=

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message

2020-12-04 Thread stefan-zobel
On Fri, 4 Dec 2020 06:50:14 GMT, Stuart Marks wrote: > This rewrites the doc of ArraysSupport.newLength, adds detail to the > exception message, and adds a test. In addition to some renaming and a bit of > refactoring of the actual code, I also made two changes of substance to the > code: >

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message

2020-12-04 Thread Stuart Marks
On Fri, 4 Dec 2020 15:53:01 GMT, Roger Riggs wrote: >> This rewrites the doc of ArraysSupport.newLength, adds detail to the >> exception message, and adds a test. In addition to some renaming and a bit >> of refactoring of the actual code, I also made two changes of substance to >> the code:

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message

2020-12-04 Thread Stuart Marks
On Fri, 4 Dec 2020 15:47:51 GMT, Roger Riggs wrote: >> This rewrites the doc of ArraysSupport.newLength, adds detail to the >> exception message, and adds a test. In addition to some renaming and a bit >> of refactoring of the actual code, I also made two changes of substance to >> the code:

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message

2020-12-04 Thread Roger Riggs
On Fri, 4 Dec 2020 06:50:14 GMT, Stuart Marks wrote: > This rewrites the doc of ArraysSupport.newLength, adds detail to the > exception message, and adds a test. In addition to some renaming and a bit of > refactoring of the actual code, I also made two changes of substance to the > code: >

Re: RFR: 8247373: ArraysSupport.newLength doc, test, and exception message

2020-12-03 Thread Stuart Marks
Hi Martin, I'd appreciate it if you could take a look at this. Thanks, s'marks On 12/3/20 10:57 PM, Stuart Marks wrote: This rewrites the doc of ArraysSupport.newLength, adds detail to the exception message, and adds a test. In addition to some renaming and a bit of refactoring of the

RFR: 8247373: ArraysSupport.newLength doc, test, and exception message

2020-12-03 Thread Stuart Marks
This rewrites the doc of ArraysSupport.newLength, adds detail to the exception message, and adds a test. In addition to some renaming and a bit of refactoring of the actual code, I also made two changes of substance to the code: 1. I fixed a problem with overflow checking. In the original code,