JDK-8292376 : A few Swing methods use inheritDoc on exceptions which are not inherited
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 7,11,20
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-08-15
  • Updated: 2022-09-29
  • Resolved: 2022-09-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 20
20 b17Fixed
Related Reports
CSR :  
Relates :  
Description
These methods 
javax.swing.JSpinner.DefaultEditor.getBaselineResizeBehavior()
javax.swing.border.TitledBorder.getBaseline(java.awt.Component,int,int)
javax.swing.border.TitledBorder.getBaselineResizeBehavior(java.awt.Component)

specify 
* @throws NullPointerException {@inheritDoc}'

however no ancestor class definition of these methods declares it.
Comments
Changeset: 5652030f Author: Abhishek Kumar <abhishek.cx.kumar@oracle.com> Committer: Prasanta Sadhukhan <psadhukhan@openjdk.org> Date: 2022-09-22 07:38:14 +0000 URL: https://git.openjdk.org/jdk/commit/5652030f1684240105fec2fc04aac8fbbe356024
22-09-2022

Observation: The bug reported about 3 methods which specify '@throws NullPointerException {@inheritDoc}'. 1. javax.swing.JSpinner.DefaultEditor.getBaselineResizeBehavior() This class DefaultEditor extends JPanel and the method getBaselineResizeBehavior is inherited from it's ancestor class. But none of the ancestor class method declared exception tag in description. So, it can be removed from the description in getBaselineResizeBehavior method of DefaultEditor. 2. javax.swing.border.TitledBorder.getBaseline(java.awt.Component,int,int) TitledBorder class inherits AbstractBorder and getBaseline method in AbstractBorder didn't throw NPE. However getBaseline method in TitledBorder class can throw NPE if component is null. So, the documentation for NPE tag has been changed. 3. javax.swing.border.TitledBorder.getBaselineResizeBehavior(java.awt.Component) As mentioned above, TitledBorder class inherits AbstarctBorder. getBaselineResizeBehavior method in AbstractBorder class can throw NPE if component is null but the exception tag was missing in description. The exception tag has been added in AbstractBorder method description and then inheritDoc in TitledBorder.getBaselineResizeBehavior method inherits correctly.
20-09-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/9902 Date: 2022-08-17 11:49:28 +0000
17-08-2022