Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/Java/Openjdk/test/langtools/tools/javac/defaultMethods/   (Sun/Oracle ©)  Datei vom 13.11.2022 mit Größe 932 B image not shown  

Quelle  Neg03.java   Sprache: JAVA

 
/* @test /nodynamiccopyright/
 * @bug 7192246
 * @summary check that re-abstraction works properly
 * @compile/fail/ref=Neg03.out -XDrawDiagnostics Neg03.java
 */


class Neg03 {
    interface A {
        default void m() { Neg03.one(this); }
    }

    interface B {
        default void m() { Neg03.two(this); }
    }

    interface C extends A, B {
        default void m() { Neg03.one(this); }
    }

    static class X implements C, A { } //ok - ignore extraneous remix of A

    interface D extends A, B {
      void m();  // ok - m() is not reabstracted!
    }

    static class Y implements D, A { } // invalid - abstract D.m()

    interface E extends A {
        void m();  // reabstraction of m()
    }

    static class W implements D, E { } // invalid - abstracts D.m()/E.m()

    static class Z implements D, A, B { } // invalid - abstract D.m()

    static void one(Object a) {  }
    static void two(Object a) {  }
}

Messung V0.5
C=95 H=90 G=92

¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.