You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexey Petrenko (JIRA)" <ji...@apache.org> on 2006/12/19 11:35:23 UTC
[jira] Assigned: (HARMONY-1632) [classlib][awt]Compatibility:
java.awt.image.LookupOp.filter() throws ArrayIndexOutOfBoundsException
while RI throws IllegalArgumentException
[ http://issues.apache.org/jira/browse/HARMONY-1632?page=all ]
Alexey Petrenko reassigned HARMONY-1632:
----------------------------------------
Assignee: Alexey Petrenko
> [classlib][awt]Compatibility: java.awt.image.LookupOp.filter() throws ArrayIndexOutOfBoundsException while RI throws IllegalArgumentException
> ---------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-1632
> URL: http://issues.apache.org/jira/browse/HARMONY-1632
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Ilya Okomin
> Assigned To: Alexey Petrenko
> Priority: Minor
> Attachments: Harmony-1632-test.patch, Harmony-1632.patch
>
>
> Harmony throws unspecified ArrayIndexOutOfBoundsException for java.awt.image.LookupOp.filter(BufferedImage src,BufferedImage dst) and java.awt.image.LookupOp.filter(Raster src, WritableRaster dst) while RI throws IllegalArgumentException. It is the case when src and dst have different width or height.
> Spec says nothing about the exceptions when width or height of dst and src are not equals however RI has checks for these parameters. It is a Exception throwing compatibility issue.
> Test to reproduce:
> ----------------test.java-------------------
> import java.awt.image.LookupOp;
> import java.awt.image.ByteLookupTable;
> import java.awt.image.BufferedImage;
> public class test {
> public static BufferedImage getImage(int w, int h) {
> return new BufferedImage(w, h, BufferedImage.TYPE_4BYTE_ABGR);
> }
> public static void main(String[] args) {
> byte[] array0 = new byte[96];
> ByteLookupTable localByteLookupTable = new ByteLookupTable(1, array0);
> LookupOp localLookupOp = new LookupOp(localByteLookupTable, null);
> BufferedImage localBufferedImage = getImage(5069, 19);
> BufferedImage localBufferedImage1 = getImage(6, 19);
> try {
> localLookupOp.filter(localBufferedImage, localBufferedImage1);
> } catch (Exception e) {
> System.out.println("filter(BI,BI) non-equal widths: " + e + " was thrown");
> }
> try {
> localLookupOp.filter(localBufferedImage.getRaster(), localBufferedImage1.getRaster());
> } catch (Exception e) {
> System.out.println("filter(WR,R) non-equal widths: " + e + " was thrown");
> }
> localBufferedImage1 = getImage(5069, 5);
> try {
> localLookupOp.filter(localBufferedImage, localBufferedImage1);
> } catch (Exception e) {
> System.out.println("filter(BI,BI) non-equal heights: " + e + " was thrown");
> }
>
> try {
> localLookupOp.filter(localBufferedImage.getRaster(), localBufferedImage1.getRaster());
> } catch (Exception e) {
> System.out.println("filter(WR,R) non-equal heights: " + e + " was thrown");
> }
> }
> }
> -------------------------------------------------------
> ====== Output RI =======
> filter(BI,BI) non-equal widths: java.lang.IllegalArgumentException: Src width (5069) not equal to dst width (6) was thrown
> filter(WR,R) non-equal widths: java.lang.IllegalArgumentException: Width or height of Rasters do not match was thrown
> filter(BI,BI) non-equal heights: java.lang.IllegalArgumentException: Src height (19) not equal to dst height (5) was thrown
> filter(WR,R) non-equal heights: java.lang.IllegalArgumentException: Width or height of Rasters do not match was thrown
> ====== Output Harmony ======
> filter(BI,BI) non-equal widths: java.lang.ArrayIndexOutOfBoundsException was thrown
> filter(WR,R) non-equal widths: java.lang.ArrayIndexOutOfBoundsException was thrown
> filter(BI,BI) non-equal heights: java.lang.ArrayIndexOutOfBoundsException was thrown
> filter(WR,R) non-equal heights: java.lang.ArrayIndexOutOfBoundsException was thrown
--
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