RFR: JDK-8240137: Support chained use of Content.add

Jonathan Gibbons jonathan.gibbons at oracle.com
Wed Mar 4 22:15:11 UTC 2020


Please review a relatively simple change to the `add` methods for 
Content and its subtypes, to support chained usage.

The primary change is in Content (the last file listed in the webrev), 
where the return type of the `add` methods is changed from `void` 
to`Content. In addition, I added default methods to throw 
UnsupportedOperationException, and improved the doc comments.

Most of the other changes are consequences of the changes to Content. In 
particular, overriding methods are removed when the new default method 
provides the same behavior, and the return type of the remaining 
overriding methods is updated to be the return type of the overriding 
class ... i.e. using a covariant return.

The 3 small changes in doc comments in Table are unrelated. One is a 
grammatical fix; the others fix bad references to methods.

All the code is functionally equivalent to before; there are no changes 
required to any tests.

This changeset does not attempt to go and retrofit chained calls at 
possible use-sites.

-- Jon

JBS: https://bugs.openjdk.java.net/browse/JDK-8240137
Webrev: http://cr.openjdk.java.net/~jjg/8240137/webrev.00/index.html




More information about the javadoc-dev mailing list