RFR: 8341670: [Text, TextFlow] Public API for Text Layout Info [v7]
Andy Goryachev
angorya at openjdk.org
Thu Oct 24 22:58:17 UTC 2024
On Wed, 23 Oct 2024 18:51:27 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:
>> Andy Goryachev 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 13 additional commits since the last revision:
>>
>> - Merge remote-tracking branch 'origin/master' into ag.text.layout.api
>> - remove line spacing
>> - tests
>> - whitespace
>> - caret info
>> - text line info
>> - Merge remote-tracking branch 'origin/master' into ag.text.layout.api
>> - convert to wrapper
>> - clarify
>> - javadoc
>> - ... and 3 more: https://git.openjdk.org/jfx/compare/a543151e...5ab4f47a
>
> modules/javafx.graphics/src/main/java/javafx/scene/text/LayoutInfo.java line 72:
>
>> 70: * @return the list of {@code TextLineInfo} objects
>> 71: */
>> 72: public abstract List<TextLineInfo> getTextLines();
>
> Is the list immutable? If so (which I think it should be), can you specify that?
A new instance gets created for each caller, we don't care what they do to it. Maybe we should say that?
>From the API purity perspective, it could be, but an immutable list would incur a copy overhead, do we really need that?
It also looks like there is no easy way of creating an immutable wrapper similar to JDK's List12, so we'd need to invent one.
(Note: the original design called for an array, but List was recommended because of stream/etc)
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1596#discussion_r1815789048
More information about the openjfx-dev
mailing list