8234917: Explicitly discuss java.lang.Enum in Class.isEnum spec

Reviewed-by: jjg
This commit is contained in:
Joe Darcy 2019-11-27 10:23:40 -08:00
parent 0a5505f7e9
commit deb0c481e7

View File

@ -3503,7 +3503,9 @@ public final class Class<T> implements java.io.Serializable,
* Returns true if and only if this class was declared as an enum in the
* source code.
*
* Note that if an enum constant is declared with a class body,
* Note that {@link java.lang.Enum} is not itself an enum type.
*
* Also note that if an enum constant is declared with a class body,
* the class of that enum constant object is an anonymous class
* and <em>not</em> the class of the declaring enum type. The
* {@link Enum#getDeclaringClass} method of an enum constant can