8054371: Need to suppress newly added unchecked cast and conversion in Swing code
authorprr
Tue, 05 Aug 2014 14:18:46 -0700
changeset 26027 f42f02a8666d
parent 26026 8d7f6c44eff4
child 26028 2ee7c47e175a
8054371: Need to suppress newly added unchecked cast and conversion in Swing code Reviewed-by: jgodinez
jdk/src/share/classes/javax/swing/JLayer.java
jdk/src/share/classes/javax/swing/text/AbstractDocument.java
--- a/jdk/src/share/classes/javax/swing/JLayer.java	Tue Aug 05 12:14:11 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/JLayer.java	Tue Aug 05 14:18:46 2014 -0700
@@ -646,6 +646,7 @@
         return 1;
     }
 
+    @SuppressWarnings("unchecked")
     private void readObject(ObjectInputStream s)
             throws IOException, ClassNotFoundException {
         ObjectInputStream.GetField f = s.readFields();
@@ -656,7 +657,6 @@
         if (eventMask != 0) {
             eventController.updateAWTEventListener(0, eventMask);
         }
-        @SuppressWarnings("unchecked")
         LayerUI<V> newLayerUI = (LayerUI<V>) f.get("layerUI", null);
         if (newLayerUI != null) {
             setUI(newLayerUI);
--- a/jdk/src/share/classes/javax/swing/text/AbstractDocument.java	Tue Aug 05 12:14:11 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/text/AbstractDocument.java	Tue Aug 05 14:18:46 2014 -0700
@@ -1426,12 +1426,14 @@
 
     // --- serialization ---------------------------------------------
 
+    @SuppressWarnings("unchecked")
     private void readObject(ObjectInputStream s)
       throws ClassNotFoundException, IOException
     {
         ObjectInputStream.GetField f = s.readFields();
 
-        documentProperties = (Dictionary) f.get("documentProperties", null);
+        documentProperties =
+            (Dictionary<Object, Object>) f.get("documentProperties", null);
         listenerList = new EventListenerList();
         data = (Content) f.get("data", null);
         context = (AttributeContext) f.get("context", null);