Skip to content

Conversation

@sadayapalam
Copy link

@sadayapalam sadayapalam commented Oct 21, 2022

Align with JLS 13.1 (the qualifying class or interface of the method invocation) by
referring to the type of the receiver rather than the type of the declaring
class/interface in the bootstrap attribute


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-8059632: Method reference compilation uses incorrect qualifying type
  • JDK-8295975: Method reference compilation uses incorrect qualifying type (CSR)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10809

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 21, 2022

👋 Welcome back sadayapalam! 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.

// would refer to the type of the receiver and not the type of the declaring interface,
// per JLS 13.1 (see "the qualifying type of the method invocation").

Class.forName("MethodRefQualifyingTypeTest$MethodInvoker").getMethod("invoke").invoke(null);
Copy link
Author

Choose a reason for hiding this comment

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

This test is actually derived from a "failing" JCK test: lang/LMBD/lmbd171/lmbd17101m51/lmbd17101m51.html.lmbd17101m51 that incorrectly asserts that there be a linkage error

@openjdk
Copy link

openjdk bot commented Oct 21, 2022

@sadayapalam 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 21, 2022
@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 21, 2022
@mlbridge
Copy link

mlbridge bot commented Oct 21, 2022

Webrevs

Copy link
Contributor

@mcimadamore mcimadamore left a comment

Choose a reason for hiding this comment

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

Looks very good to me. Nice unification of the code, the spec is quite clear on this (binary form of method references and method invocation should be the same).

return sym;
// array clone can be qualified by the array type in later targets
Symbol qualifier;
if ((qualifier = qualifiedSymbolCache.get(site)) == null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I know this code has been moved here from Gen - I'd be very very curious to understand if the caching mechanism actually does anything meaningful performance-wise. Seems just a way to add more state.

Copy link
Contributor

@mcimadamore mcimadamore Oct 21, 2022

Choose a reason for hiding this comment

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

Needs a CSR, given the potential change to the set of programs that might run correctly.

@openjdk
Copy link

openjdk bot commented Oct 21, 2022

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

8059632: Method reference compilation uses incorrect qualifying type

Reviewed-by: mcimadamore

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 no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential 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 ready Pull request is ready to be integrated label Oct 21, 2022
@sadayapalam
Copy link
Author

/csr needed

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

openjdk bot commented Oct 21, 2022

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

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

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Oct 21, 2022
public static void invoke() {
MyFunctionalInterface instance = null;
MethodSupplierImpl ms = new MethodSupplierImpl() {
public int m(int a){
Copy link
Member

@turbanoff turbanoff Oct 23, 2022

Choose a reason for hiding this comment

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

Suggested change
public int m(int a){
public int m(int a) {

@openjdk openjdk bot added ready Pull request is ready to be integrated and removed csr Pull request needs approved CSR before integration labels Nov 18, 2022
@sadayapalam
Copy link
Author

/integrate

@openjdk
Copy link

openjdk bot commented Nov 21, 2022

Going to push as commit 544e317.

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

openjdk bot commented Nov 21, 2022

@sadayapalam Pushed as commit 544e317.

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

@sadayapalam sadayapalam deleted the JDK-8059632 branch November 21, 2022 03:50
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