Skip to content

Conversation

@kumarabhi006
Copy link
Contributor

@kumarabhi006 kumarabhi006 commented Aug 17, 2022

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


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change requires a CSR request to be approved

Issues

  • JDK-8292376: A few Swing methods use inheritDoc on exceptions which are not inherited
  • JDK-8293470: A few Swing methods use inheritDoc on exceptions which are not inherited (CSR)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/9902/head:pull/9902
$ git checkout pull/9902

Update a local copy of the PR:
$ git checkout pull/9902
$ git pull https://git.openjdk.org/jdk pull/9902/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 9902

View PR using the GUI difftool:
$ git pr show -t 9902

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/9902.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 17, 2022

👋 Welcome back kumarabhi006! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Aug 17, 2022
@openjdk
Copy link

openjdk bot commented Aug 17, 2022

@kumarabhi006 The following label will be automatically applied to this pull request:

  • client

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the client client-libs-dev@openjdk.org label Aug 17, 2022
@mlbridge
Copy link

mlbridge bot commented Aug 17, 2022

Webrevs

@kumarabhi006
Copy link
Contributor Author

  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.

* @param c <code>Component</code> to return baseline resize behavior for
* @return an enum indicating how the baseline changes as the border is
* resized
* @throws NullPointerException if passed in {@code Component} is {@code null}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if passed in {@code Component} is {@code null} - Rephrasing this sentence would be better. Something like if {@code Component} is {@code null}.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in method description.

@kumarabhi006
Copy link
Contributor Author

/csr

@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label Sep 7, 2022
@openjdk
Copy link

openjdk bot commented Sep 7, 2022

@kumarabhi006 has indicated that a compatibility and specification (CSR) request is needed for this pull request.

@kumarabhi006 please create a CSR request for issue JDK-8292376 with the correct fix version. This pull request cannot be integrated until the CSR request is approved.

@kumarabhi006
Copy link
Contributor Author

Attached the CSR link
https://bugs.openjdk.org/browse/JDK-8293470

@prrace
Copy link
Contributor

prrace commented Sep 17, 2022

The bug report has no evaluation.
The PR just says "Doc update for Null Pointer Exception"
The bug should always have a proper evaluation and the PR can then refer to that or copy it.
The CSR has a lot of what should have appeared in these places too ..

Here's my take on it

The bug complains of 3 methods incorrectly using inheritdoc for NPE
and the resolution for each case is as follows

  • javax.swing.JSpinner.DefaultEditor.getBaselineResizeBehavior()
    It is unclear why the inheritdoc appears on this method.
    This nested class extends JPanel and so the method is inherited from JComponent
    and then in turn from Component and neither of these seems like it will throw NPE
    The fix is to remove it - doc only no behavioural change.

  • javax.swing.border.TitledBorder.getBaseline(java.awt.Component,int,int)
    The superclass (AbstractBorder) method cannot throw NPE so inheritdoc is wrong.
    However this method can throw NPE so the fix is to replace it with appropriate
    documentation for this method. So also doc only no behavioural change.

  • javax.swing.border.TitledBorder.getBaselineResizeBehavior(java.awt.Component)
    This method delegates to the super class method which can throw NPE but omits to specify it.
    The fix is to add the declaration to the super class method and then the inheritdoc
    is appropriate and can be left in place. Again doc only no behavioural change.

So the changes look correct - it just is better with an explanation.

@openjdk openjdk bot removed the csr Pull request needs approved CSR before integration label Sep 21, 2022
@openjdk
Copy link

openjdk bot commented Sep 21, 2022

@kumarabhi006 This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

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

Reviewed-by: prr, tr

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 941 new commits pushed to the master branch:

  • d5bee4a: 8294086: RISC-V: Cleanup InstructionMark usages in the backend
  • 47f233a: 8292202: modules_do is called without Module_lock
  • 742bc04: 8294100: RISC-V: Move rt_call and xxx_move from SharedRuntime to MacroAssembler
  • 2283c32: 8294149: JMH 1.34 and later requires jopt-simple 5.0.4
  • 9f90eb0: 8294062: Improve parsing performance of j.l.c.MethodTypeDesc
  • c6be2cd: 8293156: Dcmd VM.classloaders fails to print the full hierarchy
  • 711e252: 8294039: Remove "Classpath" exception from java/awt tests
  • 27b8e2f: 8294038: Remove "Classpath" exception from javax/swing tests
  • e195897: 8294068: Unconditional and eager load of nio library since JDK-8264744
  • 84d7ff6: 8288129: Shenandoah: Skynet test crashed with iu + aggressive
  • ... and 931 more: https://git.openjdk.org/jdk/compare/ac6be165196457a26d837760b5f5030fe010d633...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@prrace) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 21, 2022
@kumarabhi006
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Sep 22, 2022
@openjdk
Copy link

openjdk bot commented Sep 22, 2022

@kumarabhi006
Your change (at version cae9de8) is now ready to be sponsored by a Committer.

@prsadhuk
Copy link
Contributor

/sponsor

@openjdk
Copy link

openjdk bot commented Sep 22, 2022

Going to push as commit 5652030.
Since your change was applied there have been 942 commits pushed to the master branch:

  • 03f287d: 8293995: Problem list sun/tools/jstatd/TestJstatdRmiPort.java on all platforms because of 8293577
  • d5bee4a: 8294086: RISC-V: Cleanup InstructionMark usages in the backend
  • 47f233a: 8292202: modules_do is called without Module_lock
  • 742bc04: 8294100: RISC-V: Move rt_call and xxx_move from SharedRuntime to MacroAssembler
  • 2283c32: 8294149: JMH 1.34 and later requires jopt-simple 5.0.4
  • 9f90eb0: 8294062: Improve parsing performance of j.l.c.MethodTypeDesc
  • c6be2cd: 8293156: Dcmd VM.classloaders fails to print the full hierarchy
  • 711e252: 8294039: Remove "Classpath" exception from java/awt tests
  • 27b8e2f: 8294038: Remove "Classpath" exception from javax/swing tests
  • e195897: 8294068: Unconditional and eager load of nio library since JDK-8264744
  • ... and 932 more: https://git.openjdk.org/jdk/compare/ac6be165196457a26d837760b5f5030fe010d633...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Sep 22, 2022
@openjdk openjdk bot closed this Sep 22, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Sep 22, 2022
@openjdk
Copy link

openjdk bot commented Sep 22, 2022

@prsadhuk @kumarabhi006 Pushed as commit 5652030.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client client-libs-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants