mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8296196: Class.getEnumConstants() throws undocumented ClassCastException and NullPointerException
Reviewed-by: darcy
This commit is contained in:
parent
78a08a0f21
commit
e802b124b7
4 changed files with 119 additions and 1 deletions
|
@ -3934,7 +3934,8 @@ public final class Class<T> implements java.io.Serializable,
|
|||
// These can happen when users concoct enum-like classes
|
||||
// that don't comply with the enum spec.
|
||||
catch (InvocationTargetException | NoSuchMethodException |
|
||||
IllegalAccessException ex) { return null; }
|
||||
IllegalAccessException | NullPointerException |
|
||||
ClassCastException ex) { return null; }
|
||||
}
|
||||
return constants;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue