Authors: russell@unturf.com · brackishbert@gmail.com · foxhop.net · TimeHexOn.com Patches, unit tests, benchmarks, whitepaper, and outreach briefs. Public domain — no copyright claimed. Use freely.
18 lines
386 B
Java
18 lines
386 B
Java
/*
|
|
* @test /nodynamiccopyright/
|
|
* @bug 5009574
|
|
* @summary verify an enum type can't be directly subclassed
|
|
*
|
|
* @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;}
|
|
}
|