Skip to content

8043251: Bogus javac error: required: no arguments, found: no arguments#10799

Closed
archiecobbs wants to merge 4 commits intoopenjdk:masterfrom
archiecobbs:JDK-8043251
Closed

8043251: Bogus javac error: required: no arguments, found: no arguments#10799
archiecobbs wants to merge 4 commits intoopenjdk:masterfrom
archiecobbs:JDK-8043251

Conversation

@archiecobbs
Copy link
Contributor

@archiecobbs archiecobbs commented Oct 20, 2022

We have an error message compiler.err.cant.apply.symbol for cases where a method invocation doesn't resolve. It shows the "required" parameters and the "found" parameters, plus a further description of the problem.

This message being used inappropriately when the problem is actually due to explicitly passed method type parameters instead of regular method parameters.

For example, if you do this:

Function<String, String> f = Function.<String, String>identity();

the error reported is this:

error: method identity in interface Function<T,R> cannot be applied to given types;
    Function<String, String> f = Function.<String, String>identity();
                                         ^
  required: no arguments
  found:    no arguments
  reason: wrong number of type arguments; required 1
  where T,R are type-variables:
    T extends Object declared in interface Function
    R extends Object declared in interface Function

The real error here is wrong number of type arguments; required 1, but the compiler.err.cant.apply.symbol error message that assumes the problem is with the regular parameters, which it displays. The result is the appearance of the useless and confusing required and found lines.

This patch creates an alternate version of that error message (compiler.err.cant.apply.symbol.noargs) that omits the required and found lines, and makes the compiler use this alternate message when the error is due to type parameters (specifically, when the underlying error is "wrong number of type arguments" or "explicit type argument X does not conform to declared bound(s)").

This improves the error for example above to this:

error: method identity in interface Function<T,R> cannot be applied to given types;
    Function<String, String> f = Function.<String, String>identity();
                                         ^
  reason: wrong number of type arguments; required 1
  where T,R are type-variables:
    T extends Object declared in interface Function
    R extends Object declared in interface Function
1 error

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-8043251: Bogus javac error: required: no arguments, found: no arguments

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10799

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 20, 2022

👋 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
Copy link

openjdk bot commented Oct 20, 2022

@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 Oct 20, 2022
@archiecobbs archiecobbs marked this pull request as ready for review November 7, 2022 16:14
@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 7, 2022
@mlbridge
Copy link

mlbridge bot commented Nov 7, 2022

Webrevs

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 15, 2022

@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

keepalive

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 sensible

@openjdk
Copy link

openjdk bot commented Jan 6, 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:

8043251: Bogus javac error: required: no arguments, found: no arguments

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

  • 4a95c74: 8299425: "LCMSImageLayout.isIntPacked" flag can be deleted
  • d6d6eb4: 8299699: Test runtime/cds/appcds/WrongClasspath.java fails after JDK-8299329
  • 8c70bf3: 8299544: Improve performance of CRC32C intrinsics (non-AVX-512) for small inputs
  • d6e9f01: 8285416: [LOOM] Some nsk/jdi tests fail due to needing too many virtual threads
  • ba03f42: 8299746: Accept unknown signatureAlgorithm in PKCS7 SignerInfo
  • 3dcf700: 8299336: InputStream::DEFAULT_BUFFER_SIZE should be 16384
  • 1e99729: 8299274: Add elements to resolved_references consistently
  • 8cc1669: 8299721: [Vector API] assert in switch-default of LibraryCallKit::arch_supports_vector_rotate is too weak to catch bugs
  • 5598acc: 8294403: [REDO] make test should report only on executed tests
  • 88f0ea7: 8299726: [cleanup] Some code cleanup in opto/compile.hpp
  • ... and 145 more: https://git.openjdk.org/jdk/compare/da38d43fcc640ea9852db6c7c23817dcef7080d5...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 Jan 6, 2023
@archiecobbs
Copy link
Contributor Author

/integrate

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

openjdk bot commented Jan 6, 2023

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

@vicente-romero-oracle
Copy link
Contributor

/sponsor

@openjdk
Copy link

openjdk bot commented Jan 9, 2023

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

  • cd10c72: 8299500: Usage of constructors of primitive wrapper classes should be avoided in java.text API docs
  • bfd5971: 8299757: Update JCov version to 3.0.14
  • 17a3f0e: 8299275: Add some ClassLoaderData verification code
  • 4ba8122: 8299312: Clean up BarrierSetNMethod
  • 66db0bb: 8299692: G1: Remove unused G1BlockOffsetTable::is_card_boundary
  • 7068457: 8298472: AArch64: Detect Ampere-1 and Ampere-1A CPUs and set default options
  • 500c3c1: 8298730: Refactor subsystem_file_line_contents and add docs and tests
  • 4072412: 8298876: Swing applications do not get repainted coming out of sleep on Windows 10
  • a503ec2: 8299608: Add Register + imm32 orq to x86_64 assembler
  • d2827ec: 8299671: speed up compiler/intrinsics/string/TestStringLatin1IndexOfChar.java
  • ... and 174 more: https://git.openjdk.org/jdk/compare/da38d43fcc640ea9852db6c7c23817dcef7080d5...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jan 9, 2023

@vicente-romero-oracle @archiecobbs Pushed as commit 679e485.

💡 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.

2 participants