harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ilya Okomin (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-2656) [classlib][awt] Compatibility: java.awt.AreaAveragingScaleFilter.setPixels() throws different Exceptions on RI and Harmony when the height is negative
Date Tue, 12 Dec 2006 16:13:21 GMT
[classlib][awt] Compatibility: java.awt.AreaAveragingScaleFilter.setPixels() throws different
Exceptions on RI and Harmony when the height is negative
------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-2656
                 URL: http://issues.apache.org/jira/browse/HARMONY-2656
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Ilya Okomin
            Priority: Minor


java.awt.AreaAveragingScaleFilter.setPixels(int x, int y, int w, int h, ColorModel model,
int[] pixels, int off, int scansize) 
 on Harmony throws NegativeArraySizeException with incorrect height parmeters. RI throws IndexOutOfBoundsException.
See test case to reproduce:
---------- test.java -----------
import java.awt.image.AreaAveragingScaleFilter;
import java.awt.image.ColorModel;

import junit.framework.TestCase;
import junit.textui.TestRunner;

public class test extends TestCase {

    public static void main(String args[]) {
        TestRunner.run(test.class);
    }

    public void testRun() {
        int width = 143;
        int height = -1;
        int x = 1;
        int y = 1;
        int w = 1;
        int h = 1;
        int[] pixels = new int[] {};
        AreaAveragingScaleFilter locAASF = new AreaAveragingScaleFilter(width,
                height);

        int off = 2;
        int scansize = 1;
        try {
            locAASF.setPixels(x, y, w, h, (ColorModel) null, pixels, off,
                    scansize);
            fail("IndexOutOfBoundsException expected");
        } catch (IndexOutOfBoundsException e) {
            // expected
        }
    }
}
--------------------------
Output RI:
========
.
Time: 0,1

OK (1 test)

Output Harmony:
=============
.E
Time: 0.04
There was 1 error:
1) testRun(test)java.lang.NegativeArraySizeException
	at java.awt.image.ReplicateScaleFilter.initArrays(ReplicateScaleFilter.java:172)
	at java.awt.image.ReplicateScaleFilter.setPixels(ReplicateScaleFilter.java:82)
	at java.awt.image.AreaAveragingScaleFilter.setPixels(AreaAveragingScaleFilter.java:55)
	at test.testRun(test.java:25)
	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
	at test.main(test.java:10)

FAILURES!!!
Tests run: 1,  Failures: 0,  Errors: 1


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message