zaubersoftware/mom — Issue #1: Can log4j be supported, with more logging details, especially when throwing exceptions?
Author: adrianhsieh
Created: 2011-10-13 00:23:09+00:00
State: open

In MapObjectMapper.java, inside private class MapToBeanConverter, would be nice if more detailed logging is provided. I did this locally today:
private class MapToBeanConverter implements Converter {
public Object convert(final Class type, final Object value) {
if(type.isAssignableFrom(value.getClass()))
return value;
try {
LazyDynaMap dynaMap = new LazyDynaMap((Map) value);
Object bean = type.newInstance();
copyProperties(dynaMap, bean);
return bean;
} catch (Exception e) {
System.out.println("\n\n\nException is for: " + value + "\nType: " + type);
throw soften(e);
}
}

To print out which element was giving me the problem & got me over the hump. If there is a log output at the ERROR level in there, that will be great.

Thanks!!

Adrian