RFR: 8292376: A few Swing methods use inheritDoc on exceptions which are not inherited

Abhishek Kumar duke at openjdk.org
Wed Aug 17 12:03:18 UTC 2022


On Wed, 17 Aug 2022 11:49:28 GMT, Abhishek Kumar <duke at openjdk.org> wrote:

> Document update for getBaselineResizeBehavior() and getBaseline() method description in JSpinner, AbstractBorder and TitledBorder .

1) In javax.swing.JSpinner.DefaultEditor.getBaselineResizeBehavior() method, the exception tag has been removed. Neither this method nor any of the ancestor class definition of this method declared exception tag in description.

2) For javax.swing.border.TitledBorder.getBaseline(java.awt.Component,int,int) method, the ancestor class definition of this method didn't declare exception tag for NPE. So, {@inheritDoc} didn't inherit anything. 
However, javax.swing.border.TitledBorder.getBaseline(java.awt.Component,int,int) throws NPE if Component is null. NPE tag has been changed accordingly.

3) For javax.swing.border.TitledBorder.getBaselineResizeBehavior(java.awt.Component) method, the {@inheritDoc} didn't inherit anything because there was no exception tag in ancestor class method definition.
As TitledBorder extends AbstractBorder, getBaselineResizeBehavior(java.awt.Component) method throws an exception if Component is null but the exception tag was missing for method description in AbstractBorder.
So, exception tag for NPE added for getBaselineResizeBehavior(java.awt.Component) method in AbstractBorder.
Now in  javax.swing.border.TitledBorder.getBaselineResizeBehavior(java.awt.Component) method, the {@inheritDoc} inherits NPE tag from AbstractBorder.

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

PR: https://git.openjdk.org/jdk/pull/9902



More information about the client-libs-dev mailing list