# HG changeset patch
# User bpb
# Date 1461951683 25200
# Fri Apr 29 10:41:23 2016 -0700
# Node ID e2ddbd163fad421c1ab189290e78b4390c4f651f
# Parent eea841d93980c2c0de562e4c350947d7b66081f9
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: XXX
diff --git a/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFField.java b/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFField.java
--- a/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFField.java
+++ b/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFField.java
@@ -412,7 +412,7 @@
/**
* Creates a {@code TIFFField} from a TIFF native image
- * metadata node. If the value of the "tagNumber" attribute
+ * metadata node. If the value of the "number" 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,