A DESCRIPTION OF THE PROBLEM :
The javadocs read: "Returns: ... null if this Class object does not represent an enum type" . This is not 100% correct. null is also returned if the class is the Enum.class which can happen with generics.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Maybe the javadocs should be updated to read:
@return an array containing the values comprising the enum class represented by this Class object in the order they're declared, or null if this Class object does not represent a concrete enum type
ACTUAL -
@return an array containing the values comprising the enum class represented by this Class object in the order they're declared, or null if this Class object does not represent an enum type
URL OF FAULTY DOCUMENTATION :
https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html#getEnumConstants--
The javadocs read: "Returns: ... null if this Class object does not represent an enum type" . This is not 100% correct. null is also returned if the class is the Enum.class which can happen with generics.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Maybe the javadocs should be updated to read:
@return an array containing the values comprising the enum class represented by this Class object in the order they're declared, or null if this Class object does not represent a concrete enum type
ACTUAL -
@return an array containing the values comprising the enum class represented by this Class object in the order they're declared, or null if this Class object does not represent an enum type
URL OF FAULTY DOCUMENTATION :
https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html#getEnumConstants--