Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8369849

BandedSampleModel.createCompatibleSampleModel() API docs are wrong

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Unresolved
    • Icon: P4 P4
    • 26
    • client-libs
    • None
    • 2d
    • minimal
    • Doc change, no implementation.
    • Java API
    • SE

      Summary

      Update the specification of BandedSampleModel to correctly document exceptions.

      Problem

      The java doc for java.awt.image.BandedSampleModel mistates some error conditions.

      Solution

      Correct the documentation. No change to the implementation.

      Specification

      public class java.awt.image.BandedSampleModel
      
      -     * @throws IllegalArgumentException if {@code w} or
      -     *         {@code h} equals either
      -     *         {@code Integer.MAX_VALUE} or
      -     *         {@code Integer.MIN_VALUE}
      -     * @throws IllegalArgumentException if {@code dataType} is not
      -     *         one of the supported data types
      +     * @throws IllegalArgumentException if the product of {@code w}
      +     *         and {@code h} is greater than {@code Integer.MAX_VALUE}
      +     *         or {@code w} or {@code h} is not greater than 0.
            */
           public SampleModel createCompatibleSampleModel(int w, int h);
      
      -     * @throws IllegalArgumentException if {@code dataType} is not
      -     *         one of the supported data types
      +     * @throws IllegalArgumentException if the number of bands is not greater than 0
      +     * @throws ArrayIndexOutOfBoundsException if any of the bank indices is out of bounds
            */
           public SampleModel createSubsetSampleModel(int[] bands) 
      
      

            prr Philip Race
            igor Igor Nekrestyanov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: