Skip to content
Snippets Groups Projects
Commit 2a3f8445 authored by brinn's avatar brinn
Browse files

change: ensure we get access to methods even when they are not accessible by...

change: ensure we get access to methods even when they are not accessible by default (e.g. final methods)

SVN: 3969
parent af717b42
No related branches found
No related tags found
No related merge requests found
......@@ -709,7 +709,22 @@ public final class BeanUtils
{
return null;
}
return getter.invoke(bean, ArrayUtils.EMPTY_OBJECT_ARRAY);
final boolean isAccessible = getter.isAccessible();
if (isAccessible == false)
{
getter.setAccessible(true);
}
try
{
final Object oldBean = getter.invoke(bean, ArrayUtils.EMPTY_OBJECT_ARRAY);
return oldBean;
} finally
{
if (isAccessible == false)
{
getter.setAccessible(false);
}
}
}
private static Method getConverterMethod(Method setter, Object sourceBean, Converter converter)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment