<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">+1<br>
      <br>
      -phil.<br>
      <br>
      On 02/09/2016 11:35 AM, Brian Burkhalter wrote:<br>
    </div>
    <blockquote
      cite="mid:98A4B331-7BC1-442A-AD1B-2CFA1F38D8C3@oracle.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      Please review at your convenience.
      <div><br>
      </div>
      <div>Issue:<span class="Apple-tab-span" style="white-space:pre"> </span><a
          moz-do-not-send="true"
          href="https://bugs.openjdk.java.net/browse/JDK-8149120">https://bugs.openjdk.java.net/browse/JDK-8149120</a></div>
      <div>Patch:<span class="Apple-tab-span" style="white-space:pre"> </span>see
        below</div>
      <div><br>
      </div>
      <div>Summary: Clean up parameter checking for
        TIFFField(TIFFTag,int,int,Object).</div>
      <div><br>
      </div>
      <div>Thanks,</div>
      <div><br>
      </div>
      <div>Brian</div>
      <div><br>
      </div>
      <div>
        <div style="margin: 0px;"><font face="Courier">---
a/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFField.java</font></div>
        <div style="margin: 0px;"><font face="Courier">+++
b/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFField.java</font></div>
        <div style="margin: 0px;"><font face="Courier">@@ -519,6 +519,11
            @@</font></div>
        <div style="margin: 0px;"><font face="Courier">      * @throws
            IllegalArgumentException if <code>type</code> is
            an unacceptable</font></div>
        <div style="margin: 0px;"><font face="Courier">      * data type
            for the supplied <code>TIFFTag</code>.</font></div>
        <div style="margin: 0px;"><font face="Courier">      * @throws
            IllegalArgumentException if
            <code>count&nbsp;&lt;&nbsp;0</code>.</font></div>
        <div style="margin: 0px;"><font face="Courier"><b>+     *
              @throws IllegalArgumentException if
              <code>count&nbsp;&lt;&nbsp;1</code></b></font></div>
        <div style="margin: 0px;"><font face="Courier"><b>+     * and
              <code>type</code> is
              <code>TIFF_RATIONAL</code> or</b></font></div>
        <div style="margin: 0px;"><font face="Courier"><b>+     *
              <code>TIFF_SRATIONAL</code>.</b></font></div>
        <div style="margin: 0px;"><font face="Courier"><b>+     *
              @throws IllegalArgumentException if
              <code>count&nbsp;&ne;&nbsp;1</code></b></font></div>
        <div style="margin: 0px;"><font face="Courier"><b>+     * and
              <code>type</code> is
              <code>TIFF_IFD_POINTER</code>.</b></font></div>
        <div style="margin: 0px;"><font face="Courier">      * @throws
            NullPointerException if
            <code>data&nbsp;==&nbsp;null</code>.</font></div>
        <div style="margin: 0px;"><font face="Courier">      * @throws
            IllegalArgumentException if <code>data</code> is
            an instance of</font></div>
        <div style="margin: 0px;"><font face="Courier">      * a class
            incompatible with the specified type.</font></div>
        <div style="margin: 0px;"><font face="Courier">@@ -534,6 +539,14
            @@</font></div>
        <div style="margin: 0px;"><font face="Courier">                
            + " for " + tag.getName() + " tag");</font></div>
        <div style="margin: 0px;"><font face="Courier">         } else
            if(count < 0) {</font></div>
        <div style="margin: 0px;"><font face="Courier">            
            throw new IllegalArgumentException("count < 0!");</font></div>
        <div style="margin: 0px;"><font face="Courier"><b>+        }
              else if((type == TIFFTag.TIFF_RATIONAL</b></font></div>
        <div style="margin: 0px;"><font face="Courier"><b>+            
                    || type == TIFFTag.TIFF_SRATIONAL)</b></font></div>
        <div style="margin: 0px;"><font face="Courier"><b>+             
                  && count < 1) {</b></font></div>
        <div style="margin: 0px;"><font face="Courier"><b>+           
              throw new IllegalArgumentException</b></font></div>
        <div style="margin: 0px;"><font face="Courier"><b>+             
                ("Type is TIFF_RATIONAL or TIFF_SRATIONAL and count <
              1");</b></font></div>
        <div style="margin: 0px;"><font face="Courier"><b>+        }
              else if (type == TIFFTag.TIFF_IFD_POINTER && count
              != 1) {</b></font></div>
        <div style="margin: 0px;"><font face="Courier"><b>+           
              throw new IllegalArgumentException</b></font></div>
        <div style="margin: 0px;"><font face="Courier"><b>+             
                ("Type is TIFF_IFD_POINTER count != 1");</b></font></div>
        <div style="margin: 0px;"><font face="Courier">         } else
            if(data == null) {</font></div>
        <div style="margin: 0px;"><font face="Courier">            
            throw new NullPointerException("data == null!");</font></div>
        <div style="margin: 0px;"><font face="Courier">         }</font></div>
      </div>
      <div><br>
      </div>
    </blockquote>
    <br>
  </body>
</html>