diff options
Diffstat (limited to 'libjava/classpath/javax/swing/text/SimpleAttributeSet.java')
-rw-r--r-- | libjava/classpath/javax/swing/text/SimpleAttributeSet.java | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/libjava/classpath/javax/swing/text/SimpleAttributeSet.java b/libjava/classpath/javax/swing/text/SimpleAttributeSet.java index 8684ef87d34..701fa8a7c90 100644 --- a/libjava/classpath/javax/swing/text/SimpleAttributeSet.java +++ b/libjava/classpath/javax/swing/text/SimpleAttributeSet.java @@ -123,9 +123,17 @@ public class SimpleAttributeSet */ public Object clone() { - SimpleAttributeSet s = new SimpleAttributeSet(); - s.tab = (Hashtable) tab.clone(); - return s; + SimpleAttributeSet attr = null; + try + { + attr = (SimpleAttributeSet) super.clone(); + attr.tab = (Hashtable) tab.clone(); + } + catch (CloneNotSupportedException ex) + { + assert false; + } + return attr; } /** @@ -253,7 +261,7 @@ public class SimpleAttributeSet * * @return An enumeration of the attribute names. */ - public Enumeration getAttributeNames() + public Enumeration<?> getAttributeNames() { return tab.keys(); } @@ -367,7 +375,7 @@ public class SimpleAttributeSet * @throws NullPointerException if <code>names</code> is <code>null</code> * or contains any <code>null</code> values. */ - public void removeAttributes(Enumeration names) + public void removeAttributes(Enumeration<?> names) { while (names.hasMoreElements()) { |