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

AreaAveragingScaleFilter(int, int): IAE is not specified

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 17
    • client-libs
    • None
    • 2d
    • behavioral
    • minimal
    • No behavior change - specification only so minimal risk
    • Java API
    • SE

      Summary

      Specify that java.awt.image.AreaAveragingScaleFilter(int, int) will throw IllegalArgumentException when passed 0 for width or height parameter.

      Problem

      Constructor AreaAveragingScaleFilter(int, int) of the java.awt.image.AreaAveragingScaleFilter class throws IllegalArgumentException when 0 is passed as value to width or height parameterbut it is not specified in the specification.

      Solution

      Update the specification to document that IllegalArgumentException will be thrown for 0 value passed to AreaAveragingScaleFilter(int width, int height).

      Specification

      src/java.desktop/share/classes/java/awt/image/AreaAveragingScaleFilter.java
      
           /**
            * Constructs an AreaAveragingScaleFilter that scales the pixels from
            * its source Image as specified by the width and height parameters.
            * @param width the target width to scale the image
            * @param height the target height to scale the image
      +     * @throws IllegalArgumentException if {@code width} equals
      +     *         zero or {@code height} equals zero
            */
           public AreaAveragingScaleFilter(int width, int height) {
               super(width, height);
           }

            psadhukhan Prasanta Sadhukhan
            ydanilev Yury Danilevich (Inactive)
            Sergey Bylokhov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: