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

Missing checkcast when casting to intersection type

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 8, 8-repo-lambda
    • Fix Version/s: 8
    • Component/s: tools
    • Subcomponent:
    • Resolved In Build:
      b87
    • Verification:
      Verified

      Description

      The following program runs w/o exceptions:

      import java.util.*;

      class Test {
          public static void main(String[] args) {
              Runnable r = (List<?> & Runnable)new ArrayList<String>();
          }
      }

      Note that, if the types are swapped in the intersection, the program fails with CCE.

        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: