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

AreaAveragingScaleFilter(int, int): IAE is not specified

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 5.0
    • Fix Version/s: 17
    • Component/s: client-libs
    • Labels:
      None
    • Subcomponent:
      2d
    • Resolved In Build:
      b09
    • CPU:
      generic
    • OS:
      generic

      Description

      Constructor for java.awt.image.AreaAveragingScaleFilter class throws IllegalArgumentException when passed a zero value for a input parameter. Such behavior is not specified either in the member spec or in the package/class description.

      ---------
      import java.awt.image.AreaAveragingScaleFilter;

      public class Test1 {
          public static void main(String[] args) {
              int[] values = { 1, -1, Integer.MAX_VALUE, Integer.MIN_VALUE,
                               29, 180, -32, -439 };
              StubFilter filter = null;
              for (int i = 0; i < values.length; i++) {
                  try {
                      filter = new StubFilter(0, values[i]);
                      System.out.println("result: false");
                  } catch (IllegalArgumentException e) {
                      System.out.println("result (iae): true");
                  }
              }
          }

          public static class StubFilter extends AreaAveragingScaleFilter {

              public StubFilter(int width, int height) {
                  super(width, height);
              }

              public int getSrcWidth() {
                  return srcWidth;
              }

              public int getSrcHeight() {
                  return srcHeight;
              }

              public int getDestWidth() {
                  return destWidth;
              }

              public int getDestHeight() {
                  return destHeight;
              }
          }
      }

      ###@###.### 2004-12-21 14:42:51 GMT

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              psadhukhan Prasanta Sadhukhan
              Reporter:
              ydanilev Yury Danilevich (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: