On Wed, 12 May 2021 12:43:48 GMT, Hannes Wallnöfer <hann...@openjdk.org> wrote:
> This changes the parameter type for the tab label from `String` to `Content` > in the `formats.html.Table` `addTab` and `setDefaultTab` methods. The change > is straightforward because the tab name was converted to `Content` anyway, > and all resources are readily available in `Content` form. > > I briefly considered overriding the `hashCode` and `equals` methods in `Text` > to be depend on content instead of object identity, but decided against it. > This would just cover up bugs where we generate the same content twice. (In > the process I made sure we currently don't have any such cases where a `Text` > instance is compared to another one with the same string content.) NIce. At some point, we should have a design discussion on the relative merits of `Contents.getContent` vs shared fields. FWIW, the current set of shared fields is based on the evolution of history, and to some extent restricted by what was possible at the time. ------------- Marked as reviewed by jjg (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/3994