[Libreoffice-commits] .: wizards/com

Ivan Timofeev ivantimofeev at kemper.freedesktop.org
Fri Nov 4 02:20:29 PDT 2011


 wizards/com/sun/star/wizards/ui/event/DataAware.java        |   11 ++++-------
 wizards/com/sun/star/wizards/ui/event/MethodInvocation.java |   11 +++--------
 2 files changed, 7 insertions(+), 15 deletions(-)

New commits:
commit 504b384dd1c74838f34d5caa27f3e916bb309a8c
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date:   Fri Nov 4 13:08:38 2011 +0400

    suppress warnings about inexact argument type

diff --git a/wizards/com/sun/star/wizards/ui/event/DataAware.java b/wizards/com/sun/star/wizards/ui/event/DataAware.java
index be7260d..608203c 100644
--- a/wizards/com/sun/star/wizards/ui/event/DataAware.java
+++ b/wizards/com/sun/star/wizards/ui/event/DataAware.java
@@ -291,15 +291,12 @@ 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, EMPTY_ARRAY);
+                m = obj.getClass().getMethod("get" + propName, (Class[]) null);
             }
             catch (NoSuchMethodException ex1)
             {
@@ -307,13 +304,13 @@ public abstract class DataAware {
             }
             return m;
         }
-        
+
         /* (non-Javadoc)
          * @see com.sun.star.wizards.ui.event.DataAware.Value#get(java.lang.Object)
          */
         public Object get(Object target) {
             try {
-                return getMethod.invoke(target, EMPTY_ARRAY);
+                return getMethod.invoke(target, (Object[]) null);
             } catch (IllegalAccessException ex1) {
                 ex1.printStackTrace();
             } catch (InvocationTargetException ex2) {
@@ -329,7 +326,7 @@ public abstract class DataAware {
                     return new short[0];
             }
             return null;
-        
+
         }
 
         protected Method createSetMethod(String propName, Object obj, Class paramClass) {
diff --git a/wizards/com/sun/star/wizards/ui/event/MethodInvocation.java b/wizards/com/sun/star/wizards/ui/event/MethodInvocation.java
index adea073..621158e 100644
--- a/wizards/com/sun/star/wizards/ui/event/MethodInvocation.java
+++ b/wizards/com/sun/star/wizards/ui/event/MethodInvocation.java
@@ -42,10 +42,6 @@ import java.lang.reflect.Method;
  */
 public class MethodInvocation
 {
-
-    static final Class[] EMPTY_ARRAY =
-    {
-    };
     //the method to invoke.
     Method mMethod;
     //the object to invoke the method on.
@@ -66,7 +62,7 @@ public class MethodInvocation
 
     public MethodInvocation(String methodName, Object obj, Class paramClass) throws NoSuchMethodException
     {
-        this(paramClass == null ? obj.getClass().getMethod(methodName, null) : obj.getClass().getMethod(methodName, new Class[]
+        this(paramClass == null ? obj.getClass().getMethod(methodName, (Class[]) null) : obj.getClass().getMethod(methodName, new Class[]
                 {
                     paramClass
                 }), obj, paramClass);
@@ -86,12 +82,11 @@ public class MethodInvocation
     {
         if (mWithParam)
         {
-            return mMethod.invoke(mObject, (Object) param
-                    );
+            return mMethod.invoke(mObject, (Object) param);
         }
         else
         {
-            return mMethod.invoke(mObject, EMPTY_ARRAY);
+            return mMethod.invoke(mObject, (Object[]) null);
         }
     }
 


More information about the Libreoffice-commits mailing list