On Tue, 19 May 2026 22:14:49 GMT, Andy Goryachev <[email protected]> wrote:
>> modules/jfx.incubator.richtext/src/main/java/jfx/incubator/scene/control/richtext/model/StyledSegment.java
>> line 262:
>>
>>> 260: * @since 27
>>> 261: */
>>> 262: public static StyledSegment ofVersion(String version) {
>>
>> What is the advantage of making the version number be a `StyledSegment` (as
>> opposed to a separate type, e.g., `Header` or `Version`)?
>
> _"Entities must not be multiplied beyond necessity"_
>
> I think there is no need in separate classes (and the corresponding
> `instanceof` operation), any required logic can be implemented as a switch on
> `.getType()`
This feels more like a "round peg in a square hole" to me, so I don't buy your
argument. The Version number is a concern of the transport layer not the
runtime document. I'm willing to defer it, but I want to revisit it and make a
deliberate decision. This feels very unnatural from an API point of view.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1800#discussion_r3424391122