src/share/classes/javax/swing/text/StyleContext.java

Print this page

        

@@ -587,11 +587,11 @@
      */
     public static void writeAttributeSet(ObjectOutputStream out,
                                          AttributeSet a) throws IOException {
         int n = a.getAttributeCount();
         out.writeInt(n);
-        Enumeration keys = a.getAttributeNames();
+        Enumeration<?> keys = a.getAttributeNames();
         while (keys.hasMoreElements()) {
             Object key = keys.nextElement();
             if (key instanceof Serializable) {
                 out.writeObject(key);
             } else {

@@ -769,11 +769,11 @@
         }
 
         public SmallAttributeSet(AttributeSet attrs) {
             int n = attrs.getAttributeCount();
             Object[] tbl = new Object[2 * n];
-            Enumeration names = attrs.getAttributeNames();
+            Enumeration<?> names = attrs.getAttributeNames();
             int i = 0;
             while (names.hasMoreElements()) {
                 tbl[i] = names.nextElement();
                 tbl[i+1] = attrs.getAttribute(tbl[i]);
                 i += 2;

@@ -969,11 +969,11 @@
          * @see AttributeSet#containsAttributes
          */
         public boolean containsAttributes(AttributeSet attrs) {
             boolean result = true;
 
-            Enumeration names = attrs.getAttributeNames();
+            Enumeration<?> names = attrs.getAttributeNames();
             while (result && names.hasMoreElements()) {
                 Object name = names.nextElement();
                 result = attrs.getAttribute(name).equals(getAttribute(name));
             }
 

@@ -1049,11 +1049,11 @@
             if (a instanceof SmallAttributeSet) {
                 initialize(((SmallAttributeSet)a).attributes);
             } else {
                 keys.removeAllElements();
                 data.removeAllElements();
-                Enumeration names = a.getAttributeNames();
+                Enumeration<?> names = a.getAttributeNames();
                 while (names.hasMoreElements()) {
                     Object name = names.nextElement();
                     addAttribute(name, a.getAttribute(name));
                 }
             }

@@ -1115,11 +1115,11 @@
                 int n = tbl.length;
                 for (int i = 0; i < n; i += 2) {
                     addAttribute(tbl[i], tbl[i+1]);
                 }
             } else {
-                Enumeration names = attr.getAttributeNames();
+                Enumeration<?> names = attr.getAttributeNames();
                 while (names.hasMoreElements()) {
                     Object name = names.nextElement();
                     addAttribute(name, attr.getAttribute(name));
                 }
             }

@@ -1140,22 +1140,22 @@
         }
 
         /**
          * Removes the set of keys from the set.
          */
-        public void removeAttributes(Enumeration names) {
+        public void removeAttributes(Enumeration<?> names) {
             while (names.hasMoreElements()) {
                 Object name = names.nextElement();
                 removeAttribute(name);
             }
         }
 
         /**
          * Removes the set of matching attributes from the set.
          */
         public void removeAttributes(AttributeSet attr) {
-            Enumeration names = attr.getAttributeNames();
+            Enumeration<?> names = attr.getAttributeNames();
             while (names.hasMoreElements()) {
                 Object name = names.nextElement();
                 Object value = attr.getAttribute(name);
                 removeSearchAttribute(name, value);
             }