diff options
Diffstat (limited to 'wizards/com/sun/star/wizards/ui/event/DataAware.java')
-rw-r--r-- | wizards/com/sun/star/wizards/ui/event/DataAware.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/wizards/com/sun/star/wizards/ui/event/DataAware.java b/wizards/com/sun/star/wizards/ui/event/DataAware.java index 608203c21252..6138286e80c0 100644 --- a/wizards/com/sun/star/wizards/ui/event/DataAware.java +++ b/wizards/com/sun/star/wizards/ui/event/DataAware.java @@ -291,12 +291,15 @@ public abstract class DataAware { * @param obj the object which contains the property. * @return the get method reflection object. */ + private static Class[] EMPTY_ARRAY = new Class[0]; + protected Method createGetMethod(String propName, Object obj) { Method m = null; try { //try to get a "get" method. - m = obj.getClass().getMethod("get" + propName, (Class[]) null); + + m = obj.getClass().getMethod("get" + propName, EMPTY_ARRAY); } catch (NoSuchMethodException ex1) { @@ -310,7 +313,7 @@ public abstract class DataAware { */ public Object get(Object target) { try { - return getMethod.invoke(target, (Object[]) null); + return getMethod.invoke(target, EMPTY_ARRAY); } catch (IllegalAccessException ex1) { ex1.printStackTrace(); } catch (InvocationTargetException ex2) { @@ -326,7 +329,6 @@ public abstract class DataAware { return new short[0]; } return null; - } protected Method createSetMethod(String propName, Object obj, Class paramClass) { |