changeset 14517:2181e47fdafb

8149560: TIFFField#createFromMetadataNode throws a NullPointerException when the node is set with "tagNumber" attribute Summary: In the specification of createFromMetadataNode() change "tagNumber" to "number" and add two throws clauses which match the behavior. Reviewed-by: prr
author bpb
date Tue, 03 May 2016 09:48:02 -0700
parents ab6c0eba9dd4
children bd2eb98cc819
files src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFField.java
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFField.java	Mon May 02 12:08:59 2016 +0300
+++ b/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFField.java	Tue May 03 09:48:02 2016 -0700
@@ -412,7 +412,7 @@
 
     /**
      * Creates a {@code TIFFField} from a TIFF native image
-     * metadata node. If the value of the <tt>"tagNumber"</tt> attribute
+     * metadata node. If the value of the <tt>"number"</tt> attribute
      * of the node is not found in {@code tagSet} then a new
      * {@code TIFFTag} with name {@code TIFFTag.UNKNOWN_TAG_NAME}
      * will be created and assigned to the field.
@@ -424,6 +424,10 @@
      * {@code null}.
      * @throws IllegalArgumentException if the name of the node is not
      * {@code "TIFFField"}.
+     * @throws NullPointerException if the node does not contain any data.
+     * @throws IllegalArgumentException if the combination of node attributes
+     * and data is not legal per the {@link #TIFFField(TIFFTag,int,int,Object)}
+     * constructor specification.
      * @return A new {@code TIFFField}.
      */
     public static TIFFField createFromMetadataNode(TIFFTagSet tagSet,