Thu, 20 Dec 2012 16:24:18 -0800
8004982: JDK8 source with GPL header errors
Reviewed-by: ohair
mcimadamore@1393 | 1 | /* |
mcimadamore@1393 | 2 | * @test /nodynamiccopyright/ |
mcimadamore@1393 | 3 | * @summary check that re-abstraction works properly |
mcimadamore@1415 | 4 | * @compile/fail/ref=Neg03.out -XDrawDiagnostics Neg03.java |
mcimadamore@1393 | 5 | */ |
mcimadamore@1393 | 6 | |
mcimadamore@1393 | 7 | class Neg03 { |
mcimadamore@1393 | 8 | interface A { |
mcimadamore@1393 | 9 | default void m() { Neg03.one(this); } |
mcimadamore@1393 | 10 | } |
mcimadamore@1393 | 11 | |
mcimadamore@1393 | 12 | interface B { |
mcimadamore@1393 | 13 | default void m() { Neg03.two(this); } |
mcimadamore@1393 | 14 | } |
mcimadamore@1393 | 15 | |
mcimadamore@1393 | 16 | interface C extends A, B { |
mcimadamore@1393 | 17 | default void m() { Neg03.one(this); } |
mcimadamore@1393 | 18 | } |
mcimadamore@1393 | 19 | |
mcimadamore@1393 | 20 | static class X implements C, A { } //ok - ignore extraneous remix of A |
mcimadamore@1393 | 21 | |
mcimadamore@1393 | 22 | interface D extends A, B { |
mcimadamore@1393 | 23 | void m(); // ok - m() is not reabstracted! |
mcimadamore@1393 | 24 | } |
mcimadamore@1393 | 25 | |
mcimadamore@1393 | 26 | static class Y implements D, A { } // invalid - abstract D.m() |
mcimadamore@1393 | 27 | |
mcimadamore@1393 | 28 | interface E extends A { |
mcimadamore@1393 | 29 | void m(); // reabstraction of m() |
mcimadamore@1393 | 30 | } |
mcimadamore@1393 | 31 | |
mcimadamore@1393 | 32 | static class W implements D, E { } // invalid - abstracts D.m()/E.m() |
mcimadamore@1393 | 33 | |
mcimadamore@1393 | 34 | static class Z implements D, A, B { } // invalid - abstract D.m() |
mcimadamore@1393 | 35 | |
mcimadamore@1393 | 36 | static void one(Object a) { } |
mcimadamore@1393 | 37 | static void two(Object a) { } |
mcimadamore@1393 | 38 | } |