Re: RFR: 8296196: `Class.getEnumConstants()` throws undocumented `ClassCastException` and `NullPointerException`

2022-11-09 Thread Joe Darcy
On Wed, 9 Nov 2022 10:14:45 GMT, Adam Sotona wrote: > When `Class.getEnumConstants()` is called on a bad enum class where > `values()` is an instance method, or returns a non‑array, then it throws > `NullPointerException` or `ClassCastException` respectively. > > This patch fixes `Class.getEn

RFR: 8296196: `Class.getEnumConstants()` throws undocumented `ClassCastException` and `NullPointerException`

2022-11-09 Thread Adam Sotona
When `Class.getEnumConstants()` is called on a bad enum class where `values()` is an instance method, or returns a non‑array, then it throws `NullPointerException` or `ClassCastException` respectively. This patch fixes `Class.getEnumConstants()` method to handle above mentioned bad enums and a