changeset 23677:a14db4279874

8037743: 2d nightly: wrong class cast to DigraphNode Reviewed-by: prr, serb
author henryjen
date Wed, 19 Mar 2014 09:00:50 -0700
parents f985a8f16d58
children fc986e021627
files jdk/src/share/classes/javax/imageio/spi/DigraphNode.java
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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);
         }
     }