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

RescaleOp.filter does not document IllegalArgumentException if sizes differ.

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 10
    • client-libs
    • None
    • 2d
    • behavioral
    • minimal
    • Java API
    • SE

      Summary

      java.awt.image.RescaleOp.filter(..) has never documented that it throws IllegalArgumentException for different sized images or rasters even though it always has done so.

      Problem

      This should be specified.

      Solution

      Document the long standing exception

      Specification

      public final BufferedImage java.awt.image.RescaleOp.filter(BufferedImage src, BufferedImage dst)
      
            * @throws IllegalArgumentException if the {@code ColorModel}
            *         of {@code src} is an {@code IndexColorModel},
            *         or if the number of scaling factors and offsets in this
            *         {@code RescaleOp} do not meet the requirements
      -     *         stated in the class comments.
      +     *         stated in the class comments, or if the source and
      +     *         destination images differ in size.
      
      --
      public final WritableRaster java.awt.image.RescaleOp.filter(Raster src, WritableRaster dst)
      
            * @throws IllegalArgumentException if {@code src} and
            *         {@code dst} do not have the same number of bands,
            *         or if the number of scaling factors and offsets in this
            *         {@code RescaleOp} do not meet the requirements
      -     *         stated in the class comments.
      +     *         stated in the class comments, or if the source and
      +     *         destination rasters differ in size.
      

            prr Philip Race
            prr Philip Race
            Brian Burkhalter, Philip Race
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: