classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] [generics] Patch: FYI: genericize javax.swing


From: Tom Tromey
Subject: [cp-patches] [generics] Patch: FYI: genericize javax.swing
Date: Fri, 25 Nov 2005 22:16:26 -0700

I'm checking this in on the generics branch.

This genericizes javax.swing.

The only real oddity is the patch to ContentModel.getElements().
Could someone more swing-knowledgeable take a quick look at this and
see whether it is correct?  Let me know if it is not and I will clean
it up.  (It did seem reasonable to me...)

Tom

2005-11-25  Tom Tromey  <address@hidden>

        * javax/swing/text/StyleContext.java (getStyleNames): Genericized.
        * javax/swing/text/MutableAttributeSet.java (removeAttributes):
        Genericized.
        * javax/swing/text/DefaultFormatter.java (getValueClass): Genericized.
        (setValueClass): Likewise.
        * javax/swing/text/AttributeSet.java (getAttributeNames): Genericized.
        * javax/swing/text/AbstractDocument.java (getDocumentProperties):
        Genericized.
        (setDocumentProperties): Likewise.
        (removeAttributes): Likewise.
        * javax/swing/SwingUtilities.java (getAncestorOfClass): Genericized.
        * javax/swing/LookAndFeel.java (makeIcon): Genericized.
        * javax/swing/JTable.java (getColumnClass): Genericized.
        (getDefaultRenderer): Likewise.
        (setDefaultRenderer): Likewise.
        (getDefaultEditor): Likewise.
        (setDefaultEditor): Likewise.
        * javax/swing/JLayeredPane.java (getComponentToLayer): Genericized.
        * javax/swing/DefaultListModel.java (elements): Genericized.
        * javax/swing/ButtonGroup.java (buttons): Genericized.
        (getElements): Likewise.
        * javax/swing/SpinnerListModel.java (SpinnerListModel): Genericized.
        (getList): Likewise.
        (setList): Likewise.
        * javax/swing/SortingFocusTraversalPolicy.java
        (SortingFocusTraversalPolicy): Genericized.
        (getComparator): Likewise.
        (setComparator): Likewise.
        * javax/swing/JTree.java (JTree): Genericized.
        (getDescendantToggledPaths): Likewise.
        (getExpandedDescendants): Likewise.
        (removeDescendantToggledPaths): Likewise.
        * javax/swing/JList.java (JList): Genericized.
        Likewise.
        * javax/swing/JComboBox.java (JComboBox): Genericized.
        * javax/swing/DefaultComboBoxModel.java (DefaultComboBoxModel):
        Genericized.
        * javax/swing/UIDefaults.java: Genericized superclass.
        (getUIClass): Likewise.
        * javax/swing/event/EventListenerList.java (getListenerCount):
        Genericized.
        * javax/swing/plaf/basic/BasicDirectoryModel.java (getDirectories):
        Genericized.
        (getFiles): Likewise.
        (sort): Likewise.
        * javax/swing/plaf/basic/BasicTreeUI.java (drawingCache): Genericized.
        * javax/swing/plaf/basic/BasicFileChooserUI.java (iconCache):
        Genericized.
        * javax/swing/table/TableModel.java (getColumnClass): Genericized.
        * javax/swing/table/DefaultTableColumnModel.java (tableColumns):
        Genericized.
        (getColumns): Likewise.
        (moveColumn): Updated.
        * javax/swing/text/html/parser/ContentModel.java (getElements):
        Genericized.
        * javax/swing/text/html/parser/DTD.java (entityHash): Fixed type.
        * javax/swing/text/html/parser/AttributeList.java (AttributeList):
        Genericized.
        (values): Likewise.
        (getValues): Likewise.
        * javax/swing/tree/AbstractLayoutCache.java (getVisiblePathsFrom):
        Genericized.
        * javax/swing/tree/DefaultMutableTreeNode.java (EMPTY_ENUMERATION):
        Genericized.
        * javax/swing/undo/StateEditable.java (restoreState): Genericized.
        (storeState): Likewise.

Index: javax/swing/ButtonGroup.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/ButtonGroup.java,v
retrieving revision 1.6.2.3
diff -u -r1.6.2.3 ButtonGroup.java
--- javax/swing/ButtonGroup.java        2 Nov 2005 00:43:43 -0000       1.6.2.3
+++ javax/swing/ButtonGroup.java        26 Nov 2005 05:24:13 -0000
@@ -69,7 +69,7 @@
   private static final long serialVersionUID = 4259076101881721375L;
 
   /** The buttons added to this button group. */
-  protected Vector buttons = new Vector();
+  protected Vector<AbstractButton> buttons = new Vector<AbstractButton>();
 
   /** The currently selected button model. */
   ButtonModel sel;
@@ -111,7 +111,7 @@
    *
    * @return <code>Enumeration</code> over all added buttons
    */
-  public Enumeration getElements()
+  public Enumeration<AbstractButton> getElements()
   {
     return buttons.elements();
   }
Index: javax/swing/DefaultComboBoxModel.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/DefaultComboBoxModel.java,v
retrieving revision 1.3.2.5
diff -u -r1.3.2.5 DefaultComboBoxModel.java
--- javax/swing/DefaultComboBoxModel.java       2 Nov 2005 00:43:43 -0000       
1.3.2.5
+++ javax/swing/DefaultComboBoxModel.java       26 Nov 2005 05:24:13 -0000
@@ -104,7 +104,7 @@
    * 
    * @throws NullPointerException if <code>vector</code> is <code>null</code>.
    */
-  public DefaultComboBoxModel(Vector vector)
+  public DefaultComboBoxModel(Vector<?> vector)
   {
     this.list = vector;
     if (vector.size() > 0)
Index: javax/swing/DefaultListModel.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/DefaultListModel.java,v
retrieving revision 1.8.2.2
diff -u -r1.8.2.2 DefaultListModel.java
--- javax/swing/DefaultListModel.java   2 Aug 2005 20:12:36 -0000       1.8.2.2
+++ javax/swing/DefaultListModel.java   26 Nov 2005 05:24:13 -0000
@@ -309,7 +309,7 @@
    *
    * @return A new enumeration which iterates over the list
    */
-  public Enumeration elements()
+  public Enumeration<?> elements()
   {
     return elements.elements();
   }
Index: javax/swing/JComboBox.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JComboBox.java,v
retrieving revision 1.8.2.8
diff -u -r1.8.2.8 JComboBox.java
--- javax/swing/JComboBox.java  2 Nov 2005 00:43:45 -0000       1.8.2.8
+++ javax/swing/JComboBox.java  26 Nov 2005 05:24:14 -0000
@@ -194,7 +194,7 @@
    *
    * @param itemVector vector containing list of items for this JComboBox.
    */
-  public JComboBox(Vector itemVector)
+  public JComboBox(Vector<?> itemVector)
   {
     this(new DefaultComboBoxModel(itemVector));
 
Index: javax/swing/JLayeredPane.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JLayeredPane.java,v
retrieving revision 1.13.2.9
diff -u -r1.13.2.9 JLayeredPane.java
--- javax/swing/JLayeredPane.java       2 Nov 2005 00:43:46 -0000       1.13.2.9
+++ javax/swing/JLayeredPane.java       26 Nov 2005 05:24:14 -0000
@@ -472,7 +472,7 @@
    * Return a hashtable mapping child components of this container to
    * Integer objects representing the component's layer assignments.
    */
-  protected Hashtable getComponentToLayer()
+  protected Hashtable<Component, Integer> getComponentToLayer()
   {
     return componentToLayer;
   }
Index: javax/swing/JList.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JList.java,v
retrieving revision 1.16.2.13
diff -u -r1.16.2.13 JList.java
--- javax/swing/JList.java      2 Nov 2005 00:43:46 -0000       1.16.2.13
+++ javax/swing/JList.java      26 Nov 2005 05:24:15 -0000
@@ -1045,7 +1045,7 @@
    *
    * @param listData Initial data to populate the list with
    */
-  public JList(Vector listData)
+  public JList(Vector<?> listData)
   {
     init();
     setListData(listData);
@@ -1562,7 +1562,7 @@
    * @param listData The object array to build a new list model on
    * @see #setModel
    */
-  public void setListData(final Vector listData)
+  public void setListData(final Vector<?> listData)
   {
     setModel(new AbstractListModel()
         {
Index: javax/swing/JTable.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JTable.java,v
retrieving revision 1.9.2.15
diff -u -r1.9.2.15 JTable.java
--- javax/swing/JTable.java     2 Nov 2005 21:44:48 -0000       1.9.2.15
+++ javax/swing/JTable.java     26 Nov 2005 05:24:15 -0000
@@ -1966,7 +1966,7 @@
     return editor;
   }
 
-  public TableCellEditor getDefaultEditor(Class columnClass)
+  public TableCellEditor getDefaultEditor(Class<?> columnClass)
   {
     if (defaultEditorsByColumnClass.containsKey(columnClass))
       return (TableCellEditor) defaultEditorsByColumnClass.get(columnClass);
@@ -1992,12 +1992,12 @@
     return renderer;
   }
 
-  public void setDefaultRenderer(Class columnClass, TableCellRenderer rend)
+  public void setDefaultRenderer(Class<?> columnClass, TableCellRenderer rend)
   {
     defaultRenderersByColumnClass.put(columnClass, rend);
   }
 
-  public TableCellRenderer getDefaultRenderer(Class columnClass)
+  public TableCellRenderer getDefaultRenderer(Class<?> columnClass)
   {
     if (defaultRenderersByColumnClass.containsKey(columnClass))
       return (TableCellRenderer) 
defaultRenderersByColumnClass.get(columnClass);
@@ -2966,7 +2966,7 @@
     repaint();
   }
 
-  public Class getColumnClass(int column)
+  public Class<?> getColumnClass(int column)
   {
     return dataModel.getColumnClass(column);
   }
@@ -3007,7 +3007,7 @@
     return editorComp != null;
   }
 
-  public void setDefaultEditor(Class columnClass, TableCellEditor editor)
+  public void setDefaultEditor(Class<?> columnClass, TableCellEditor editor)
   {
     if (editor != null)
       defaultEditorsByColumnClass.put(columnClass, editor);
Index: javax/swing/JTree.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JTree.java,v
retrieving revision 1.8.2.12
diff -u -r1.8.2.12 JTree.java
--- javax/swing/JTree.java      2 Nov 2005 00:43:47 -0000       1.8.2.12
+++ javax/swing/JTree.java      26 Nov 2005 05:24:16 -0000
@@ -1455,7 +1455,7 @@
    * 
    * @param value the initial nodes in the tree
    */
-  public JTree(Hashtable value)
+  public JTree(Hashtable<?, ?> value)
   {
     this(createTreeModel(value));
   }
@@ -1511,7 +1511,7 @@
    * 
    * @param value the initial nodes in the tree
    */
-  public JTree(Vector value)
+  public JTree(Vector<?> value)
   {
     this(createTreeModel(value));
   }
@@ -2606,7 +2606,7 @@
     nodeStates.clear();
   }
 
-  protected Enumeration getDescendantToggledPaths(TreePath parent)
+  protected Enumeration<TreePath> getDescendantToggledPaths(TreePath parent)
   {
     if (parent == null)
       return null;
@@ -2755,7 +2755,7 @@
    *
    * @return An Enumeration containing TreePath objects
    */
-  public Enumeration getExpandedDescendants(TreePath path)
+  public Enumeration<TreePath> getExpandedDescendants(TreePath path)
   {
     Enumeration paths = nodeStates.keys();
     Vector relevantPaths = new Vector();
@@ -2883,7 +2883,7 @@
    * @param toRemove - Enumeration of TreePaths that need to be removed from
    * cache of toggled tree paths.
    */
-  protected void removeDescendantToggledPaths(Enumeration toRemove)
+  protected void removeDescendantToggledPaths(Enumeration<TreePath> toRemove)
   {
     while (toRemove.hasMoreElements())
       {
Index: javax/swing/LookAndFeel.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/LookAndFeel.java,v
retrieving revision 1.7.2.4
diff -u -r1.7.2.4 LookAndFeel.java
--- javax/swing/LookAndFeel.java        2 Nov 2005 00:43:48 -0000       1.7.2.4
+++ javax/swing/LookAndFeel.java        26 Nov 2005 05:24:16 -0000
@@ -232,7 +232,7 @@
    * Utility method that creates a UIDefaults.LazyValue that creates an
    * ImageIcon UIResource for the specified gifFile filename. 
    */
-  public static Object makeIcon(Class baseClass, String gifFile)
+  public static Object makeIcon(Class<?> baseClass, String gifFile)
   {
     final URL file = baseClass.getResource(gifFile);
     return new UIDefaults.LazyValue() 
Index: javax/swing/SortingFocusTraversalPolicy.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/swing/SortingFocusTraversalPolicy.java,v
retrieving revision 1.1.2.5
diff -u -r1.1.2.5 SortingFocusTraversalPolicy.java
--- javax/swing/SortingFocusTraversalPolicy.java        2 Nov 2005 00:43:48 
-0000       1.1.2.5
+++ javax/swing/SortingFocusTraversalPolicy.java        26 Nov 2005 05:24:16 
-0000
@@ -91,7 +91,7 @@
    *
    * @param comparator the comparator to set
    */
-  public SortingFocusTraversalPolicy(Comparator comparator)
+  public SortingFocusTraversalPolicy(Comparator<? super Component> comparator)
   {
     this.comparator = comparator;
   }
@@ -119,7 +119,7 @@
    * 
    * @see #setComparator
    */
-  protected Comparator getComparator()
+  protected Comparator<? super Component> getComparator()
   {
     return comparator;
   }
@@ -131,7 +131,7 @@
    * 
    * @see #getComparator
    */
-  protected void setComparator(Comparator comparator)
+  protected void setComparator(Comparator<? super Component> comparator)
   {
     this.comparator = comparator;
   }
Index: javax/swing/SpinnerListModel.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/SpinnerListModel.java,v
retrieving revision 1.2.2.4
diff -u -r1.2.2.4 SpinnerListModel.java
--- javax/swing/SpinnerListModel.java   20 Sep 2005 18:46:32 -0000      1.2.2.4
+++ javax/swing/SpinnerListModel.java   26 Nov 2005 05:24:16 -0000
@@ -118,7 +118,7 @@
    * @see SpinnerListModel#getNextValue()
    * @see SpinnerListModel#getValue()
    */ 
-  public SpinnerListModel(List list)
+  public SpinnerListModel(List<?> list)
   {
     // Retain a reference to the valid list.
     setList(list);
@@ -163,7 +163,7 @@
    *
    * @return The backing list.
    */
-  public List getList()
+  public List<?> getList()
   {
     return list;
   }
@@ -239,7 +239,7 @@
    *
    * @see ChangeEvent
    */
-  public void setList(List list)
+  public void setList(List<?> list)
   {
     // Check for null or zero size list.
     if (list == null || list.size() == 0)
Index: javax/swing/SwingUtilities.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/SwingUtilities.java,v
retrieving revision 1.15.2.14
diff -u -r1.15.2.14 SwingUtilities.java
--- javax/swing/SwingUtilities.java     2 Nov 2005 00:43:48 -0000       
1.15.2.14
+++ javax/swing/SwingUtilities.java     26 Nov 2005 05:24:16 -0000
@@ -344,7 +344,7 @@
    * @see #getAncestorOfClass
    * @see #windowForComponent
    */
-  public static Container getAncestorOfClass(Class c, Component comp)
+  public static Container getAncestorOfClass(Class<?> c, Component comp)
   {
     while (comp != null && (! c.isInstance(comp)))
       comp = comp.getParent();
Index: javax/swing/UIDefaults.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/UIDefaults.java,v
retrieving revision 1.12.2.6
diff -u -r1.12.2.6 UIDefaults.java
--- javax/swing/UIDefaults.java 2 Nov 2005 00:43:49 -0000       1.12.2.6
+++ javax/swing/UIDefaults.java 26 Nov 2005 05:24:17 -0000
@@ -62,7 +62,7 @@
  *
  * @author Ronald Veldema (address@hidden)
  */
-public class UIDefaults extends Hashtable
+public class UIDefaults extends Hashtable<Object, Object>
 {
 
   /** Our ResourceBundles. */
@@ -667,7 +667,7 @@
    *
    * @return the UI class for <code>id</code>
    */
-  public Class getUIClass(String id, ClassLoader loader)
+  public Class<? extends ComponentUI> getUIClass(String id, ClassLoader loader)
   {
     String className = (String) get (id);
     if (className == null)
@@ -676,7 +676,7 @@
       {
         if (loader == null)
           loader = ClassLoader.getSystemClassLoader();
-        return loader.loadClass (className);
+        return (Class<? extends ComponentUI>) loader.loadClass (className);
       }
     catch (Exception e)
       {
@@ -693,7 +693,7 @@
    *
    * @return the UI class for <code>id</code>
    */
-  public Class getUIClass(String id)
+  public Class<? extends ComponentUI> getUIClass(String id)
   {
     return getUIClass (id, null);
   }
Index: javax/swing/event/EventListenerList.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/swing/event/EventListenerList.java,v
retrieving revision 1.9.2.4
diff -u -r1.9.2.4 EventListenerList.java
--- javax/swing/event/EventListenerList.java    2 Nov 2005 00:43:50 -0000       
1.9.2.4
+++ javax/swing/event/EventListenerList.java    26 Nov 2005 05:24:17 -0000
@@ -175,7 +175,7 @@
    * <code>t</code>. Thus, subclasses of <code>t</code> will not be
    * counted.
    */
-  public int getListenerCount(Class t)
+  public int getListenerCount(Class<?> t)
   {
     int result = 0;
     for (int i = 0; i < listenerList.length; i += 2)
Index: javax/swing/plaf/basic/BasicDirectoryModel.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicDirectoryModel.java,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 BasicDirectoryModel.java
--- javax/swing/plaf/basic/BasicDirectoryModel.java     2 Aug 2005 20:12:37 
-0000       1.1.2.2
+++ javax/swing/plaf/basic/BasicDirectoryModel.java     26 Nov 2005 05:24:17 
-0000
@@ -118,7 +118,7 @@
    *
    * @return DOCUMENT ME!
    */
-  public Vector getDirectories()
+  public Vector<File> getDirectories()
   {
     Vector tmp = new Vector();
     for (int i = 0; i < directories; i++)
@@ -148,7 +148,7 @@
    *
    * @return DOCUMENT ME!
    */
-  public Vector getFiles()
+  public Vector<File> getFiles()
   {
     Vector tmp = new Vector();
     for (int i = directories; i < getSize(); i++)
@@ -270,7 +270,7 @@
    *
    * @param v DOCUMENT ME!
    */
-  protected void sort(Vector v)
+  protected void sort(Vector<? extends File> v)
   {
     Collections.sort(v, comparator);
     Enumeration e = Collections.enumeration(v);
Index: javax/swing/plaf/basic/BasicFileChooserUI.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicFileChooserUI.java,v
retrieving revision 1.2.2.6
diff -u -r1.2.2.6 BasicFileChooserUI.java
--- javax/swing/plaf/basic/BasicFileChooserUI.java      2 Nov 2005 00:43:53 
-0000       1.2.2.6
+++ javax/swing/plaf/basic/BasicFileChooserUI.java      26 Nov 2005 05:24:17 
-0000
@@ -179,7 +179,7 @@
   protected class BasicFileView extends FileView
   {
     /** Storage for cached icons. */
-    protected Hashtable iconCache = new Hashtable();
+    protected Hashtable<File, Icon> iconCache = new Hashtable<File, Icon>();
 
     /**
      * Creates a new instance.
Index: javax/swing/plaf/basic/BasicTreeUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicTreeUI.java,v
retrieving revision 1.6.2.9
diff -u -r1.6.2.9 BasicTreeUI.java
--- javax/swing/plaf/basic/BasicTreeUI.java     2 Nov 2005 00:43:59 -0000       
1.6.2.9
+++ javax/swing/plaf/basic/BasicTreeUI.java     26 Nov 2005 05:24:18 -0000
@@ -184,7 +184,7 @@
   protected AbstractLayoutCache treeState;
 
   /** Used for minimizing the drawing of vertical lines. */
-  protected Hashtable drawingCache;
+  protected Hashtable<TreePath, Boolean> drawingCache;
 
   /**
    * True if doing optimizations for a largeModel. Subclasses that don't 
support
Index: javax/swing/table/DefaultTableColumnModel.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/swing/table/DefaultTableColumnModel.java,v
retrieving revision 1.6.2.5
diff -u -r1.6.2.5 DefaultTableColumnModel.java
--- javax/swing/table/DefaultTableColumnModel.java      6 Oct 2005 00:32:39 
-0000       1.6.2.5
+++ javax/swing/table/DefaultTableColumnModel.java      26 Nov 2005 05:24:18 
-0000
@@ -68,7 +68,7 @@
   /**
    * Columns that this model keeps track of.
    */
-  protected Vector tableColumns;
+  protected Vector<TableColumn> tableColumns;
 
   /**
    * Selection Model that keeps track of columns selection
@@ -156,7 +156,7 @@
       throw new IllegalArgumentException("Index 'i' out of range.");
     if (j < 0 || j >= columnCount)
       throw new IllegalArgumentException("Index 'j' out of range.");
-    Object column = tableColumns.remove(i);
+    TableColumn column = tableColumns.remove(i);
     tableColumns.add(j, column);
     fireColumnAdded(new TableColumnModelEvent(this, i, j));
   }
@@ -184,7 +184,7 @@
    * getColumns
    * @return Enumeration
    */
-  public Enumeration getColumns()
+  public Enumeration<TableColumn> getColumns()
   {
     return tableColumns.elements();
   }
Index: javax/swing/table/TableModel.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/table/TableModel.java,v
retrieving revision 1.5.2.2
diff -u -r1.5.2.2 TableModel.java
--- javax/swing/table/TableModel.java   2 Aug 2005 20:12:38 -0000       1.5.2.2
+++ javax/swing/table/TableModel.java   26 Nov 2005 05:24:18 -0000
@@ -84,7 +84,7 @@
    * 
    * @return The class.
    */
-  Class getColumnClass(int columnIndex);
+  Class<?> getColumnClass(int columnIndex);
 
   /**
    * Returns <code>true</code> if the cell is editable, and <code>false</code>
Index: javax/swing/text/AbstractDocument.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/text/AbstractDocument.java,v
retrieving revision 1.9.2.11
diff -u -r1.9.2.11 AbstractDocument.java
--- javax/swing/text/AbstractDocument.java      2 Nov 2005 00:44:02 -0000       
1.9.2.11
+++ javax/swing/text/AbstractDocument.java      26 Nov 2005 05:24:19 -0000
@@ -376,7 +376,7 @@
    *
    * @return the properties of this <code>Document</code>
    */
-  public Dictionary getDocumentProperties()
+  public Dictionary<Object, Object> getDocumentProperties()
   {
     // FIXME: make me thread-safe
     if (properties == null)
@@ -849,7 +849,7 @@
    *
    * @param p the document properties to set
    */
-  public void setDocumentProperties(Dictionary p)
+  public void setDocumentProperties(Dictionary<Object, Object> p)
   {
     // FIXME: make me thread-safe
     properties = p;
@@ -1023,7 +1023,7 @@
      * @return the attributes of <code>old</code> minus the attributes in
      *         <code>attributes</code>
      */
-    AttributeSet removeAttributes(AttributeSet old, Enumeration names);
+    AttributeSet removeAttributes(AttributeSet old, Enumeration<?> names);
   }
 
   /**
Index: javax/swing/text/AttributeSet.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/text/AttributeSet.java,v
retrieving revision 1.5.2.5
diff -u -r1.5.2.5 AttributeSet.java
--- javax/swing/text/AttributeSet.java  2 Nov 2005 00:44:02 -0000       1.5.2.5
+++ javax/swing/text/AttributeSet.java  26 Nov 2005 05:24:19 -0000
@@ -158,7 +158,7 @@
    * @return the names of the attributes that are stored in this
    *         <code>AttributeSet</code>
    */
-  Enumeration getAttributeNames();
+  Enumeration<?> getAttributeNames();
 
   /**
    * Returns the resolving parent of this <code>AttributeSet</code>.
Index: javax/swing/text/DefaultFormatter.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/text/DefaultFormatter.java,v
retrieving revision 1.3.2.3
diff -u -r1.3.2.3 DefaultFormatter.java
--- javax/swing/text/DefaultFormatter.java      2 Nov 2005 00:44:02 -0000       
1.3.2.3
+++ javax/swing/text/DefaultFormatter.java      26 Nov 2005 05:24:19 -0000
@@ -331,7 +331,7 @@
    *
    * @return the class that is used for values
    */
-  public Class getValueClass()
+  public Class<?> getValueClass()
   {
     return valueClass;
   }
@@ -343,7 +343,7 @@
    *
    * @see #getValueClass()
    */
-  public void setValueClass(Class valueClass)
+  public void setValueClass(Class<?> valueClass)
   {
     this.valueClass = valueClass;
   }
Index: javax/swing/text/MutableAttributeSet.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/swing/text/MutableAttributeSet.java,v
retrieving revision 1.4.2.1
diff -u -r1.4.2.1 MutableAttributeSet.java
--- javax/swing/text/MutableAttributeSet.java   2 Aug 2005 20:12:38 -0000       
1.4.2.1
+++ javax/swing/text/MutableAttributeSet.java   26 Nov 2005 05:24:19 -0000
@@ -69,7 +69,7 @@
    * removeAttributes
    * @param names TODO
    */
-  void removeAttributes(Enumeration names);
+  void removeAttributes(Enumeration<?> names);
 
   /**
    * removeAttributes
Index: javax/swing/text/StyleContext.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/text/StyleContext.java,v
retrieving revision 1.2.2.7
diff -u -r1.2.2.7 StyleContext.java
--- javax/swing/text/StyleContext.java  2 Nov 2005 00:44:03 -0000       1.2.2.7
+++ javax/swing/text/StyleContext.java  26 Nov 2005 05:24:19 -0000
@@ -479,7 +479,7 @@
    * Get the names of the style. The returned enumeration always
    * contains at least one member, the default style.
    */
-  public Enumeration getStyleNames()
+  public Enumeration<?> getStyleNames()
   {
     return styleTable.keys();
   }
Index: javax/swing/text/html/parser/AttributeList.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/swing/text/html/parser/AttributeList.java,v
retrieving revision 1.1.2.4
diff -u -r1.1.2.4 AttributeList.java
--- javax/swing/text/html/parser/AttributeList.java     2 Aug 2005 20:12:38 
-0000       1.1.2.4
+++ javax/swing/text/html/parser/AttributeList.java     26 Nov 2005 05:24:19 
-0000
@@ -122,7 +122,7 @@
    * null, if this parameter was not specified.
    * Values, defined in DTD, are case insensitive.
    */
-  public Vector values;
+  public Vector<?> values;
 
   /**
    * The modifier of this attribute. This field contains one of the
@@ -176,7 +176,7 @@
    * Equals to null for the last attribute definition.
    */
   public AttributeList(String a_name, int a_type, int a_modifier,
-                       String a_default, Vector allowed_values,
+                       String a_default, Vector<?> allowed_values,
                        AttributeList a_next
                       )
   {
@@ -251,7 +251,7 @@
   /**
    * Get the allowed values of this attribute.
    */
-  public Enumeration getValues()
+  public Enumeration<?> getValues()
   {
     return values.elements();
   }
Index: javax/swing/text/html/parser/ContentModel.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/swing/text/html/parser/ContentModel.java,v
retrieving revision 1.1.2.4
diff -u -r1.1.2.4 ContentModel.java
--- javax/swing/text/html/parser/ContentModel.java      2 Nov 2005 00:44:05 
-0000       1.1.2.4
+++ javax/swing/text/html/parser/ContentModel.java      26 Nov 2005 05:24:19 
-0000
@@ -151,13 +151,15 @@
    * discarded.
    * @param elements - a vector to add the values to.
    */
-  public void getElements(Vector elements)
+  public void getElements(Vector<Element> elements)
   {
     ContentModel c = this;
 
     while (c != null)
       {
-        elements.add(c.content);
+        // FIXME: correct?
+        if (c.content instanceof Element)
+          elements.add((Element) c.content);
         c = c.next;
       }
   }
Index: javax/swing/text/html/parser/DTD.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/text/html/parser/DTD.java,v
retrieving revision 1.1.2.6
diff -u -r1.1.2.6 DTD.java
--- javax/swing/text/html/parser/DTD.java       2 Nov 2005 00:44:05 -0000       
1.1.2.6
+++ javax/swing/text/html/parser/DTD.java       26 Nov 2005 05:24:19 -0000
@@ -154,7 +154,7 @@
   /**
    * The entity table for accessing all DTD entities by name.
    */
-  public Hashtable<String,Entity> entityHash = new Hashtable<String,Entity>();
+  public Hashtable<Object, Entity> entityHash = new Hashtable<Object, 
Entity>();
 
   /**
    *  The name of this DTD.
Index: javax/swing/tree/AbstractLayoutCache.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/swing/tree/AbstractLayoutCache.java,v
retrieving revision 1.2.2.3
diff -u -r1.2.2.3 AbstractLayoutCache.java
--- javax/swing/tree/AbstractLayoutCache.java   2 Aug 2005 20:12:39 -0000       
1.2.2.3
+++ javax/swing/tree/AbstractLayoutCache.java   26 Nov 2005 05:24:20 -0000
@@ -309,7 +309,7 @@
         * 
         * @return Enumeration
         */
-       public abstract Enumeration getVisiblePathsFrom(TreePath path);
+       public abstract Enumeration<TreePath> getVisiblePathsFrom(TreePath 
path);
 
        /**
         * getVisibleChildCount
Index: javax/swing/tree/DefaultMutableTreeNode.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/swing/tree/DefaultMutableTreeNode.java,v
retrieving revision 1.5.2.6
diff -u -r1.5.2.6 DefaultMutableTreeNode.java
--- javax/swing/tree/DefaultMutableTreeNode.java        2 Nov 2005 00:44:05 
-0000       1.5.2.6
+++ javax/swing/tree/DefaultMutableTreeNode.java        26 Nov 2005 05:24:20 
-0000
@@ -66,7 +66,7 @@
   /**
    * EMPTY_ENUMERATION
    */
-  public static final Enumeration EMPTY_ENUMERATION =
+  public static final Enumeration<TreeNode> EMPTY_ENUMERATION =
     EmptyEnumeration.getInstance();
 
   /**
Index: javax/swing/undo/StateEditable.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/undo/StateEditable.java,v
retrieving revision 1.6.2.1
diff -u -r1.6.2.1 StateEditable.java
--- javax/swing/undo/StateEditable.java 2 Aug 2005 20:12:39 -0000       1.6.2.1
+++ javax/swing/undo/StateEditable.java 26 Nov 2005 05:24:20 -0000
@@ -98,7 +98,7 @@
    * @param state a hash table containing the relevant state
    * information.
    */
-  void restoreState(Hashtable state);
+  void restoreState(Hashtable<?, ?> state);
 
 
   /**
@@ -108,5 +108,5 @@
    * @param state a hash table for storing relevant state
    * information.
    */
-  void storeState(Hashtable state);
+  void storeState(Hashtable<Object, Object> state);
 }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]