src/share/classes/com/sun/imageio/plugins/gif/GIFImageMetadata.java

Print this page
rev 9230 : imported patch 8033716

@@ -82,21 +82,21 @@
     public int textBackgroundColor;
     public byte[] text;
 
     // Fields from ApplicationExtension
     // List of byte[]
-    public List applicationIDs = null; // new ArrayList();
+    public List<byte[]> applicationIDs = null; // new ArrayList();
 
     // List of byte[]
-    public List authenticationCodes = null; // new ArrayList();
+    public List<byte[]> authenticationCodes = null; // new ArrayList();
 
     // List of byte[]
-    public List applicationData = null; // new ArrayList();
+    public List<byte[]> applicationData = null; // new ArrayList();
 
     // Fields from CommentExtension
     // List of byte[]
-    public List comments = null; // new ArrayList();
+    public List<byte[]> comments = null; // new ArrayList();
 
     protected GIFImageMetadata(boolean standardMetadataFormatSupported,
                                String nativeMetadataFormatName,
                                String nativeMetadataFormatClassName,
                                String[] extraMetadataFormatNames,

@@ -223,17 +223,17 @@
         if (numAppExtensions > 0) {
             node = new IIOMetadataNode("ApplicationExtensions");
             for (int i = 0; i < numAppExtensions; i++) {
                 IIOMetadataNode appExtNode =
                     new IIOMetadataNode("ApplicationExtension");
-                byte[] applicationID = (byte[])applicationIDs.get(i);
+                byte[] applicationID = applicationIDs.get(i);
                 appExtNode.setAttribute("applicationID",
                                         toISO8859(applicationID));
-                byte[] authenticationCode = (byte[])authenticationCodes.get(i);
+                byte[] authenticationCode = authenticationCodes.get(i);
                 appExtNode.setAttribute("authenticationCode",
                                         toISO8859(authenticationCode));
-                byte[] appData = (byte[])applicationData.get(i);
+                byte[] appData = applicationData.get(i);
                 appExtNode.setUserObject(appData.clone());
                 node.appendChild(appExtNode);
             }
 
             root.appendChild(node);

@@ -244,11 +244,11 @@
         if (numComments > 0) {
             node = new IIOMetadataNode("CommentExtensions");
             for (int i = 0; i < numComments; i++) {
                 IIOMetadataNode commentNode =
                     new IIOMetadataNode("CommentExtension");
-                byte[] comment = (byte[])comments.get(i);
+                byte[] comment = comments.get(i);
                 commentNode.setAttribute("value", toISO8859(comment));
                 node.appendChild(commentNode);
             }
 
             root.appendChild(node);

@@ -372,20 +372,20 @@
 
     public IIOMetadataNode getStandardTextNode() {
         if (comments == null) {
             return null;
         }
-        Iterator commentIter = comments.iterator();
+        Iterator<byte[]> commentIter = comments.iterator();
         if (!commentIter.hasNext()) {
             return null;
         }
 
         IIOMetadataNode text_node = new IIOMetadataNode("Text");
         IIOMetadataNode node = null; // scratch node
 
         while (commentIter.hasNext()) {
-            byte[] comment = (byte[])commentIter.next();
+            byte[] comment = commentIter.next();
             String s = null;
             try {
                 s = new String(comment, "ISO-8859-1");
             } catch (UnsupportedEncodingException e) {
                 throw new RuntimeException("Encoding ISO-8859-1 unknown!");