harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r462566 - in /incubator/harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/ main/java/common/javax/swing/event/ main/java/common/javax/swing/plaf/basic/ test/api/java/common/javax/swing/event/
Date Tue, 10 Oct 2006 21:08:02 GMT
Author: tellison
Date: Tue Oct 10 14:08:01 2006
New Revision: 462566

URL: http://svn.apache.org/viewvc?view=rev&rev=462566
Log:
Apply patch HARMONY-1760 ([classlib][swing] Generification of javax.swing, javax.swing.event
and javax.swing.plaf.basic)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/AbstractListModel.java
    incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/AbstractSpinnerModel.java
    incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/ButtonGroup.java
    incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultBoundedRangeModel.java
    incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultButtonModel.java
    incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultComboBoxModel.java
    incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultListModel.java
    incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultListSelectionModel.java
    incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultSingleSelectionModel.java
    incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComboBox.java
    incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComponent.java
    incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JLayeredPane.java
    incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JList.java
    incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTable.java
    incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTree.java
    incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/LookAndFeel.java
    incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/SortingFocusTraversalPolicy.java
    incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/SpinnerListModel.java
    incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/SwingUtilities.java
    incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/Timer.java
    incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/UIDefaults.java
    incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/event/EventListenerList.java
    incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicDirectoryModel.java
    incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicFileChooserUI.java
    incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicTreeUI.java
    incubator/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/event/EventListenerListTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/AbstractListModel.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/AbstractListModel.java?view=diff&rev=462566&r1=462565&r2=462566
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/AbstractListModel.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/AbstractListModel.java
Tue Oct 10 14:08:01 2006
@@ -44,7 +44,7 @@
         return (ListDataListener[])getListeners(ListDataListener.class);
     }
 
-    public EventListener[] getListeners(final Class listenerType) {
+    public <T extends java.util.EventListener> T[] getListeners(final Class<T>
listenerType) {
         return listenerList.getListeners(listenerType);
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/AbstractSpinnerModel.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/AbstractSpinnerModel.java?view=diff&rev=462566&r1=462565&r2=462566
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/AbstractSpinnerModel.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/AbstractSpinnerModel.java
Tue Oct 10 14:08:01 2006
@@ -58,7 +58,7 @@
         }
     }
 
-    public EventListener[] getListeners(final Class listenerType) {
+    public <T extends java.util.EventListener> T[] getListeners(final Class<T>
listenerType) {
         return listenerList.getListeners(listenerType);
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/ButtonGroup.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/ButtonGroup.java?view=diff&rev=462566&r1=462565&r2=462566
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/ButtonGroup.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/ButtonGroup.java
Tue Oct 10 14:08:01 2006
@@ -26,7 +26,7 @@
 
 public class ButtonGroup implements Serializable {
 
-    protected Vector buttons = new Vector();
+    protected Vector<javax.swing.AbstractButton> buttons = new Vector<javax.swing.AbstractButton>();
 
     private ButtonModel selection;
 
@@ -52,7 +52,7 @@
         return buttons.size();
     }
 
-    public Enumeration getElements() {
+    public Enumeration<javax.swing.AbstractButton> getElements() {
         return buttons.elements();
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultBoundedRangeModel.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultBoundedRangeModel.java?view=diff&rev=462566&r1=462565&r2=462566
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultBoundedRangeModel.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultBoundedRangeModel.java
Tue Oct 10 14:08:01 2006
@@ -86,7 +86,7 @@
         return extent;
     }
 
-    public EventListener[] getListeners(final Class c) {
+    public <T extends java.util.EventListener> T[] getListeners(final Class<T>
c) {
         return listenerList.getListeners(c);
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultButtonModel.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultButtonModel.java?view=diff&rev=462566&r1=462565&r2=462566
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultButtonModel.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultButtonModel.java
Tue Oct 10 14:08:01 2006
@@ -46,7 +46,7 @@
     protected EventListenerList listenerList = new EventListenerList();
 
 
-    public EventListener[] getListeners(final Class listenersClass) {
+    public <T extends java.util.EventListener> T[] getListeners(final Class<T>
listenersClass) {
         return listenerList.getListeners(listenersClass);
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultComboBoxModel.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultComboBoxModel.java?view=diff&rev=462566&r1=462565&r2=462566
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultComboBoxModel.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultComboBoxModel.java
Tue Oct 10 14:08:01 2006
@@ -42,7 +42,7 @@
         }
     }
 
-    public DefaultComboBoxModel(final Vector items) {
+    public DefaultComboBoxModel(final Vector<?> items) {
         listData = items;
         if (items.size() > 0) {
             selection = items.get(0);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultListModel.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultListModel.java?view=diff&rev=462566&r1=462565&r2=462566
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultListModel.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultListModel.java
Tue Oct 10 14:08:01 2006
@@ -62,7 +62,7 @@
         return internalStorage.elementAt(index);
     }
 
-    public Enumeration elements() {
+    public Enumeration<?> elements() {
         return internalStorage.elements();
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultListSelectionModel.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultListSelectionModel.java?view=diff&rev=462566&r1=462565&r2=462566
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultListSelectionModel.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultListSelectionModel.java
Tue Oct 10 14:08:01 2006
@@ -365,7 +365,7 @@
         return (ListSelectionListener[])getListeners(ListSelectionListener.class);
     }
 
-    public EventListener[] getListeners(final Class listenerType) {
+    public <T extends java.util.EventListener> T[] getListeners(final Class<T>
listenerType) {
         return listenerList.getListeners(listenerType);
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultSingleSelectionModel.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultSingleSelectionModel.java?view=diff&rev=462566&r1=462565&r2=462566
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultSingleSelectionModel.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultSingleSelectionModel.java
Tue Oct 10 14:08:01 2006
@@ -61,7 +61,7 @@
         listenerList.remove(ChangeListener.class, l);
     }
 
-    public EventListener[] getListeners(final Class listenerType) {
+    public <T extends java.util.EventListener> T[] getListeners(final Class<T>
listenerType) {
         return listenerList.getListeners(listenerType);
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComboBox.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComboBox.java?view=diff&rev=462566&r1=462565&r2=462566
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComboBox.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComboBox.java
Tue Oct 10 14:08:01 2006
@@ -175,7 +175,7 @@
     public JComboBox(final Object[] items) {
         this(new DefaultComboBoxModel(items));
     }
-    public JComboBox(final Vector items) {
+    public JComboBox(final Vector<?> items) {
         this(new DefaultComboBoxModel(items));
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComponent.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComponent.java?view=diff&rev=462566&r1=462565&r2=462566
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComponent.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComponent.java
Tue Oct 10 14:08:01 2006
@@ -480,8 +480,8 @@
         vetoableChangeSupport.fireVetoableChange(property, oldValue, newValue);
     }
 
-    public EventListener[] getListeners(final Class listenersClass) {
-        EventListener[] result = super.getListeners(listenersClass);
+    public <T extends java.util.EventListener> T[] getListeners(final Class<T>
listenersClass) {
+        T[] result = super.getListeners(listenersClass);
         if (!Utilities.isEmptyArray(result)) {
             return result;
         }
@@ -492,7 +492,7 @@
         }
 
         if (VetoableChangeListener.class.isAssignableFrom(listenersClass)) {
-            result = getVetoableChangeListeners();
+            result = (T[]) getVetoableChangeListeners();
         }
         return result;
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JLayeredPane.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JLayeredPane.java?view=diff&rev=462566&r1=462565&r2=462566
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JLayeredPane.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JLayeredPane.java
Tue Oct 10 14:08:01 2006
@@ -57,7 +57,7 @@
     /**
      *  The hash table used to store layers for components.
      */
-    private Hashtable componentToLayer;
+    private Hashtable<java.awt.Component, java.lang.Integer> componentToLayer;
 
     static {
         DEFAULT_LAYER = new Integer(DELAULT_LAYER_NUMBER);
@@ -148,9 +148,9 @@
      */
     //XXX: 1.5 migration: uncomment
     //protected Hashtable<Component,Integer> getComponentToLayer()
-    protected Hashtable getComponentToLayer() {
+    protected Hashtable<java.awt.Component, java.lang.Integer> getComponentToLayer()
{
         if (componentToLayer == null) {
-            componentToLayer = new Hashtable();
+            componentToLayer = new Hashtable<java.awt.Component, java.lang.Integer>();
         }
 
         return componentToLayer;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JList.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JList.java?view=diff&rev=462566&r1=462565&r2=462566
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JList.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JList.java
Tue Oct 10 14:08:01 2006
@@ -388,7 +388,7 @@
         putListData((DefaultListModel)getModel(), listData);
     }
 
-    public JList(final Vector listData) {
+    public JList(final Vector<?> listData) {
         this(new DefaultListModel());
         putListData((DefaultListModel)getModel(), listData);
     }
@@ -443,7 +443,7 @@
     }
 
 
-    public void setListData(final Vector listData) {
+    public void setListData(final Vector<?> listData) {
         DefaultListModel defaultModel = new DefaultListModel();
         putListData(defaultModel, listData);
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTable.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTable.java?view=diff&rev=462566&r1=462565&r2=462566
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTable.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTable.java
Tue Oct 10 14:08:01 2006
@@ -609,8 +609,8 @@
             }
         }
 
-        private Class getColumnClass() {
-            Class columnClass =  JTable.this.getColumnClass(getEditingColumn());
+        private Class<?> getColumnClass() {
+            Class<?> columnClass =  JTable.this.getColumnClass(getEditingColumn());
             return columnClass == Object.class ? String.class : columnClass;
         }
     }
@@ -893,7 +893,7 @@
         }
     }
 
-    public void setDefaultRenderer(final Class columnClass, final TableCellRenderer renderer)
{
+    public void setDefaultRenderer(final Class<?> columnClass, final TableCellRenderer
renderer) {
         if (renderer != null) {
             defaultRenderersByColumnClass.put(columnClass, renderer);
         } else {
@@ -901,11 +901,11 @@
         }
     }
 
-    public TableCellRenderer getDefaultRenderer(final Class columnClass) {
+    public TableCellRenderer getDefaultRenderer(final Class<?> columnClass) {
         return (TableCellRenderer)getClosestClass(columnClass, defaultRenderersByColumnClass);
     }
 
-    public void setDefaultEditor(final Class columnClass, final TableCellEditor editor) {
+    public void setDefaultEditor(final Class<?> columnClass, final TableCellEditor
editor) {
         if (editor != null) {
             defaultEditorsByColumnClass.put(columnClass, editor);
         } else {
@@ -913,7 +913,7 @@
         }
     }
 
-    public TableCellEditor getDefaultEditor(final Class columnClass) {
+    public TableCellEditor getDefaultEditor(final Class<?> columnClass) {
         return (TableCellEditor)getClosestClass(columnClass, defaultEditorsByColumnClass);
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTree.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTree.java?view=diff&rev=462566&r1=462565&r2=462566
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTree.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTree.java
Tue Oct 10 14:08:01 2006
@@ -588,13 +588,13 @@
         setShowsRootHandles(true);
     }
 
-    public JTree(final Vector value) {
+    public JTree(final Vector<?> value) {
         this(createTreeModel(value));
         setRootVisible(false);
         setShowsRootHandles(true);
     }
 
-    public JTree(final Hashtable value) {
+    public JTree(final Hashtable<?,?> value) {
         this(createTreeModel(value));
         setRootVisible(false);
         setShowsRootHandles(true);
@@ -906,7 +906,7 @@
         return getSelectionModel().isRowSelected(row);
     }
 
-    public Enumeration getExpandedDescendants(final TreePath parent) {
+    public Enumeration<TreePath> getExpandedDescendants(final TreePath parent) {
         final Enumeration toggled = getDescendantToggledPaths(parent);
         if (toggled == null) {
             return null;
@@ -1355,7 +1355,7 @@
         getSelectionModel().resetRowSelection();
     }
 
-    protected Enumeration getDescendantToggledPaths(final TreePath parent) {
+    protected Enumeration<TreePath> getDescendantToggledPaths(final TreePath parent)
{
         if (parent == null) {
             return null;
         }
@@ -1390,7 +1390,7 @@
         };
     }
 
-    protected void removeDescendantToggledPaths(final Enumeration toRemove) {
+    protected void removeDescendantToggledPaths(final Enumeration<TreePath> toRemove)
{
         if (toRemove == null) {
             return;
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/LookAndFeel.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/LookAndFeel.java?view=diff&rev=462566&r1=462565&r2=462566
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/LookAndFeel.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/LookAndFeel.java
Tue Oct 10 14:08:01 2006
@@ -107,7 +107,7 @@
         }
     }
 
-    public static Object makeIcon(final Class c, final String path) {
+    public static Object makeIcon(final Class<?> c, final String path) {
         return new UIDefaults.LazyValue() {
             public Object createValue(final UIDefaults uiDefaults) {
                 URL resource = c.getResource(path);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/SortingFocusTraversalPolicy.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/SortingFocusTraversalPolicy.java?view=diff&rev=462566&r1=462565&r2=462566
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/SortingFocusTraversalPolicy.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/SortingFocusTraversalPolicy.java
Tue Oct 10 14:08:01 2006
@@ -30,7 +30,7 @@
 import java.util.List;
 
 public class SortingFocusTraversalPolicy extends InternalFrameFocusTraversalPolicy {
-    private Comparator comparator;
+    private Comparator<? super java.awt.Component> comparator;
     private boolean isImplicitDownCycleTraversal = true;
 
     private final NextComponentFinder afterComponentFinder = new NextComponentFinder() {
@@ -118,7 +118,7 @@
         }
     };
 
-    public SortingFocusTraversalPolicy(final Comparator comparator) {
+    public SortingFocusTraversalPolicy(final Comparator<? super java.awt.Component>
comparator) {
         setComparator(comparator);
     }
 
@@ -164,11 +164,11 @@
         return isImplicitDownCycleTraversal;
     }
 
-    protected void setComparator(final Comparator c) {
+    protected void setComparator(final Comparator<? super java.awt.Component> c) {
         comparator = c;
     }
 
-    protected Comparator getComparator() {
+    protected Comparator<? super java.awt.Component> getComparator() {
         return comparator;
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/SpinnerListModel.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/SpinnerListModel.java?view=diff&rev=462566&r1=462565&r2=462566
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/SpinnerListModel.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/SpinnerListModel.java
Tue Oct 10 14:08:01 2006
@@ -26,14 +26,14 @@
 
 public class SpinnerListModel extends AbstractSpinnerModel implements Serializable {
     private static final String[] DEFAULT_VALUES = {"empty"};
-    private List values;
+    private List<?> values;
     private int index = 0;
 
     public SpinnerListModel() {
         this(Arrays.asList(DEFAULT_VALUES));
     }
 
-    public SpinnerListModel(final List values) {
+    public SpinnerListModel(final List<?> values) {
         if (values == null || values.size() <= 0) {
             throw new IllegalArgumentException("SpinnerListModel(List) expects non-null non-empty
List");
         }
@@ -47,11 +47,11 @@
         this.values = Arrays.asList(values);
     }
 
-    public List getList() {
+    public List<?> getList() {
         return values;
     }
 
-    public void setList(final List list) {
+    public void setList(final List<?> list) {
         if (list == null || list.size() <= 0) {
             throw new IllegalArgumentException("");
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/SwingUtilities.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/SwingUtilities.java?view=diff&rev=462566&r1=462565&r2=462566
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/SwingUtilities.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/SwingUtilities.java
Tue Oct 10 14:08:01 2006
@@ -207,7 +207,7 @@
         return (Container)ancestor;
     }
 
-    public static Container getAncestorOfClass(final Class wantedClass, final Component component)
{
+    public static Container getAncestorOfClass(final Class<?> wantedClass, final Component
component) {
         if (component == null || wantedClass == null) {
             return null;
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/Timer.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/Timer.java?view=diff&rev=462566&r1=462565&r2=462566
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/Timer.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/Timer.java
Tue Oct 10 14:08:01 2006
@@ -147,7 +147,7 @@
         return (timerTask != null);
     }
 
-    public EventListener[] getListeners(final Class listenersClass) {
+    public <T extends java.util.EventListener> T[] getListeners(final Class<T>
listenersClass) {
         return listenerList.getListeners(listenersClass);
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/UIDefaults.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/UIDefaults.java?view=diff&rev=462566&r1=462565&r2=462566
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/UIDefaults.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/UIDefaults.java
Tue Oct 10 14:08:01 2006
@@ -44,7 +44,7 @@
 import javax.swing.plaf.ComponentUI;
 import javax.swing.plaf.UIResource;
 
-public class UIDefaults extends Hashtable {
+public class UIDefaults extends Hashtable<Object, Object> {
 
     public static interface ActiveValue {
         Object createValue(UIDefaults uiDefaults);
@@ -354,16 +354,18 @@
         });
     }
 
-    public Class getUIClass(final String name) {
+    public Class<? extends javax.swing.plaf.ComponentUI> getUIClass(final String name)
{
         return getUIClass(name, ClassLoader.getSystemClassLoader());
     }
 
-    public Class getUIClass(final String name, final ClassLoader classLoader) {
+    public Class<? extends javax.swing.plaf.ComponentUI> getUIClass(final String name,
final ClassLoader classLoader) {
         try {
             if (classLoader == null) {
-                return Class.forName((String)get(name), false, classLoader);
+                return (Class<? extends javax.swing.plaf.ComponentUI>)
+                        Class.forName((String)get(name), false, classLoader);
             } else {
-                return classLoader.loadClass((String)get(name));
+                return (Class<? extends javax.swing.plaf.ComponentUI>)
+                        classLoader.loadClass((String)get(name));
             }
         } catch (final ClassNotFoundException e) {
             StringWriter writer = new StringWriter();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/event/EventListenerList.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/event/EventListenerList.java?view=diff&rev=462566&r1=462565&r2=462566
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/event/EventListenerList.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/event/EventListenerList.java
Tue Oct 10 14:08:01 2006
@@ -32,7 +32,10 @@
 
     protected transient Object[] listenerList = new Object[0];
 
-    public synchronized void remove(final Class listenerClass, final EventListener listener)
{
+    public synchronized <T extends java.util.EventListener> void remove(
+            final Class<T> listenerClass,
+            final T listener
+    ) {
         if (listener == null) {
             return;
         }
@@ -54,7 +57,10 @@
         }
     }
 
-    public synchronized void add(final Class listenerClass, final EventListener listener)
{
+    public synchronized <T extends java.util.EventListener> void add(
+            final Class<T> listenerClass,
+            final T listener
+    ) {
         if (listener == null) {
             return;
         }
@@ -67,16 +73,16 @@
         listenerList = newList;
     }
 
-    public EventListener[] getListeners(final Class listenerClass) {
+    public <T extends java.util.EventListener> T[] getListeners(final Class<T>
listenerClass) {
         int numClassListeners = getListenerCount(listenerClass);
-        EventListener[] listeners = (EventListener[]) (Array.newInstance(
+        T[] listeners = (T[]) (Array.newInstance(
                 listenerClass, numClassListeners));
         if (numClassListeners > 0) {
             for (int innerIndex = 0, outerIndex = 0;
                     outerIndex < numClassListeners; innerIndex += 2) {
 
                 if (listenerList[innerIndex] == listenerClass) {
-                    listeners[numClassListeners - 1 - outerIndex] = (EventListener) listenerList[innerIndex
+ 1];
+                    listeners[numClassListeners - 1 - outerIndex] = (T) listenerList[innerIndex
+ 1];
                     ++outerIndex;
                 }
             }
@@ -106,7 +112,7 @@
         return listenerList;
     }
 
-    public int getListenerCount(final Class listenerClass) {
+    public int getListenerCount(final Class<?> listenerClass) {
         int counter = 0;
         for (int i = 0; i < listenerList.length; i += 2){
             if (listenerList[i] == listenerClass) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicDirectoryModel.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicDirectoryModel.java?view=diff&rev=462566&r1=462565&r2=462566
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicDirectoryModel.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicDirectoryModel.java
Tue Oct 10 14:08:01 2006
@@ -34,25 +34,28 @@
 import javax.swing.filechooser.FileFilter;
 
 public class BasicDirectoryModel extends AbstractListModel implements PropertyChangeListener
{
-    private Vector fileList;
+    private Vector<java.io.File> fileList;
     private JFileChooser fc;
-    private final Comparator fileComparator = new Comparator() {
-        public int compare(final Object o1, final Object o2) {
-            File file1 = (File)o1;
-            File file2 = (File)o2;
+    private final Comparator<File> fileComparator = new Comparator<File>() {
+        public int compare(final File o1, final File o2) {
+            return lt(o1, o2) ? -1 : 1;
+        }
+    };
 
-            return lt(file1, file2) ? -1 : 1;
+    private final class FileComparator<T extends File> implements Comparator<T>
{
+        public int compare(final T o1, final T o2) {
+            return lt(o1, o2) ? -1 : 1;
         }
     };
 
-    public Vector getFiles() {
+    public Vector<java.io.File> getFiles() {
         return fileList;
     }
 
     public BasicDirectoryModel(final JFileChooser filechooser) {
         fc = filechooser;
         fc.addPropertyChangeListener(this);
-        fileList = new Vector();
+        fileList = new Vector<java.io.File>();
     }
 
     public Object getElementAt(final int index) {
@@ -76,7 +79,7 @@
     public void invalidateFileCache() {
     }
 
-    public Vector getDirectories() {
+    public Vector<java.io.File> getDirectories() {
         return null;
     }
 
@@ -139,7 +142,7 @@
     public void intervalRemoved(final ListDataEvent e) {
     }
 
-    protected void sort(final Vector v) {
+    protected void sort(final Vector<? extends java.io.File> v) {
         Collections.sort(v, fileComparator);
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicFileChooserUI.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicFileChooserUI.java?view=diff&rev=462566&r1=462565&r2=462566
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicFileChooserUI.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicFileChooserUI.java
Tue Oct 10 14:08:01 2006
@@ -76,7 +76,7 @@
     }
 
     protected class BasicFileView extends FileView {
-        protected Hashtable iconCache = new Hashtable();
+        protected Hashtable<java.io.File, javax.swing.Icon> iconCache = new Hashtable<java.io.File,
javax.swing.Icon>();
 
         public BasicFileView() {
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicTreeUI.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicTreeUI.java?view=diff&rev=462566&r1=462565&r2=462566
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicTreeUI.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicTreeUI.java
Tue Oct 10 14:08:01 2006
@@ -624,7 +624,7 @@
     protected CellRendererPane rendererPane;
     protected Dimension preferredSize;
     protected AbstractLayoutCache treeState;
-    protected Hashtable drawingCache;
+    protected Hashtable<javax.swing.tree.TreePath, java.lang.Boolean> drawingCache;
     protected AbstractLayoutCache.NodeDimensions nodeDimensions;
     protected TreeModel treeModel;
     protected TreeSelectionModel treeSelectionModel;
@@ -1011,7 +1011,7 @@
 
     protected void prepareForUIInstall() {
         preferredSize = new Dimension();
-        drawingCache = new Hashtable();
+        drawingCache = new Hashtable<javax.swing.tree.TreePath, java.lang.Boolean>();
 
         treeState = createLayoutCache();
         nodeDimensions = createNodeDimensions();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/event/EventListenerListTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/event/EventListenerListTest.java?view=diff&rev=462566&r1=462565&r2=462566
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/event/EventListenerListTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/event/EventListenerListTest.java
Tue Oct 10 14:08:01 2006
@@ -117,9 +117,9 @@
     }
 
     public void testRemove() {
-        EventListener listener1 = new ConcreteListener("1");
-        EventListener listener2 = new ConcreteListener("2");
-        EventListener listener3 = new ConcreteListener("3");
+        ConcreteListener listener1 = new ConcreteListener("1");
+        ConcreteListener listener2 = new ConcreteListener("2");
+        ConcreteListener listener3 = new ConcreteListener("3");
 
         list.add(ConcreteListener.class, listener1);
         list.add(ConcreteListener.class, listener2);
@@ -285,9 +285,9 @@
      * Class under test for int getListenerCount()
      */
     public void testGetListenerCount() {
-        EventListener listener1 = new ConcreteListener("1");
-        EventListener listener2 = new ConcreteListener("2");
-        EventListener listener3 = new ConcreteListener("3");
+        ConcreteListener listener1 = new ConcreteListener("1");
+        ConcreteListener listener2 = new ConcreteListener("2");
+        ConcreteListener listener3 = new ConcreteListener("3");
 
         assertTrue(list.getListenerCount() == 0);
 
@@ -307,7 +307,7 @@
 
     public void testWriteObject() throws IOException {
         ConcreteListener listener1 = new ConcreteSerializableListener("1");
-        ConcreteListener listener2 = new ConcreteSerializableListener("2");
+        ConcreteSerializableListener listener2 = new ConcreteSerializableListener("2");
         ConcreteListener listener3 = new ConcreteListener("3");
         list.add(ConcreteListener.class, listener1);
         list.add(ConcreteSerializableListener.class, listener2);



Mime
View raw message