[json-lib-user] Bug in toBean() for non-DynaBeans
Brought to you by:
aalmiray
From: Frederick P. <fpo...@po...> - 2006-09-06 19:04:50
|
Greetings, There is a bug in the implementation of toBean() for non-DynaBeans, where for any non-primitive property, setting to null always attempts a (Map) cast (JSONObject.java, line 396), which fails abruptly with a ClassCastException. Changing && to || (line 392) fixes this -- though it doesn't technically set it to null, as it perhaps should. But I haven't investigated the utility enough to understand the ramifications of doing this. Fred |