8037743: 2d nightly: wrong class cast to DigraphNode
authorhenryjen
Wed, 19 Mar 2014 09:00:50 -0700
changeset 23677 a14db4279874
parent 23676 f985a8f16d58
child 23678 fc986e021627
8037743: 2d nightly: wrong class cast to DigraphNode Reviewed-by: prr, serb
jdk/src/share/classes/javax/imageio/spi/DigraphNode.java
--- a/jdk/src/share/classes/javax/imageio/spi/DigraphNode.java	Wed Mar 19 18:27:31 2014 +0400
+++ b/jdk/src/share/classes/javax/imageio/spi/DigraphNode.java	Wed Mar 19 09:00:50 2014 -0700
@@ -132,17 +132,17 @@
      * appropriately.
      */
     public void dispose() {
-        @SuppressWarnings("unchecked")
-        DigraphNode<E>[] inNodesArray = (DigraphNode<E>[])inNodes.toArray();
+        Object[] inNodesArray = inNodes.toArray();
         for(int i=0; i<inNodesArray.length; i++) {
-            DigraphNode<E> node = inNodesArray[i];
+            @SuppressWarnings("unchecked")
+            DigraphNode<E> node = (DigraphNode<E>)inNodesArray[i];
             node.removeEdge(this);
         }
 
-        @SuppressWarnings("unchecked")
-        DigraphNode<E>[] outNodesArray = (DigraphNode<E>[])outNodes.toArray();
+        Object[] outNodesArray = outNodes.toArray();
         for(int i=0; i<outNodesArray.length; i++) {
-            DigraphNode<E> node = outNodesArray[i];
+            @SuppressWarnings("unchecked")
+            DigraphNode<E> node = (DigraphNode<E>)outNodesArray[i];
             removeEdge(node);
         }
     }