RFR: JDK-8261665: Clean up naming of StringContent and FixedStringContent

Jonathan Gibbons jjg at openjdk.java.net
Fri Feb 12 19:55:59 UTC 2021


Relatively simple update to clean up some of the old naming in the `html.markup` world.

`FixedStringContent` is renamed to just `Text` and a new factory method `Text.of(CharSequence)` introduced.

`StringContent` is renamed to `TextBuilder`.

`StringContent` was the original type and is widely used; `FixedStringContent` was added much later, along with `Contents` to support shared reusable tree nodes.  But most uses of `StringContent` do not need mutability, and most can be replaced with the lighter-weight `Text` class.  This change is done, just leaving `textBuilder` to be used in `ContentBuilder` and `HtmlTree` which support the `add(CharSequence)` method.

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

Commit messages:
 - JDK-8261665: Clean up naming of StringContent and FixedStringContent

Changes: https://git.openjdk.java.net/jdk/pull/2556/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2556&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8261665
  Stats: 584 lines in 41 files changed: 198 ins; 207 del; 179 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2556.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2556/head:pull/2556

PR: https://git.openjdk.java.net/jdk/pull/2556


More information about the javadoc-dev mailing list