Skip to content

Conversation

@jonathan-gibbons
Copy link
Contributor

@jonathan-gibbons jonathan-gibbons commented Oct 1, 2024

Please review a small fix for an IllegalArgumentException.

The exception is "correct"; the error is at the call site which should not be calling the method that throws the exception.
Record components, like type parameters, do not have distinct A:PI descriptions that can be compared.

Separately, we need better back-end tests for HtmlReporter.


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

Issue

  • CODETOOLS-7903852: apidiff: IllegalArgumentException for RECORD_COMPONENT (Bug - P2)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 20

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/apidiff/pull/20.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 1, 2024

👋 Welcome back jjg! 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
Copy link

openjdk bot commented Oct 1, 2024

@jonathan-gibbons 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:

7903852: apidiff: IllegalArgumentException for RECORD_COMPONENT

Reviewed-by: prappo, iris

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 4 new commits pushed to the master branch:

  • 10a494c: 7903830: apidiff: Review glyphs used to indicate same/difference
  • e0b049a: 7903849: Scrape off Apache Ant remnants from APIDiff
  • dbaa7ac: 7903846: apidiff: test issues on Windows
  • bb3eb15: 7903838: apidiff: Update Vintage JUnit test

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 1, 2024
@mlbridge
Copy link

mlbridge bot commented Oct 1, 2024

Webrevs

@pavelrappo
Copy link
Member

Does this PR simply improves the exception message?

@jonathan-gibbons
Copy link
Contributor Author

jonathan-gibbons commented Oct 1, 2024

Does this PR simply improves the exception message?

No. In RecordComponentComparator it no longer calls the method that throws the exception.
There's actually no change in the exception message; the edits in the visitor are somewhat cosmetic, to improve the stack trace (!!) and to provide a place for a more specific explanatory comment.

@pavelrappo
Copy link
Member

Does this PR simply improves the exception message?

No. In RecordComponentComparator it no longer calls the method that throws the exception. There's actually no change in the exception message; the edits in the visitor are somewhat cosmetic, to improve the stack trace (!!) and to provide a place for a more specific explanatory comment.

Right, I see the problematic method has been removed:

    allEqual &= compareDocComments(rcPos, rcMap);
 -> allEqual &= compareApiDescriptions(rcPos, rcMap);

@jonathan-gibbons
Copy link
Contributor Author

jonathan-gibbons commented Oct 1, 2024

Yes.
Record components are like type parameters in that neither have standalone doc comments, and so neither have corresponding generated API descriptions either. I wanted to add comments to draw out that similarity.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 1, 2024
@jonathan-gibbons
Copy link
Contributor Author

jonathan-gibbons commented Oct 1, 2024

/integrate

@openjdk
Copy link

openjdk bot commented Oct 1, 2024

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

  • 10a494c: 7903830: apidiff: Review glyphs used to indicate same/difference
  • e0b049a: 7903849: Scrape off Apache Ant remnants from APIDiff
  • dbaa7ac: 7903846: apidiff: test issues on Windows
  • bb3eb15: 7903838: apidiff: Update Vintage JUnit test

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Oct 1, 2024
@openjdk openjdk bot closed this Oct 1, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Oct 1, 2024
@openjdk
Copy link

openjdk bot commented Oct 1, 2024

@jonathan-gibbons Pushed as commit 1884101.

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

@jonathan-gibbons jonathan-gibbons deleted the apidiff.7903852.record-component branch October 1, 2024 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants