Skip to content

8029301: Confusing error message for array creation method reference #12646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

archiecobbs
Copy link
Contributor

@archiecobbs archiecobbs commented Feb 20, 2023

The error for an invalid constructor reference of an array type looks like this:

Test.java:3: error: incompatible types: invalid constructor reference
        Runnable r = String[]::new;
                     ^
    constructor Array in class Array cannot be applied to given types
      required: int
      found:    no arguments
      reason: actual and formal argument lists differ in length

The phrase "constructor Array in class Array" is somewhat confusing.

This is a simple patch to reword this type of error to look like this instead:

Test.java:3: error: incompatible types: invalid constructor reference
        Runnable r = String[]::new;
                     ^
    cannot create array from given types
      required: int
      found:    no arguments
      reason:   actual and formal argument lists differ in length

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

  • JDK-8029301: Confusing error message for array creation method reference

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 12646

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 20, 2023

👋 Welcome back archiecobbs! 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 Feb 20, 2023
@openjdk
Copy link

openjdk bot commented Feb 20, 2023

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

  • compiler

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 compiler compiler-dev@openjdk.org label Feb 20, 2023
@mlbridge
Copy link

mlbridge bot commented Feb 20, 2023

Webrevs

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 20, 2023

@archiecobbs This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@archiecobbs
Copy link
Contributor Author

/pingbot

@openjdk
Copy link

openjdk bot commented Mar 20, 2023

@archiecobbs Unknown command pingbot - for a list of valid commands use /help.

Copy link
Contributor

@vicente-romero-oracle vicente-romero-oracle left a comment

Choose a reason for hiding this comment

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

looks good

@openjdk
Copy link

openjdk bot commented Mar 20, 2023

@archiecobbs 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:

8029301: Confusing error message for array creation method reference

Reviewed-by: vromero

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

  • 760c012: 8304683: Memory leak in WB_IsMethodCompatible
  • 75168ea: 8304134: jib bootstrapper fails to quote filename when checking download filetype
  • 4154a98: 8301498: Replace NULL with nullptr in cpu/x86
  • ddf1e34: 8304089: Convert TraceDependencies to UL
  • 358c61b: 8294972: Convert jdk.jlink internal plugins to use the Classfile API
  • c74507e: 8304657: G1: Rename set_state_empty to set_state_untracked
  • ca94287: 8304144: G1: Remove unnecessary is_survivor check in G1ClearCardTableTask
  • eda0065: 8304286: java/net/SocketOption/OptionsTest.java failing after JDK-8302659
  • c039d26: 8303804: Fix some errors of If-VectorTest and CMove-VectorTest
  • 0156909: 8304502: Classfile API class hierarchy makes assumptions when class is not resolved
  • ... and 15 more: https://git.openjdk.org/jdk/compare/42723dcb1862da598092bb499056940d78a8bdac...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 (@vicente-romero-oracle) 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 Mar 20, 2023
@archiecobbs
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Mar 20, 2023
@openjdk
Copy link

openjdk bot commented Mar 20, 2023

@archiecobbs
Your change (at version 4c6e137) is now ready to be sponsored by a Committer.

@openjdk openjdk bot removed the sponsor Pull request is ready to be sponsored label Mar 21, 2023
@ExE-Boss
Copy link

@archiecobbs
The “sponsor” label has been removed.

@archiecobbs
Copy link
Contributor Author

/integrate

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

openjdk bot commented Mar 22, 2023

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

@archiecobbs
Copy link
Contributor Author

@archiecobbs The “sponsor” label has been removed.

Yeah I saw that. Wasn't sure what I was supposed to do but figured out another/integrate was needed...

Thanks for the hint.

@vicente-romero-oracle
Copy link
Contributor

/sponsor

@openjdk
Copy link

openjdk bot commented Mar 22, 2023

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

  • e73411a: 8304376: Rename t1/t2 classes in com/sun/jdi/CLETest.java to avoid class duplication error in IDE
  • a2d8f63: 8288730: Add type parameter to Lookup::accessClass and Lookup::ensureInitialized
  • 3777455: 8302191: Performance degradation for float/double modulo on Linux
  • 760c012: 8304683: Memory leak in WB_IsMethodCompatible
  • 75168ea: 8304134: jib bootstrapper fails to quote filename when checking download filetype
  • 4154a98: 8301498: Replace NULL with nullptr in cpu/x86
  • ddf1e34: 8304089: Convert TraceDependencies to UL
  • 358c61b: 8294972: Convert jdk.jlink internal plugins to use the Classfile API
  • c74507e: 8304657: G1: Rename set_state_empty to set_state_untracked
  • ca94287: 8304144: G1: Remove unnecessary is_survivor check in G1ClearCardTableTask
  • ... and 18 more: https://git.openjdk.org/jdk/compare/42723dcb1862da598092bb499056940d78a8bdac...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Mar 22, 2023
@openjdk openjdk bot closed this Mar 22, 2023
@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 Mar 22, 2023
@openjdk
Copy link

openjdk bot commented Mar 22, 2023

@vicente-romero-oracle @archiecobbs Pushed as commit 91f407d.

💡 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
compiler compiler-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants