2007-12-01 00:00:00 +00:00
|
|
|
/*
|
2014-07-07 12:36:45 -07:00
|
|
|
* @test /nodynamiccopyright/
|
2007-12-01 00:00:00 +00:00
|
|
|
* @bug 5009574
|
|
|
|
* @summary verify an enum type can't be directly subclassed
|
|
|
|
* @author Joseph D. Darcy
|
|
|
|
*
|
2014-07-07 12:36:45 -07:00
|
|
|
* @compile/fail/ref=FauxEnum3.out -XDrawDiagnostics FauxEnum3.java
|
2007-12-01 00:00:00 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
public class FauxEnum3 extends SpecializedEnum {
|
|
|
|
}
|
|
|
|
|
|
|
|
enum SpecializedEnum {
|
|
|
|
RED {
|
|
|
|
boolean special() {return true;}
|
|
|
|
},
|
|
|
|
GREEN,
|
|
|
|
BLUE;
|
|
|
|
boolean special() {return false;}
|
|
|
|
}
|