Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v21]

2022-11-16 Thread Jim Laskey
On Wed, 16 Nov 2022 15:55:27 GMT, Maurizio Cimadamore wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Wrong line separator > > src/java.base/share/classes/java/util/FormatProcessor.

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v21]

2022-11-16 Thread Jim Laskey
On Wed, 16 Nov 2022 15:56:25 GMT, Maurizio Cimadamore wrote: >> src/java.base/share/classes/java/util/FormatProcessor.java line 42: >> >>> 40: * the embedded expression that follows immediately after the >>> 41: * format specifier. >>> 42: * StringTemplate expressions without a preceeding sp

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v22]

2022-11-16 Thread Jim Laskey
r validation and > transformation. This is a [preview language feature and > API](http://openjdk.java.net/jeps/12). Jim Laskey has updated the pull request incrementally with one additional commit since the last revision: Requested changes #8 - Changes: - all: https://g

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v21]

2022-11-16 Thread Jim Laskey
On Wed, 16 Nov 2022 16:01:20 GMT, Maurizio Cimadamore wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Wrong line separator > > Compiler changes look good to me. I've left some com

Re: RFR of JDK-8285932 Implementation of JEP-430 String Templates (Preview)

2022-11-16 Thread Jim Laskey
preserve the semantics of string templates and text block templates, the list returned by `fragments()` must be one element larger than the list returned by `values()`. @jls 15.8.6 Alex On 11/16/2022 4:49 AM, Jim Laskey wrote: May I get a final (PR) review of JDK-8285932 Implementation of JEP-

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v21]

2022-11-16 Thread Jim Laskey
On Wed, 16 Nov 2022 16:07:51 GMT, Jan Lahoda wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Wrong line separator > > src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Argument

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v21]

2022-11-16 Thread Jim Laskey
On Wed, 16 Nov 2022 20:12:11 GMT, Jim Laskey wrote: >> src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java >> line 1716: >> >>> 1714: t = stringTemplate(t); >>> 1715: typeArgs = null; >>&

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v21]

2022-11-16 Thread Jim Laskey
On Wed, 16 Nov 2022 19:16:26 GMT, Jan Lahoda wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Wrong line separator > > src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacPars

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v21]

2022-11-16 Thread Jim Laskey
On Wed, 16 Nov 2022 18:52:33 GMT, Jan Lahoda wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Wrong line separator > > src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v23]

2022-11-16 Thread Jim Laskey
r validation and > transformation. This is a [preview language feature and > API](http://openjdk.java.net/jeps/12). Jim Laskey has updated the pull request incrementally with two additional commits since the last revision: - Requested changes #8 - Update StringTemplate javadoc

Re: RFR of JDK-8285932 Implementation of JEP-430 String Templates (Preview)

2022-11-17 Thread Jim Laskey
his is important, but OK.] > --- > > The spec of the `interpolate` method has a stray dot and an example which > calls `interpolation()`. Please rename `string` to `result`. Say: @return A > string denoting the interpolation of this `StringTemplate`'s fragments and > values.

Re: RFR of JDK-8285932 Implementation of JEP-430 String Templates (Preview)

2022-11-17 Thread Jim Laskey
I corrected before inserting. On Nov 16, 2022, at 7:41 PM, John Rose mailto:john.r.r...@oracle.com>> wrote: On 16 Nov 2022, at 11:10, Alex Buckley wrote: … For example, the following code contains a template expression that uses the template processor `RAW`, which simply yields the `StringTem

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v21]

2022-11-17 Thread Jim Laskey
On Tue, 15 Nov 2022 19:40:35 GMT, Roger Riggs wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Wrong line separator > > src/java.base/share/classes/java/util/FormatProc

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v21]

2022-11-17 Thread Jim Laskey
On Tue, 15 Nov 2022 20:12:16 GMT, Roger Riggs wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Wrong line separator > > src/java.base/share/classes/jdk/internal/util/FormatCon

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v21]

2022-11-17 Thread Jim Laskey
On Wed, 16 Nov 2022 19:04:04 GMT, Jan Lahoda wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Wrong line separator > > src/jdk.compiler/share/classes/com/sun/tools/javac/parser

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v21]

2022-11-17 Thread Jim Laskey
On Tue, 15 Nov 2022 20:34:30 GMT, Roger Riggs wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Wrong line separator > > src/java.base/share/classes/java/lang/runtime/Template

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v21]

2022-11-17 Thread Jim Laskey
On Tue, 15 Nov 2022 20:37:25 GMT, Roger Riggs wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Wrong line separator > > src/java.base/share/classes/java/lang/runtime/TemplateRu

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v21]

2022-11-17 Thread Jim Laskey
On Tue, 15 Nov 2022 22:12:05 GMT, Roger Riggs wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Wrong line separator > > src/java.base/share/classes/java/lang/template/StringTemplate.jav

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v21]

2022-11-17 Thread Jim Laskey
On Tue, 15 Nov 2022 21:31:57 GMT, Roger Riggs wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Wrong line separator > > src/java.base/share/classes/java/lang/template/Carriers.java lin

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v21]

2022-11-17 Thread Jim Laskey
On Tue, 15 Nov 2022 22:02:53 GMT, Roger Riggs wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Wrong line separator > > src/java.base/share/classes/java/lang/template/StringTemplate.jav

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v21]

2022-11-17 Thread Jim Laskey
On Tue, 15 Nov 2022 21:56:36 GMT, Roger Riggs wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Wrong line separator > > src/java.base/share/classes/java/lang/template/StringTemplate.

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v21]

2022-11-17 Thread Jim Laskey
On Tue, 15 Nov 2022 22:05:47 GMT, Roger Riggs wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Wrong line separator > > src/java.base/share/classes/java/lang/template/StringTemplate.jav

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v21]

2022-11-17 Thread Jim Laskey
On Tue, 15 Nov 2022 22:10:14 GMT, Roger Riggs wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Wrong line separator > > src/java.base/share/classes/java/lang/template/StringTemplate.jav

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v21]

2022-11-17 Thread Jim Laskey
On Tue, 15 Nov 2022 22:15:45 GMT, Roger Riggs wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Wrong line separator > > src/java.base/share/classes/java/lang/template/StringTemplate

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v21]

2022-11-17 Thread Jim Laskey
On Tue, 15 Nov 2022 22:23:27 GMT, Roger Riggs wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Wrong line separator > > src/java.base/share/classes/java/lang/AbstractStringBuilder.java l

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v21]

2022-11-17 Thread Jim Laskey
On Wed, 16 Nov 2022 20:22:54 GMT, Roger Riggs wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Wrong line separator > > src/java.base/share/classes/java/lang/template/StringTempla

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v21]

2022-11-17 Thread Jim Laskey
On Wed, 16 Nov 2022 21:19:21 GMT, Tagir F. Valeev wrote: >> src/java.base/share/classes/java/lang/template/StringTemplateImplFactory.java >> line 202: >> >>> 200: @SuppressWarnings({"unchecked", "varargs"}) >>> 201: private static List toList(E... elements) { >>> 202: return Co

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v23]

2022-11-17 Thread Jim Laskey
On Wed, 16 Nov 2022 21:43:32 GMT, Maurizio Cimadamore wrote: >> Jim Laskey has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Requested changes #8 >> - Update StringTemplate javadoc > > src/java.b

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v21]

2022-11-17 Thread Jim Laskey
On Tue, 15 Nov 2022 21:47:40 GMT, Roger Riggs wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Wrong line separator > > src/java.base/share/classes/java/lang/template/StringProcessor.

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v24]

2022-11-17 Thread Jim Laskey
r validation and > transformation. This is a [preview language feature and > API](http://openjdk.java.net/jeps/12). Jim Laskey has updated the pull request incrementally with one additional commit since the last revision: Requested changes #9 - Changes: - all: https://g

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v23]

2022-11-18 Thread Jim Laskey
On Thu, 17 Nov 2022 15:46:14 GMT, Roger Riggs wrote: >> Jim Laskey has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Requested changes #8 >> - Update StringTemplate javadoc > > src/java.b

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v13]

2022-11-18 Thread Jim Laskey
On Wed, 9 Nov 2022 22:43:40 GMT, Jim Laskey wrote: >> src/java.base/share/classes/java/util/FormatItem.java line 75: >> >>> 73: try { >>> 74: return (long)CHAR_MIX.invokeExact(lengthCoder, value); >>> 75: } catch (Runtime

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v13]

2022-11-18 Thread Jim Laskey
On Wed, 9 Nov 2022 22:44:38 GMT, Jim Laskey wrote: >> src/java.base/share/classes/java/util/FormatProcessor.java line 38: >> >>> 36: >>> 37: /** >>> 38: * This {@linkplain ValidatingProcessor yemplate processor} constructs >>> a String

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v21]

2022-11-18 Thread Jim Laskey
On Wed, 16 Nov 2022 18:31:28 GMT, Jim Laskey wrote: >> src/java.base/share/classes/java/util/FormatProcessor.java line 39: >> >>> 37: /** >>> 38: * This {@linkplain ValidatingProcessor template processor} constructs >>> a String >>> 39:

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v21]

2022-11-18 Thread Jim Laskey
On Wed, 16 Nov 2022 18:32:19 GMT, Jim Laskey wrote: >> And, `StringTemplate` is missing a surrounding code/link tag > > Changing. Changing. - PR: https://git.openjdk.org/jdk/pull/10889

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v25]

2022-11-18 Thread Jim Laskey
r validation and > transformation. This is a [preview language feature and > API](http://openjdk.java.net/jeps/12). Jim Laskey has updated the pull request incrementally with one additional commit since the last revision: Requested changes #10 - Changes: - all: https://g

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v26]

2022-11-18 Thread Jim Laskey
r validation and > transformation. This is a [preview language feature and > API](http://openjdk.java.net/jeps/12). Jim Laskey has updated the pull request incrementally with one additional commit since the last revision: Typo - Changes: - all: https://git.openjdk.org/jd

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v26]

2022-11-21 Thread Jim Laskey
On Fri, 18 Nov 2022 23:05:30 GMT, Roger Riggs wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Typo > > src/java.base/share/classes/java/lang/template/StringProcessor.java l

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v26]

2022-11-21 Thread Jim Laskey
On Fri, 18 Nov 2022 23:00:49 GMT, Roger Riggs wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Typo > > src/java.base/share/classes/java/lang/template/StringTemplate.java line 35:

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v26]

2022-11-21 Thread Jim Laskey
On Fri, 18 Nov 2022 22:25:22 GMT, Roger Riggs wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Typo > > src/java.base/share/classes/java/lang/template/package-info.java line 2

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v26]

2022-11-21 Thread Jim Laskey
On Mon, 21 Nov 2022 12:52:42 GMT, Jim Laskey wrote: >> src/java.base/share/classes/java/lang/template/StringTemplate.java line 35: >> >>> 33: /** >>> 34: * {@link StringTemplate} is the run-time representation of a string >>> template or >>> 35:

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v26]

2022-11-21 Thread Jim Laskey
On Fri, 18 Nov 2022 22:34:35 GMT, Roger Riggs wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Typo > > src/java.base/share/classes/java/lang/template/StringTemplate.java line

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v27]

2022-11-21 Thread Jim Laskey
r validation and > transformation. This is a [preview language feature and > API](http://openjdk.java.net/jeps/12). Jim Laskey has updated the pull request incrementally with one additional commit since the last revision: Requested changes #11 - Changes: - all: https://g

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v28]

2022-11-21 Thread Jim Laskey
r validation and > transformation. This is a [preview language feature and > API](http://openjdk.java.net/jeps/12). Jim Laskey has updated the pull request incrementally with one additional commit since the last revision: Seal Digits - Changes: - all: https://git.openjdk.

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v26]

2022-11-21 Thread Jim Laskey
On Mon, 21 Nov 2022 13:38:58 GMT, Claes Redestad wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Typo > > src/java.base/share/classes/java/util/Digits.java line 39: > >>

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v28]

2022-11-22 Thread Jim Laskey
On Tue, 22 Nov 2022 18:17:28 GMT, Roger Riggs wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Seal Digits > > src/java.base/share/classes/java/lang/template/package-info.ja

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v28]

2022-11-22 Thread Jim Laskey
On Tue, 22 Nov 2022 18:33:23 GMT, Roger Riggs wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Seal Digits > > src/java.base/share/classes/java/lang/template/StringTemplate.java line

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v28]

2022-11-22 Thread Jim Laskey
On Tue, 22 Nov 2022 18:43:53 GMT, Roger Riggs wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Seal Digits > > src/java.base/share/classes/java/lang/template/StringProcessor.java li

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v28]

2022-11-23 Thread Jim Laskey
On Tue, 22 Nov 2022 19:09:12 GMT, Roger Riggs wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Seal Digits > > src/java.base/share/classes/java/lang/template/StringTemplate.java li

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v29]

2022-11-23 Thread Jim Laskey
r validation and > transformation. This is a [preview language feature and > API](http://openjdk.java.net/jeps/12). Jim Laskey has updated the pull request incrementally with one additional commit since the last revision: Requested changes #12 - Changes: - all: https://g

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v30]

2022-11-23 Thread Jim Laskey
r validation and > transformation. This is a [preview language feature and > API](http://openjdk.java.net/jeps/12). Jim Laskey has updated the pull request incrementally with one additional commit since the last revision: Update @since - Changes: - all: https://git.op

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v28]

2022-11-23 Thread Jim Laskey
On Wed, 23 Nov 2022 15:57:54 GMT, Roger Riggs wrote: >> Kind of blows the whole concept of embedded expressions. This is one of >> those, just because you can, doesn't mean you should. > > ok, still what is the behavior if the format includes an index? > The pattern scanner in FormatProcessor pe

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v30]

2022-11-23 Thread Jim Laskey
On Wed, 23 Nov 2022 16:08:33 GMT, Roger Riggs wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update @since > > src/java.base/share/classes/java/util/FormatProcessor.java line 85: &

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v30]

2022-11-23 Thread Jim Laskey
On Wed, 23 Nov 2022 17:26:58 GMT, Roger Riggs wrote: >> Will clean up javadoc for FormatProcessor::process. >> >> It is unfortunate. If you have any ideas will gladly take them on. On the >> other hand, not sure if the exception is any worse that a static initializer >> exception visually. > >

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v31]

2022-11-24 Thread Jim Laskey
r validation and > transformation. This is a [preview language feature and > API](http://openjdk.java.net/jeps/12). Jim Laskey has updated the pull request incrementally with one additional commit since the last revision: FormatProcessor changes - Changes: - all: https

Re: RFR: 8295803: Console should be usable in jshell and other environments

2022-11-30 Thread Jim Laskey
On Tue, 29 Nov 2022 19:38:02 GMT, Naoto Sato wrote: > This is to allow Console to be used even when it is not attached to the > platform provided terminal, such as the case when the standard input is > redirected. `System.console()` now returns a Console implementation based on > `jdk.internal

Re: RFR: 8295803: Console should be usable in jshell and other environments [v2]

2022-12-01 Thread Jim Laskey
On Wed, 30 Nov 2022 20:44:30 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inte

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v32]

2022-12-02 Thread Jim Laskey
r validation and > transformation. This is a [preview language feature and > API](http://openjdk.java.net/jeps/12). Jim Laskey has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 47 commits: - Merge branch 'master' int

Re: RFR: 8295803: Console should be usable in jshell and other environments [v6]

2022-12-05 Thread Jim Laskey
On Mon, 5 Dec 2022 18:33:10 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inter

Re: RFR: 8295803: Console should be usable in jshell and other environments [v7]

2022-12-05 Thread Jim Laskey
On Mon, 5 Dec 2022 19:52:59 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inter

Re: [jdk20] RFR: 8297288: Example code in Scanner class

2022-12-09 Thread Jim Laskey
On Fri, 9 Dec 2022 18:32:37 GMT, Naoto Sato wrote: > The example in `Scanner` directly uses `System.in` which may cause unwanted > behavior when the default charset and the console charset differ. Using > `Console.reader()` is more appropriate. Also changed examples into snippets. CSR? --

Re: [jdk20] RFR: 8297288: Example code in Scanner class

2022-12-09 Thread Jim Laskey
On Fri, 9 Dec 2022 18:32:37 GMT, Naoto Sato wrote: > The example in `Scanner` directly uses `System.in` which may cause unwanted > behavior when the default charset and the console charset differ. Using > `Console.reader()` is more appropriate. Also changed examples into snippets. You're chang

Re: RFR: 8299677: Formatter.format might take a long time to format an integer or floating-point

2023-01-11 Thread Jim Laskey
On Wed, 11 Jan 2023 10:47:03 GMT, Raffaello Giulietti wrote: > This change transforms a O(n^2) path to O(n) when prepending zero padding to > decimal outputs, where n is the length of the padding. Just as a note, I've been thinking about adding a `repeat(String src, int count)` method to Abst

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v33]

2023-01-11 Thread Jim Laskey
r validation and > transformation. This is a [preview language feature and > API](http://openjdk.java.net/jeps/12). Jim Laskey has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 48 commits: - Merge branch 'master'

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v34]

2023-01-11 Thread Jim Laskey
r validation and > transformation. This is a [preview language feature and > API](http://openjdk.java.net/jeps/12). Jim Laskey has updated the pull request incrementally with one additional commit since the last revision: Update to JDK 21 - Changes: - all: https://git.op

Re: RFR: 8206890: jlink --endian XXX generates unusable image if endian-ness does not match architecture

2023-01-17 Thread Jim Laskey
On Wed, 11 Jan 2023 13:19:32 GMT, Jaikiran Pai wrote: > Can I please get a review for this change which proposes to fix the issue > reported in https://bugs.openjdk.org/browse/JDK-8206890? > > The `jlink` command allows a `--endian` option to specify the byte order in > the generated image. Be

Re: RFR: 8206890: jlink --endian XXX generates unusable image if endian-ness does not match architecture

2023-01-17 Thread Jim Laskey
On Wed, 11 Jan 2023 13:19:32 GMT, Jaikiran Pai wrote: > Can I please get a review for this change which proposes to fix the issue > reported in https://bugs.openjdk.org/browse/JDK-8206890? > > The `jlink` command allows a `--endian` option to specify the byte order in > the generated image. Be

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v34]

2023-01-17 Thread Jim Laskey
On Wed, 11 Jan 2023 14:07:53 GMT, Jim Laskey wrote: >> Enhance the Java programming language with string templates, which are >> similar to string literals but contain embedded expressions. A string >> template is interpreted at run time by replacing each expression with

Re: RFR: 8300487: Store cardinality as a field in BitSet

2023-01-18 Thread Jim Laskey
On Tue, 3 Jan 2023 23:25:39 GMT, fabioromano1 wrote: > The enanchment is useful for applications that make heavy use of BitSet > objects as sets of integers, and therefore they need to make a lot of calls > to cardinality() method, which actually require linear time in the number of > words in

Re: RFR: 8300487: Store cardinality as a field in BitSet [v5]

2023-01-18 Thread Jim Laskey
On Wed, 18 Jan 2023 12:43:31 GMT, fabioromano1 wrote: >> The enanchment is useful for applications that make heavy use of BitSet >> objects as sets of integers, and therefore they need to make a lot of calls >> to cardinality() method, which actually require linear time in the number of >> wor

Re: RFR: 8300487: Store cardinality as a field in BitSet [v5]

2023-01-19 Thread Jim Laskey
On Wed, 18 Jan 2023 12:43:31 GMT, fabioromano1 wrote: >> The enanchment is useful for applications that make heavy use of BitSet >> objects as sets of integers, and therefore they need to make a lot of calls >> to cardinality() method, which actually require linear time in the number of >> wor

Re: Math.clamp method?

2023-01-25 Thread Jim Laskey
+1 > On Jan 25, 2023, at 9:41 AM, Tagir Valeev wrote: > > Hello! > > Quite often it's necessary to clamp a numerical value to a given > range, using the algorithm like this: > int clampedValue = value > max ? max : value < min ? min : value; > or probably > int clampedValue = Math.max(min, Math

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v35]

2023-02-10 Thread Jim Laskey
r validation and > transformation. This is a [preview language feature and > API](http://openjdk.java.net/jeps/12). Jim Laskey has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 50 commits: - Merge branch 'master' into

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v36]

2023-02-10 Thread Jim Laskey
r validation and > transformation. This is a [preview language feature and > API](http://openjdk.java.net/jeps/12). Jim Laskey has updated the pull request incrementally with one additional commit since the last revision: Bring up to date - Changes: - all: https://git.op

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v37]

2023-02-10 Thread Jim Laskey
r validation and > transformation. This is a [preview language feature and > API](http://openjdk.java.net/jeps/12). Jim Laskey has updated the pull request incrementally with one additional commit since the last revision: CSR review - Changes: - all: https://git.openjdk.

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v38]

2023-02-10 Thread Jim Laskey
r validation and > transformation. This is a [preview language feature and > API](http://openjdk.java.net/jeps/12). Jim Laskey has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 53 commits: - Merge branch 'master'

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v39]

2023-02-10 Thread Jim Laskey
r validation and > transformation. This is a [preview language feature and > API](http://openjdk.java.net/jeps/12). Jim Laskey has updated the pull request incrementally with one additional commit since the last revision: Minor correction to javadoc - Chang

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v40]

2023-02-11 Thread Jim Laskey
r validation and > transformation. This is a [preview language feature and > API](http://openjdk.java.net/jeps/12). Jim Laskey has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 55 commits: - Merge branch 'master' into

Re: RFR: 8302337: JDK crashes if lib/modules contains non-zero byte containing ATTRIBUTE_END

2023-02-13 Thread Jim Laskey
On Mon, 13 Feb 2023 16:57:17 GMT, Severin Gehwolf wrote: > The `jimage` location attributes are terminated with `ATTRIBUTE_END`-kinds. > However, > the byte containing `ATTRIBUTE_END` (most significant 5 bits, represent > `kind`), might > be non-zero in the lower 3 bits (values up to `0x07` rep

Re: RFR: 8302325: Wrong comment in java.base/share/native/libjimage/imageFile.hpp [v2]

2023-02-14 Thread Jim Laskey
On Tue, 14 Feb 2023 14:46:58 GMT, Severin Gehwolf wrote: >> Could I please get a review of this trivial comment-only change? >> `imageFile.hpp` >> describes some properties of the jimage file `lib/modules`. However, I don't >> think >> the comment example matches current code in the JDK. >> [`

Re: RFR: 8302325: Wrong comment in java.base/share/native/libjimage/imageFile.hpp [v2]

2023-02-14 Thread Jim Laskey
On Tue, 14 Feb 2023 14:46:58 GMT, Severin Gehwolf wrote: >> Could I please get a review of this trivial comment-only change? >> `imageFile.hpp` >> describes some properties of the jimage file `lib/modules`. However, I don't >> think >> the comment example matches current code in the JDK. >> [`

Re: RFR: 8302325: Wrong comment in java.base/share/native/libjimage/imageFile.hpp [v2]

2023-02-14 Thread Jim Laskey
On Tue, 14 Feb 2023 17:10:32 GMT, Severin Gehwolf wrote: >> @JimLaskey OK. Perhaps we can be clearer what is meant here exactly. I was >> having a hard time deciphering this. It does say `stream will contain zero >> byte values to represent lesser significant bits`. **What** are "byte values >

Re: RFR: 8302325: Wrong comment in java.base/share/native/libjimage/imageFile.hpp [v2]

2023-02-14 Thread Jim Laskey
On Tue, 14 Feb 2023 18:01:44 GMT, Severin Gehwolf wrote: >> I meant that an attribute can have zeros in the non-header portion of the >> attribute data. > > Got it. How about we change this comment from: > > // - Even though ATTRIBUTE_END is used to mark the end of the attribute > stream, > /

Re: RFR: 8302325: Wrong comment in java.base/share/native/libjimage/imageFile.hpp [v3]

2023-02-14 Thread Jim Laskey
On Tue, 14 Feb 2023 19:30:19 GMT, Severin Gehwolf wrote: >> Could I please get a review of this trivial comment-only change? >> `imageFile.hpp` >> describes some properties of the jimage file `lib/modules`. However, I don't >> think >> the comment example matches current code in the JDK. >> [`

RFR: JDK-8302323 Add repeat methods to StringBuilder/StringBuffer

2023-02-23 Thread Jim Laskey
Add the ability to repeatedly append char and CharSequence data to StringBuilder/StringBuffer. - Commit messages: - Clean up fro CSR - Add synchronized to StringBuffer repeats - AbstractStringBuilder repeat Changes: https://git.openjdk.org/jdk/pull/12728/files Webrev: https://we

Re: RFR: JDK-8302323 Add repeat methods to StringBuilder/StringBuffer

2023-02-23 Thread Jim Laskey
On Thu, 23 Feb 2023 15:17:26 GMT, Raffaello Giulietti wrote: >> Add the ability to repeatedly append char and CharSequence data to >> StringBuilder/StringBuffer. > > src/java.base/share/classes/java/lang/AbstractStringBuilder.java line 1851: > >> 1849: while (count-- != 0) { >> 185

Re: RFR: JDK-8302323 Add repeat methods to StringBuilder/StringBuffer

2023-02-23 Thread Jim Laskey
On Thu, 23 Feb 2023 15:52:15 GMT, Roger Riggs wrote: >> Add the ability to repeatedly append char and CharSequence data to >> StringBuilder/StringBuffer. > > src/java.base/share/classes/java/lang/AbstractStringBuilder.java line 1839: > >> 1837: * @throws StringIndexOutOfBoundsException if

Re: RFR: JDK-8302323 Add repeat methods to StringBuilder/StringBuffer

2023-02-23 Thread Jim Laskey
On Thu, 23 Feb 2023 15:56:37 GMT, Roger Riggs wrote: >> Add the ability to repeatedly append char and CharSequence data to >> StringBuilder/StringBuffer. > > src/java.base/share/classes/java/lang/AbstractStringBuilder.java line 1876: > >> 1874: int length = this.count - offset; >> 1875:

Re: RFR: JDK-8302323 Add repeat methods to StringBuilder/StringBuffer

2023-02-23 Thread Jim Laskey
On Thu, 23 Feb 2023 16:40:32 GMT, Roger Riggs wrote: >> Add the ability to repeatedly append char and CharSequence data to >> StringBuilder/StringBuffer. > > src/java.base/share/classes/java/lang/AbstractStringBuilder.java line 1918: > >> 1916: } >> 1917: int valueLength = lengt

Re: RFR: JDK-8302323 Add repeat methods to StringBuilder/StringBuffer

2023-02-23 Thread Jim Laskey
On Thu, 23 Feb 2023 16:54:10 GMT, Jim Laskey wrote: >> src/java.base/share/classes/java/lang/AbstractStringBuilder.java line 1918: >> >>> 1916: } >>> 1917: int valueLength = length << UTF16; >>> 1918: if ((Integer.MAX_VALUE -

Re: RFR: JDK-8302323 Add repeat methods to StringBuilder/StringBuffer [v2]

2023-02-23 Thread Jim Laskey
> Add the ability to repeatedly append char and CharSequence data to > StringBuilder/StringBuffer. Jim Laskey has updated the pull request incrementally with one additional commit since the last revision: PR Cleanup - Changes: - all: https://git.openjdk.org/jdk/pull

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v41]

2023-02-23 Thread Jim Laskey
r validation and > transformation. This is a [preview language feature and > API](http://openjdk.java.net/jeps/12). Jim Laskey has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 56 commits: - Merge branch 'master'

Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v42]

2023-02-27 Thread Jim Laskey
r validation and > transformation. This is a [preview language feature and > API](http://openjdk.java.net/jeps/12). Jim Laskey has updated the pull request incrementally with one additional commit since the last revision: Tighten up reporting of string template erro

Re: RFR: JDK-8302323 Add repeat methods to StringBuilder/StringBuffer [v2]

2023-02-27 Thread Jim Laskey
On Sun, 26 Feb 2023 17:29:09 GMT, Tagir F. Valeev wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> PR Cleanup > > src/java.base/share/classes/java/lang/AbstractStringBuil

Re: RFR: JDK-8302323 Add repeat methods to StringBuilder/StringBuffer [v2]

2023-02-27 Thread Jim Laskey
On Sun, 26 Feb 2023 17:28:08 GMT, Tagir F. Valeev wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> PR Cleanup > > src/java.base/share/classes/java/lang/AbstractStringBuilder.java line

Re: RFR: JDK-8302323 Add repeat methods to StringBuilder/StringBuffer [v3]

2023-02-27 Thread Jim Laskey
> Add the ability to repeatedly append char and CharSequence data to > StringBuilder/StringBuffer. Jim Laskey has updated the pull request incrementally with one additional commit since the last revision: Optimize for empty CharSequence - Changes: - all:

Re: RFR: 8303266: Prefer ArrayList to LinkedList in JImageTask

2023-02-27 Thread Jim Laskey
On Mon, 27 Feb 2023 11:33:38 GMT, Andrey Turbanov wrote: > `LinkedList` is used as a field > `jdk.tools.jimage.JImageTask.OptionsValues#jimages` > It's created, filled (with `add`) and then iterated. No removes from the head > or something like this. `ArrayList` should be preferred as more effi

Re: RFR: JDK-8302323 Add repeat methods to StringBuilder/StringBuffer [v3]

2023-02-28 Thread Jim Laskey
On Tue, 28 Feb 2023 07:50:18 GMT, Tagir F. Valeev wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Optimize for empty CharSequence > > src/java.base/share/classes/java/lang/Abstra

Re: RFR: JDK-8302323 Add repeat methods to StringBuilder/StringBuffer [v4]

2023-02-28 Thread Jim Laskey
> Add the ability to repeatedly append char and CharSequence data to > StringBuilder/StringBuffer. Jim Laskey has updated the pull request incrementally with two additional commits since the last revision: - Remove @throws IndexOutOfBoundsException - Change error report to use "

Re: RFR: JDK-8302323 Add repeat methods to StringBuilder/StringBuffer [v3]

2023-02-28 Thread Jim Laskey
On Tue, 28 Feb 2023 10:54:14 GMT, Alan Bateman wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Optimize for empty CharSequence > > src/java.base/share/classes/java/lang/Abstra

<    1   2   3   4   5   6   >