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

Eliminate redundant Types.returnTypeSubstitutable method

    Details

      Description

      There are two Types.returnTypeSubstitutable methods. They follow slightly different protocols for their inputs, but ultimately compute the same thing*. This is far from obvious, since their bodies do not look alike and pass through a few layers before sharing the same code.

      The second one is called by Check.checkOverride, and the first one is used by everything else.

      *I _think_ they compute the same thing; they're certainly meant to. Here's a case analysis:

      primitives and void:
          isSameType(R1, R2)
      reference types, methods have same sig:
          subtypeUnchecked(R1, adapt(R2))
      reference types, methods have different sigs:
          first method: subtypeUnchecked(R1, erase(R2))
          second method: subtypeUnchecked(R1, R2) || subtype(R1, erase(R2))

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vromero Vicente Arturo Romero Zaldivar
                Reporter:
                dlsmith Dan Smith
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: