Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8068995

Cleanup method reference lookup code

    Details

    • Subcomponent:
    • Resolved In Build:
      b47
    • Verification:
      Not verified

      Backports

        Description

        Following the latest twists in method reference lookup spec (see JDK-8026231), the code for implementing method reference lookups has become a bit convoluted; there are some issues with the current code:

        * error reporting doesn't follow usual paths for resolution diagnostic - this sometimes leads to duplicate diagnostics
        * there are missed opportunities for code reuse: the core logic of a method reference lookup is unaltered during a full lookup vs. an arity-based lookup (used in structural checks). The only thing that changes is, given the two partial lookup results, how a solution is selected.
        * the diagnostics generated by the compiler are somehow untidy; sometimes the compiler generates method reference specific messages - in other cases it falls back to 'non-static method cannot be referenced from static context'-like messages.
        * diagnostics generated during method reference resolution might vary depending on whether the lookup occurs in a method vs. assignment context.

        All this potentially leads to code that is hard to maintain and such that the quality of the error messages perceived by the user is somehow erratic.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mcimadamore Maurizio Cimadamore
                  Reporter:
                  mcimadamore Maurizio Cimadamore
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: