You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by tv...@apache.org on 2009/11/17 23:40:41 UTC

svn commit: r881587 - in /incubator/pivot/trunk: core/src/org/apache/pivot/beans/ core/src/org/apache/pivot/collections/adapter/ tools/src/org/apache/pivot/tools/wtk/ wtk/src/org/apache/pivot/wtk/ wtk/src/org/apache/pivot/wtkx/

Author: tvolkert
Date: Tue Nov 17 22:40:41 2009
New Revision: 881587

URL: http://svn.apache.org/viewvc?rev=881587&view=rev
Log:
PIVOT-249 :: Fix rawtypes compiler warnings

Modified:
    incubator/pivot/trunk/core/src/org/apache/pivot/beans/BeanDictionary.java
    incubator/pivot/trunk/core/src/org/apache/pivot/collections/adapter/MapAdapter.java
    incubator/pivot/trunk/core/src/org/apache/pivot/collections/adapter/SetAdapter.java
    incubator/pivot/trunk/tools/src/org/apache/pivot/tools/wtk/EventLogger.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/DesktopApplicationContext.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtkx/WTKXSerializer.java

Modified: incubator/pivot/trunk/core/src/org/apache/pivot/beans/BeanDictionary.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/core/src/org/apache/pivot/beans/BeanDictionary.java?rev=881587&r1=881586&r2=881587&view=diff
==============================================================================
--- incubator/pivot/trunk/core/src/org/apache/pivot/beans/BeanDictionary.java (original)
+++ incubator/pivot/trunk/core/src/org/apache/pivot/beans/BeanDictionary.java Tue Nov 17 22:40:41 2009
@@ -627,7 +627,7 @@
                     Object listener = beanListenerProxies.get(listenerInterface);
                     if (listener == null) {
                         listener = Proxy.newProxyInstance(ThreadUtilities.getClassLoader(),
-                            new Class[]{listenerInterface}, invocationHandler);
+                            new Class<?>[]{listenerInterface}, invocationHandler);
                         beanListenerProxies.put(listenerInterface, listener);
                     }
 

Modified: incubator/pivot/trunk/core/src/org/apache/pivot/collections/adapter/MapAdapter.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/core/src/org/apache/pivot/collections/adapter/MapAdapter.java?rev=881587&r1=881586&r2=881587&view=diff
==============================================================================
--- incubator/pivot/trunk/core/src/org/apache/pivot/collections/adapter/MapAdapter.java (original)
+++ incubator/pivot/trunk/core/src/org/apache/pivot/collections/adapter/MapAdapter.java Tue Nov 17 22:40:41 2009
@@ -107,8 +107,8 @@
     @SuppressWarnings("unchecked")
     @Override
     public Comparator<K> getComparator() {
-        if (this.map instanceof SortedMap) {
-            return ((SortedMap) this.map).comparator();
+        if (this.map instanceof SortedMap<?, ?>) {
+            return (Comparator<K>)((SortedMap<?, ?>)this.map).comparator();
         }
         return null;
     }
@@ -119,11 +119,11 @@
         Comparator<K> previousComparator = getComparator();
 
         // If the adapted map supports it, construct a new sorted map
-        if (this.map instanceof SortedMap) {
+        if (this.map instanceof SortedMap<?, ?>) {
             try {
-                Constructor constructor = this.map.getClass().getConstructor(Comparator.class);
+                Constructor<?> constructor = this.map.getClass().getConstructor(Comparator.class);
                 if (constructor != null) {
-                    java.util.Map<K, V> map = (java.util.Map)constructor.newInstance(comparator);
+                    java.util.Map<K, V> map = (java.util.Map<K, V>)constructor.newInstance(comparator);
                     map.putAll(this.map);
                     this.map = map;
                 }

Modified: incubator/pivot/trunk/core/src/org/apache/pivot/collections/adapter/SetAdapter.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/core/src/org/apache/pivot/collections/adapter/SetAdapter.java?rev=881587&r1=881586&r2=881587&view=diff
==============================================================================
--- incubator/pivot/trunk/core/src/org/apache/pivot/collections/adapter/SetAdapter.java (original)
+++ incubator/pivot/trunk/core/src/org/apache/pivot/collections/adapter/SetAdapter.java Tue Nov 17 22:40:41 2009
@@ -103,8 +103,8 @@
     @SuppressWarnings("unchecked")
     @Override
     public Comparator<E> getComparator() {
-        if (this.set instanceof java.util.SortedSet) {
-            return ((java.util.SortedSet) this.set).comparator();
+        if (this.set instanceof java.util.SortedSet<?>) {
+            return (Comparator<E>)((java.util.SortedSet<?>)this.set).comparator();
         }
         return null;
     }
@@ -115,11 +115,11 @@
         Comparator<E> previousComparator = getComparator();
 
         // If the adapted set supports it, construct a new sorted set
-        if (this.set instanceof java.util.SortedSet) {
+        if (this.set instanceof java.util.SortedSet<?>) {
             try {
-                Constructor constructor = this.set.getClass().getConstructor(Comparator.class);
+                Constructor<?> constructor = this.set.getClass().getConstructor(Comparator.class);
                 if (constructor != null) {
-                    java.util.SortedSet<E> set = (java.util.SortedSet) constructor.newInstance(comparator);
+                    java.util.SortedSet<E> set = (java.util.SortedSet<E>)constructor.newInstance(comparator);
                     set.addAll(this.set);
                     this.set = set;
                 }

Modified: incubator/pivot/trunk/tools/src/org/apache/pivot/tools/wtk/EventLogger.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tools/src/org/apache/pivot/tools/wtk/EventLogger.java?rev=881587&r1=881586&r2=881587&view=diff
==============================================================================
--- incubator/pivot/trunk/tools/src/org/apache/pivot/tools/wtk/EventLogger.java (original)
+++ incubator/pivot/trunk/tools/src/org/apache/pivot/tools/wtk/EventLogger.java Tue Nov 17 22:40:41 2009
@@ -334,7 +334,7 @@
                     Object listener = eventListenerProxies.get(listenerInterface);
                     if (listener == null) {
                         listener = Proxy.newProxyInstance(ThreadUtilities.getClassLoader(),
-                            new Class[]{listenerInterface}, loggerInvocationHandler);
+                            new Class<?>[]{listenerInterface}, loggerInvocationHandler);
                         eventListenerProxies.put(listenerInterface, listener);
                     }
 
@@ -342,14 +342,13 @@
                     Class<?> listenerListClass = listenerList.getClass();
                     Method addMethod;
                     try {
-                        addMethod = listenerListClass.getMethod("add",
-                            new Class<?>[] {Object.class});
+                        addMethod = listenerListClass.getMethod("add", Object.class);
                     } catch (NoSuchMethodException exception) {
                         throw new RuntimeException(exception);
                     }
 
                     try {
-                        addMethod.invoke(listenerList, new Object[] {listener});
+                        addMethod.invoke(listenerList, listener);
                     } catch (IllegalAccessException exception) {
                         throw new RuntimeException(exception);
                     } catch (InvocationTargetException exception) {
@@ -394,14 +393,13 @@
                     Class<?> listenerListClass = listenerList.getClass();
                     Method removeMethod;
                     try {
-                        removeMethod = listenerListClass.getMethod("remove",
-                            new Class<?>[] {Object.class});
+                        removeMethod = listenerListClass.getMethod("remove", Object.class);
                     } catch (NoSuchMethodException exception) {
                         throw new RuntimeException(exception);
                     }
 
                     try {
-                        removeMethod.invoke(listenerList, new Object[] {listener});
+                        removeMethod.invoke(listenerList, listener);
                     } catch (IllegalAccessException exception) {
                         throw new RuntimeException(exception);
                     } catch (InvocationTargetException exception) {

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/DesktopApplicationContext.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/DesktopApplicationContext.java?rev=881587&r1=881586&r2=881587&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/DesktopApplicationContext.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/DesktopApplicationContext.java Tue Nov 17 22:40:41 2009
@@ -146,7 +146,7 @@
 
                                     Object eawtApplicationListener =
                                         Proxy.newProxyInstance(DesktopApplicationContext.class.getClassLoader(),
-                                            new Class[]{eawtApplicationListenerClass}, handler);
+                                            new Class<?>[]{eawtApplicationListenerClass}, handler);
 
                                     // Invoke the addApplicationListener() method with the proxy listener
                                     addApplicationListenerMethod.invoke(eawtApplication, new Object[] {eawtApplicationListener});

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtkx/WTKXSerializer.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtkx/WTKXSerializer.java?rev=881587&r1=881586&r2=881587&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtkx/WTKXSerializer.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtkx/WTKXSerializer.java Tue Nov 17 22:40:41 2009
@@ -471,9 +471,8 @@
                         Sequence<Object> sequence = (Sequence<Object>)element.value;
 
                         try {
-                            Method addMethod = sequence.getClass().getMethod("add",
-                                new Class<?>[] {String.class});
-                            addMethod.invoke(sequence, new Object[] {text});
+                            Method addMethod = sequence.getClass().getMethod("add", String.class);
+                            addMethod.invoke(sequence, text);
                         } catch (NoSuchMethodException exception) {
                             throw new SerializationException("Text content cannot be added to "
                                 + sequence.getClass().getName() + ".", exception);
@@ -764,14 +763,14 @@
                             Method getListenerListMethod;
                             try {
                                 Class<?> type = element.value.getClass();
-                                getListenerListMethod = type.getMethod(getListenerListMethodName, new Class<?>[]{});
+                                getListenerListMethod = type.getMethod(getListenerListMethodName);
                             } catch (NoSuchMethodException exception) {
                                 throw new SerializationException(exception);
                             }
 
                             Object listenerList;
                             try {
-                                listenerList = getListenerListMethod.invoke(element.value, new Object[]{});
+                                listenerList = getListenerListMethod.invoke(element.value);
                             } catch (InvocationTargetException exception) {
                                 throw new SerializationException(exception);
                             } catch (IllegalAccessException exception) {
@@ -789,19 +788,19 @@
                                     attribute.value);
 
                             Object listener = Proxy.newProxyInstance(ThreadUtilities.getClassLoader(),
-                                new Class[]{propertyClass}, handler);
+                                new Class<?>[]{propertyClass}, handler);
 
                             // Add the listener
                             Class<?> listenerListClass = listenerList.getClass();
                             Method addMethod;
                             try {
-                                addMethod = listenerListClass.getMethod("add", new Class<?>[] {Object.class});
+                                addMethod = listenerListClass.getMethod("add", Object.class);
                             } catch (NoSuchMethodException exception) {
                                 throw new RuntimeException(exception);
                             }
 
                             try {
-                                addMethod.invoke(listenerList, new Object[] {listener});
+                                addMethod.invoke(listenerList, listener);
                             } catch (IllegalAccessException exception) {
                                 throw new SerializationException(exception);
                             } catch (InvocationTargetException exception) {
@@ -843,7 +842,7 @@
 
                             // Invoke the setter
                             try {
-                                setterMethod.invoke(null, new Object[] {element.value, value});
+                                setterMethod.invoke(null, element.value, value);
                             } catch (Exception exception) {
                                 throw new SerializationException(exception);
                             }
@@ -985,18 +984,16 @@
 
                     Method addMethod;
                     try {
-                        addMethod = listenerListClass.getMethod("add",
-                            new Class<?>[] {Object.class});
+                        addMethod = listenerListClass.getMethod("add", Object.class);
                     } catch (NoSuchMethodException exception) {
                         throw new RuntimeException(exception);
                     }
 
-                    Object listener =
-                        Proxy.newProxyInstance(ThreadUtilities.getClassLoader(),
-                            new Class[]{listenerClass}, handler);
+                    Object listener = Proxy.newProxyInstance(ThreadUtilities.getClassLoader(),
+                        new Class<?>[]{listenerClass}, handler);
 
                     try {
-                        addMethod.invoke(element.parent.value, new Object[] {listener});
+                        addMethod.invoke(element.parent.value, listener);
                     } catch (IllegalAccessException exception) {
                         throw new SerializationException(exception);
                     } catch (InvocationTargetException exception) {
@@ -1382,7 +1379,7 @@
         if (objectType != null) {
             try {
                 method = propertyClass.getMethod(BeanDictionary.GET_PREFIX
-                    + propertyName, new Class<?>[] {objectType});
+                    + propertyName, objectType);
             } catch (NoSuchMethodException exception) {
                 // No-op
             }
@@ -1390,7 +1387,7 @@
             if (method == null) {
                 try {
                     method = propertyClass.getMethod(BeanDictionary.IS_PREFIX
-                        + propertyName, new Class<?>[] {objectType});
+                        + propertyName, objectType);
                 } catch (NoSuchMethodException exception) {
                     // No-op
                 }
@@ -1413,8 +1410,7 @@
             final String methodName = BeanDictionary.SET_PREFIX + propertyName;
 
             try {
-                method = propertyClass.getMethod(methodName,
-                    new Class<?>[] {objectType, propertyValueType});
+                method = propertyClass.getMethod(methodName, objectType, propertyValueType);
             } catch (NoSuchMethodException exception) {
                 // No-op
             }
@@ -1428,7 +1424,7 @@
 
                     try {
                         method = propertyClass.getMethod(methodName,
-                            new Class<?>[] {objectType, primitivePropertyValueType});
+                            objectType, primitivePropertyValueType);
                     } catch (NoSuchMethodException exception) {
                         // No-op
                     }