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

RescaleOp.filter does not document IllegalArgumentException if sizes differ.

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 10
    • Component/s: client-libs
    • Labels:
      None
    • Subcomponent:
      2d
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      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.
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: