=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ReflectionUtils.java' --- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ReflectionUtils.java 2015-01-17 07:41:26 +0000 +++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ReflectionUtils.java 2015-02-12 09:17:36 +0000 @@ -273,6 +273,11 @@ public static Method findSetterMethod( String fieldName, Object target ) { + if ( target == null || StringUtils.isEmpty( fieldName ) ) + { + return null; + } + String[] setterNames = new String[]{ "set" }; @@ -412,7 +417,7 @@ return methods; } - @SuppressWarnings("unchecked") + @SuppressWarnings( "unchecked" ) public static T invokeMethod( Object target, Method method, Object... args ) { if ( target == null || method == null ) @@ -435,7 +440,7 @@ } } - @SuppressWarnings("unchecked") + @SuppressWarnings( "unchecked" ) public static T getFieldObject( Field field, T target ) { return (T) invokeGetterMethod( field.getName(), target );