RFR: 8372438: SimpleViewOnlyStyledModel: non-text paragraphs [v2]

Andy Goryachev angorya at openjdk.org
Tue Dec 2 17:10:00 UTC 2025


> Fixing a bug in `SimpleViewOnlyStyledModel.lastParagraph()` which breaks adding text segments after a `Region`-based paragraph.
> 
> Test cases:
> 
>     @Test
>     public void addTextAfterRegion() {
>         SimpleViewOnlyStyledModel m = new SimpleViewOnlyStyledModel();
>         m.addParagraph(() -> new Region());
>         m.addNodeSegment(() -> new Region());
>         assertEquals(2, m.size());
>     }
> 
>     @Test
>     public void addTextAfterRegionAfterText() {
>         SimpleViewOnlyStyledModel m = new SimpleViewOnlyStyledModel();
>         m.addNodeSegment(() -> new Region());
>         m.addParagraph(() -> new Region());
>         m.addSegment("text");
>         assertEquals(3, m.size());
>     }

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 two additional commits since the last revision:

 - Merge branch 'master' into 8372438.non.text.paragraphs
 - fix

-------------

Changes:
  - all: https://git.openjdk.org/jfx/pull/1983/files
  - new: https://git.openjdk.org/jfx/pull/1983/files/fb24deb1..d0f1ee64

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jfx&pr=1983&range=01
 - incr: https://webrevs.openjdk.org/?repo=jfx&pr=1983&range=00-01

  Stats: 371 lines in 24 files changed: 206 ins; 94 del; 71 mod
  Patch: https://git.openjdk.org/jfx/pull/1983.diff
  Fetch: git fetch https://git.openjdk.org/jfx.git pull/1983/head:pull/1983

PR: https://git.openjdk.org/jfx/pull/1983


More information about the openjfx-dev mailing list