jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java
changeset 23312 4711f66e7d5c
parent 5506 202f599c92aa
equal deleted inserted replaced
23311:fd976b9703f1 23312:4711f66e7d5c
   256                     fatal(applicationExtension,
   256                     fatal(applicationExtension,
   257                           "Bad user object in ApplicationExtension!");
   257                           "Bad user object in ApplicationExtension!");
   258                 }
   258                 }
   259 
   259 
   260                 if (applicationIDs == null) {
   260                 if (applicationIDs == null) {
   261                     applicationIDs = new ArrayList();
   261                     applicationIDs = new ArrayList<>();
   262                     authenticationCodes = new ArrayList();
   262                     authenticationCodes = new ArrayList<>();
   263                     applicationData = new ArrayList();
   263                     applicationData = new ArrayList<>();
   264                 }
   264                 }
   265 
   265 
   266                 applicationIDs.add(fromISO8859(applicationIDString));
   266                 applicationIDs.add(fromISO8859(applicationIDString));
   267                 authenticationCodes.add(fromISO8859(authenticationCodeString));
   267                 authenticationCodes.add(fromISO8859(authenticationCodeString));
   268                 applicationData.add(applicationExtensionData);
   268                 applicationData.add((byte[]) applicationExtensionData);
   269             } else if (name.equals("CommentExtensions")) {
   269             } else if (name.equals("CommentExtensions")) {
   270                 Node commentExtension = node.getFirstChild();
   270                 Node commentExtension = node.getFirstChild();
   271                 if (commentExtension != null) {
   271                 if (commentExtension != null) {
   272                     while(commentExtension != null) {
   272                     while(commentExtension != null) {
   273                         if (!commentExtension.getNodeName().equals("CommentExtension")) {
   273                         if (!commentExtension.getNodeName().equals("CommentExtension")) {
   274                             fatal(node,
   274                             fatal(node,
   275                                   "Only a CommentExtension may be a child of a CommentExtensions!");
   275                                   "Only a CommentExtension may be a child of a CommentExtensions!");
   276                         }
   276                         }
   277 
   277 
   278                         if (comments == null) {
   278                         if (comments == null) {
   279                             comments = new ArrayList();
   279                             comments = new ArrayList<>();
   280                         }
   280                         }
   281 
   281 
   282                         String comment =
   282                         String comment =
   283                             getStringAttribute(commentExtension, "value", null,
   283                             getStringAttribute(commentExtension, "value", null,
   284                                                true, null);
   284                                                true, null);
   365                                                          "ISO-8859-1",
   365                                                          "ISO-8859-1",
   366                                                          false))) {
   366                                                          false))) {
   367                         String value = getAttribute(childNode, "value");
   367                         String value = getAttribute(childNode, "value");
   368                         byte[] comment = fromISO8859(value);
   368                         byte[] comment = fromISO8859(value);
   369                         if (comments == null) {
   369                         if (comments == null) {
   370                             comments = new ArrayList();
   370                             comments = new ArrayList<>();
   371                         }
   371                         }
   372                         comments.add(comment);
   372                         comments.add(comment);
   373                     }
   373                     }
   374                     childNode = childNode.getNextSibling();
   374                     childNode = childNode.getNextSibling();
   375                 }
   375                 }