Patch to fix this:
public Object bindObject(Map map, Object target) {
try {
objectStack.add(target);
BeanInfo info = Introspector.getBeanInfo(target.getClass());
for (PropertyDescriptor descriptor : info.getPropertyDescriptors()) {
if (map.containsKey(descriptor.getName())) {
Object value = map.get(descriptor.getName());
currentPath.enqueue(descriptor.getName());
Method method = descriptor.getWriteMethod();
// Added code block to handle setter methods with a generic parameter (see marker End of code block)
if (method == null) {
// Try to retrieve method via reflection API in case the formal parameter has originally been declared as a generic type
try {
Method readMethod = target.getClass().getMethod("get" + StringUtils.capitalize(descriptor.getName()));
method = target.getClass().getMethod("set" + StringUtils.capitalize(descriptor.getName()), readMethod.getReturnType());
}
catch (NoSuchMethodException e) {
// No matching setter method found. Assume read only bean property.
}
catch (SecurityException e) {
// No matching setter method found. Assume read only bean property.
}
}
// End of code block
if (method != null) {
Class[] types = method.getParameterTypes();
if (types.length == 1) {
Class paramType = types[0];
method.invoke(objectStack.getLast(), convert(value, paramType));
}
else {
throw new JSONException("Expected a parameter for method " + target.getClass().getName() + "." + method.getName() + " but got " + types.length);
}
}
else {
try {
Field field = target.getClass().getDeclaredField(descriptor.getName());
field.setAccessible(true);
field.set(target, convert(value, field.getType()));
}
catch (NoSuchFieldException e) {
// ignore must not be there.
}
}
currentPath.pop();
}
}
return objectStack.removeLast();
}
catch (IllegalAccessException e) {
throw new JSONException(currentPath + ":Could not access the no-arg constructor for " + target.getClass().getName(), e);
}
catch (InvocationTargetException ex) {
throw new JSONException(currentPath + ": Exception while trying to invoke setter method.", ex);
}
catch (IntrospectionException e) {
throw new JSONException(currentPath + ":Could not inspect " + target.getClass().getName(), e);
}
}
I don't see the patch here. Plus this code has changed so much I don't think this patch would be useful anymore. Any details on what this patch was for? What was the exact problem discovered? Can you try you problem again with 1.9?