Whilst there is no harm in the cause of the IAE being NPE, unless it
is precisely called out in the spec - which it is not - all it says is
"Note that a cause might be set on such an exception."
which is non-specific, I don't think the test should check for it.
-phil.
On 8/23/2016 11:17 AM, Brian Burkhalter wrote:
Here is a revision based on the CCC request discussion:
http://cr.openjdk.java.net/~bpb/8149562/webrev.01/
<http://cr.openjdk.java.net/%7Ebpb/8149562/webrev.01/>
It was necessary slightly to modify one test as well.
Thanks,
Brian
On Aug 17, 2016, at 10:39 AM, Phil Race <philip.r...@oracle.com
<mailto:philip.r...@oracle.com>> wrote:
+1
-phil.
On 08/16/2016 09:02 AM, Brian Burkhalter wrote:
Please review at your convenience.
Issue:https://bugs.openjdk.java.net/browse/JDK-8149562
Patch:[1]
Add one sentence to the TIFFField.createFromMetadataNode method
specification stating that the supplied Node parameter must adhere
to the TIFFField element structure defined by the TIFF native image
metadata DTD.
Thanks,
Brian
[1] diff
---
a/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFField.java
+++
b/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFField.java
/**
* Creates a {@code TIFFField} from a TIFF native image
* metadata node. If the value of the {@code “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.
+ * will be created and assigned to the field. If the {@code Node}
+ * parameter content does not adhere to the {@code TIFFField}
element
+ * structure defined by the
+ * <a
href="../../metadata/doc-files/tiff_metadata.html#ImageMetadata">
+ * TIFF native image metadata format specification</a>
+ * an {@code Exception} will be thrown.
*
* @param tagSet The {@code TIFFTagSet} to which the
* {@code TIFFTag} of the field belongs.
* @param node A native TIFF image metadata {@code TIFFField} node.
* @throws NullPointerException if {@code node} is
* {@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,
Node node) {