rationale for swallowing exceptions in Class#getEnumConstantsShared

Jochen Theodorou blackdrag at gmx.org
Fri Feb 28 15:56:07 UTC 2014


Hi,

we stumbled here about a strange error involving enums generated from 
our compiler and that did make me see getEnumConstantsShared() in 
java.lang.Class.

Now the implementation more or less says, that if calling values() fails 
in any way, return null and ignore the exception. But why is the 
exception ignored? It could contain valuable information about what did 
go wrong....

In my code for example, something obviously goes wrong... sometimes... 
depending on moon-phases or something. and I have not the slightest idea 
what.

bye Jochen


-- 
Jochen "blackdrag" Theodorou - Groovy Project Tech Lead
blog: http://blackdragsview.blogspot.com/
german groovy discussion newsgroup: de.comp.lang.misc
For Groovy programming sources visit http://groovy-lang.org




More information about the core-libs-dev mailing list