[OpenJDK 2D-Dev] [9] RFR JDK-8169725: cannot use TIFFField(TIFFTag tag, int value) for TIFF_LONG values greater than Integer.MAX_VALUE

Jayathirth D V jayathirth.d.v at oracle.com
Wed Nov 16 06:12:12 UTC 2016


Hi Brian,

 

Present change of having long value as second argument is fine because we support usage of TIFFTag.TIFF_LONG data type in the constructor.

 

I was checking for call hierarchy of this particular constructor from within JDK9. Most of the calls to this constructor are using either short or int value for second argument.

 

In "public void addShortOrLongField(int tagNumber, int value)" of TIFFImageMetadata.java also we are calling this constructor. I think we should change addShortOrLongField() signature also to use long value for second argument, because we should support usage of TIFFTag.TIFF_LONG data type from addShortOrLongField().

 

Please let me know your inputs.

 

Thanks,

Jay

From: Brian Burkhalter 
Sent: Wednesday, November 16, 2016 3:00 AM
To: 2d-dev
Subject: [OpenJDK 2D-Dev] [9] RFR JDK-8169725: cannot use TIFFField(TIFFTag tag, int value) for TIFF_LONG values greater than Integer.MAX_VALUE

 

Please review at your convenience.

Issue:   https://bugs.openjdk.java.net/browse/JDK-8169725
Patch:  [1]

Change constructor TIFFField(TIFFTag,int) to TIFFField(TIFFTag,long). No documentation change is required.

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

@@ -672,7 +672,7 @@

      * for the supplied {@code TIFFTag}.

      * @throws IllegalArgumentException if {@code value < 0}.

      */

-    public TIFFField(TIFFTag tag, int value) {

+    public TIFFField(TIFFTag tag, long value) {

         if(tag == null) {

             throw new NullPointerException("tag == null!");

         }

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20161115/7547b01d/attachment.html>


More information about the 2d-dev mailing list