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

Incorrect erasure of exceptions in override-equivalent dual interface impl

XMLWordPrintable

    • b109
    • x86
    • linux
    • Verified

      FULL PRODUCT VERSION :
      java version "1.8.0_66"
      Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
      Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Linux mavant-linux 3.2.0-97-generic #137-Ubuntu SMP Thu Dec 17 18:11:47 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
      Darwin mavant-mbp 14.5.0 Darwin Kernel Version 14.5.0: Tue Sep 1 21:23:09 PDT 2015; root:xnu-2782.50.1~1/RELEASE_X86_64 x86_64

      A DESCRIPTION OF THE PROBLEM :
      When a class implements two interfaces which specify override-equivalent methods which throw exceptions, the the exception is incorrectly erased from the method signature of the implementing class.


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------

      public class T {
          interface S1 {
              <K extends Exception> void run(Class<K> clazz) throws K;
          }
          interface S2 {
              <K extends Exception> void run(Class<K> clazz) throws K;
          }
          interface S extends S1, S2 {}
          public void foo(S s) {
              s.run(java.io.IOException.class);
          }
      }

      ---------- END SOURCE ----------

            sadayapalam Srikanth Adayapalam (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: