RFR: 8371070: RichParagraph enhancements [v8]
Andy Goryachev
angorya at openjdk.org
Mon Dec 22 23:08:27 UTC 2025
On Mon, 22 Dec 2025 22:57:14 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:
>> `RParagraph` is an internal class.
>
> Sure, but that wasn't my point. I don't see any indication that the method currently called `buildParagraph` builds a paragraph. What it does is returns a paragraph builder. Great, but in that case, the method is misnamed.
>
> So, either I'm missing something (possible, but I've looked at it pretty closely by now) or the name of this method should be changed (you'll also need to fix the first sentence of the docs).
>
> What I see is this:
>
> `RichTextModel:: buildParagraph` returns a builder. The only caller of that method is getParagraph, which then calls build and it is _that_ call to build, not the call to this method that builds the paragraph:
>
>
> RichParagraph.Builder b = buildParagraph(index); <-- this returns a builder
> return b.build(); <-- this is the build
> }
I think I know what the problem is.
The method is still "building" the paragraph, in a sense that it puts together parts of the paragraph into a container (which is called "builder") and perhaps this is confusing.
How about renaming this method to something like `prepareParagraph`() or `constructParagraph`?
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1966#discussion_r2641480020
More information about the openjfx-dev
mailing list