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

javac treats inherited abstract method as an overrider

    Details

    • Subcomponent:
    • Resolved In Build:
      mantis
    • CPU:
      generic
    • OS:
      solaris_8
    • Verification:
      Verified

      Description

      javac improperly rejects this program (detected by jacks 8.4.6.4-abstract-7)

      /*
       * @test %W% %E%
       * @bug 4717181
       * @summary javac treats inherited abstract method as an overrider
       * @author gafter
       *
       * @compile T4717181a.java
       */

      class T4717181a {
          abstract class C {
              abstract void m();
          }
          interface I {
              void m();
          }
          abstract class D extends C implements I {}
      }


      and this

      /*
       * @test %W% %E%
       * @bug 4717181
       * @summary javac treats inherited abstract method as an overrider
       * @author gafter
       *
       * @compile T4717181b.java
       */

      class T4717181b {
          static class E1 extends Exception {}
          static class E2 extends Exception {}
          static class E3 extends Exception {}
          static abstract class Ta {
              public abstract void m() throws E1, E2;
          }
          interface Tb {
              void m() throws E2, E3;
          }
          static abstract class Tc extends Ta implements Tb {
              {
                  try {
                      m(); // intersect throws clauses
                  } catch (E2 e2) {
                  }
              }
          }
      }

        Attachments

          Activity

            People

            • Assignee:
              gafter Neal Gafter
              Reporter:
              gafter Neal Gafter
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: