mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00

Co-authored-by: Vicente Romero <vromero@openjdk.org> Co-authored-by: Harold Seigel <hseigel@openjdk.org> Co-authored-by: Chris Hegarty <chegar@openjdk.org> Reviewed-by: jlahoda
19 lines
413 B
Java
19 lines
413 B
Java
/*
|
|
* @test /nodynamiccopyright/
|
|
* @bug 5009574
|
|
* @summary verify an enum type can't be directly subclassed
|
|
* @author Joseph D. Darcy
|
|
*
|
|
* @compile/fail/ref=FauxEnum3.out -XDrawDiagnostics FauxEnum3.java
|
|
*/
|
|
|
|
public final class FauxEnum3 extends SpecializedEnum {}
|
|
|
|
enum SpecializedEnum {
|
|
RED {
|
|
boolean special() {return true;}
|
|
},
|
|
GREEN,
|
|
BLUE;
|
|
boolean special() {return false;}
|
|
}
|