On Tue, 21 Mar 2023 13:37:02 GMT, Maurizio Cimadamore <[email protected]>
wrote:
>> src/java.base/share/classes/java/lang/StringTemplate.java line 69:
>>
>>> 67: * List<Object> values = st.values();
>>> 68: * }
>>> 69: * The value of {@code fragments} will be equivalent to {@code
>>> List.of("", " + ", " = ", "")},
>>
>> This is a bit hard to parse, due to the use of `the value of` (which then
>> becomes problematic in the next para, as we are talking about `values`).
>> Either change the name of the variable `values` in the snippet, or use some
>> other locution, like "the list {@code fragments} is equivalent to ..." etc.
>
> The above comment also applies to the javadoc of the `fragments` and `values`
> methods, which use a similar way to describe their results.
* {@code fragments} will be equivalent to {@code List.of("", " + ", " = ", "")},
* which includes the empty first and last fragments. {@code values} will be the
* equivalent of {@code List.of(10, 20, 30)}.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/10889#discussion_r1144904923