You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Ilya Okomin (JIRA)" <ji...@apache.org> on 2006/12/27 09:27:22 UTC

[jira] Created: (HARMONY-2885) [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if DataBuffer type is incorrect

[classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if DataBuffer type is incorrect
---------------------------------------------------------------------------------------------------------------------------------------

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


java.awt.image.Raster.createRaster(SampleModel sm, DataBuffer db, Point location) doesn't throw RasterFormatException if DataBuffer type is not the same as SampleModel has as it is done on RI.
Test case to reproduce, it fails on Harmony and passes on RI:
------------------ test.java --------------------
import java.awt.Point;
import java.awt.image.DataBuffer;
import java.awt.image.DataBufferShort;
import java.awt.image.Raster;
import java.awt.image.RasterFormatException;
import java.awt.image.SinglePixelPackedSampleModel;

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 dataType = DataBuffer.TYPE_USHORT;
        int w = 2;
        int h = 26;
        int[] array0 = new int[798];
        SinglePixelPackedSampleModel sm = new SinglePixelPackedSampleModel(
                dataType, w, h, array0);

        DataBufferShort localDataBufferShort = new DataBufferShort(1,1);
        Point location = new Point();

        try {
            Raster localRaster = Raster.createRaster(sm, localDataBufferShort,
                    location);
            fail("RasterFormatException expected!");
        } catch (RasterFormatException expectedException) {
            // Expected
            System.out.println(expectedException + " was thrown");
        }
    }

}
---------------------------------------------------

On RI output is:
============
.java.awt.image.RasterFormatException: ShortComponentRasters must have short DataBuffers was thrown

Time: 0,13

OK (1 test)

-- 
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

        

[jira] Updated: (HARMONY-2885) [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if DataBuffer type is incorrect

Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexei Zakharov updated HARMONY-2885:
-------------------------------------

    Patch Info:   (was: [Patch Available])

"Patch available" status was dropped since the suggested patch was invalid.

> [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if DataBuffer type is incorrect
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2885
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2885
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ilya Okomin
>         Assigned To: Alexei Zakharov
>            Priority: Minor
>         Attachments: RasterDataTypes2885.patch, RasterDataTypes2885Test.patch
>
>
> java.awt.image.Raster.createRaster(SampleModel sm, DataBuffer db, Point location) doesn't throw RasterFormatException if DataBuffer type is not the same as SampleModel has as it is done on RI.
> Test case to reproduce, it fails on Harmony and passes on RI:
> ------------------ test.java --------------------
> import java.awt.Point;
> import java.awt.image.DataBuffer;
> import java.awt.image.DataBufferShort;
> import java.awt.image.Raster;
> import java.awt.image.RasterFormatException;
> import java.awt.image.SinglePixelPackedSampleModel;
> 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 dataType = DataBuffer.TYPE_USHORT;
>         int w = 2;
>         int h = 26;
>         int[] array0 = new int[798];
>         SinglePixelPackedSampleModel sm = new SinglePixelPackedSampleModel(
>                 dataType, w, h, array0);
>         DataBufferShort localDataBufferShort = new DataBufferShort(1,1);
>         Point location = new Point();
>         try {
>             Raster localRaster = Raster.createRaster(sm, localDataBufferShort,
>                     location);
>             fail("RasterFormatException expected!");
>         } catch (RasterFormatException expectedException) {
>             // Expected
>             System.out.println(expectedException + " was thrown");
>         }
>     }
> }
> ---------------------------------------------------
> On RI output is:
> ============
> .java.awt.image.RasterFormatException: ShortComponentRasters must have short DataBuffers was thrown
> Time: 0,13
> OK (1 test)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-2885) [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if DataBuffer type is incorrect

Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexei Zakharov updated HARMONY-2885:
-------------------------------------

    Assignee:     (was: Alexei Zakharov)

> [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if DataBuffer type is incorrect
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2885
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2885
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ilya Okomin
>            Priority: Minor
>         Attachments: RasterDataTypes2885.patch, RasterDataTypes2885Test.patch
>
>
> java.awt.image.Raster.createRaster(SampleModel sm, DataBuffer db, Point location) doesn't throw RasterFormatException if DataBuffer type is not the same as SampleModel has as it is done on RI.
> Test case to reproduce, it fails on Harmony and passes on RI:
> ------------------ test.java --------------------
> import java.awt.Point;
> import java.awt.image.DataBuffer;
> import java.awt.image.DataBufferShort;
> import java.awt.image.Raster;
> import java.awt.image.RasterFormatException;
> import java.awt.image.SinglePixelPackedSampleModel;
> 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 dataType = DataBuffer.TYPE_USHORT;
>         int w = 2;
>         int h = 26;
>         int[] array0 = new int[798];
>         SinglePixelPackedSampleModel sm = new SinglePixelPackedSampleModel(
>                 dataType, w, h, array0);
>         DataBufferShort localDataBufferShort = new DataBufferShort(1,1);
>         Point location = new Point();
>         try {
>             Raster localRaster = Raster.createRaster(sm, localDataBufferShort,
>                     location);
>             fail("RasterFormatException expected!");
>         } catch (RasterFormatException expectedException) {
>             // Expected
>             System.out.println(expectedException + " was thrown");
>         }
>     }
> }
> ---------------------------------------------------
> On RI output is:
> ============
> .java.awt.image.RasterFormatException: ShortComponentRasters must have short DataBuffers was thrown
> Time: 0,13
> OK (1 test)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-2885) [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if DataBuffer type is incorrect

Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexei Zakharov updated HARMONY-2885:
-------------------------------------

    Patch Info: [Patch Available]

> [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if DataBuffer type is incorrect
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2885
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2885
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ilya Okomin
>            Priority: Minor
>         Attachments: RasterDataTypes2885.patch, RasterDataTypes2885Test.patch
>
>
> java.awt.image.Raster.createRaster(SampleModel sm, DataBuffer db, Point location) doesn't throw RasterFormatException if DataBuffer type is not the same as SampleModel has as it is done on RI.
> Test case to reproduce, it fails on Harmony and passes on RI:
> ------------------ test.java --------------------
> import java.awt.Point;
> import java.awt.image.DataBuffer;
> import java.awt.image.DataBufferShort;
> import java.awt.image.Raster;
> import java.awt.image.RasterFormatException;
> import java.awt.image.SinglePixelPackedSampleModel;
> 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 dataType = DataBuffer.TYPE_USHORT;
>         int w = 2;
>         int h = 26;
>         int[] array0 = new int[798];
>         SinglePixelPackedSampleModel sm = new SinglePixelPackedSampleModel(
>                 dataType, w, h, array0);
>         DataBufferShort localDataBufferShort = new DataBufferShort(1,1);
>         Point location = new Point();
>         try {
>             Raster localRaster = Raster.createRaster(sm, localDataBufferShort,
>                     location);
>             fail("RasterFormatException expected!");
>         } catch (RasterFormatException expectedException) {
>             // Expected
>             System.out.println(expectedException + " was thrown");
>         }
>     }
> }
> ---------------------------------------------------
> On RI output is:
> ============
> .java.awt.image.RasterFormatException: ShortComponentRasters must have short DataBuffers was thrown
> Time: 0,13
> OK (1 test)

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

        

[jira] Commented: (HARMONY-2885) [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if DataBuffer type is incorrect

Posted by "Alexander D Shipilov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2885?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12467469 ] 

Alexander D Shipilov commented on HARMONY-2885:
-----------------------------------------------

This JIRA should be reopend and rolled back. Patch applyes to hard restrinction, and because of it some code can't pass (e.g. see JIRA 2880).

> [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if DataBuffer type is incorrect
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2885
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2885
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ilya Okomin
>         Assigned To: Alexei Zakharov
>            Priority: Minor
>         Attachments: RasterDataTypes2885.patch, RasterDataTypes2885Test.patch
>
>
> java.awt.image.Raster.createRaster(SampleModel sm, DataBuffer db, Point location) doesn't throw RasterFormatException if DataBuffer type is not the same as SampleModel has as it is done on RI.
> Test case to reproduce, it fails on Harmony and passes on RI:
> ------------------ test.java --------------------
> import java.awt.Point;
> import java.awt.image.DataBuffer;
> import java.awt.image.DataBufferShort;
> import java.awt.image.Raster;
> import java.awt.image.RasterFormatException;
> import java.awt.image.SinglePixelPackedSampleModel;
> 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 dataType = DataBuffer.TYPE_USHORT;
>         int w = 2;
>         int h = 26;
>         int[] array0 = new int[798];
>         SinglePixelPackedSampleModel sm = new SinglePixelPackedSampleModel(
>                 dataType, w, h, array0);
>         DataBufferShort localDataBufferShort = new DataBufferShort(1,1);
>         Point location = new Point();
>         try {
>             Raster localRaster = Raster.createRaster(sm, localDataBufferShort,
>                     location);
>             fail("RasterFormatException expected!");
>         } catch (RasterFormatException expectedException) {
>             // Expected
>             System.out.println(expectedException + " was thrown");
>         }
>     }
> }
> ---------------------------------------------------
> On RI output is:
> ============
> .java.awt.image.RasterFormatException: ShortComponentRasters must have short DataBuffers was thrown
> Time: 0,13
> OK (1 test)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-2885) [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if DataBuffer type is incorrect

Posted by "Alexander D Shipilov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2885?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12464203 ] 

Alexander D Shipilov commented on HARMONY-2885:
-----------------------------------------------

I have verified this issue. Bug doesn't reproduce anymore at envirement: winXP, P3000HT, Harmony revision r495562.

> [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if DataBuffer type is incorrect
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2885
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2885
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ilya Okomin
>         Assigned To: Alexei Zakharov
>            Priority: Minor
>         Attachments: RasterDataTypes2885.patch, RasterDataTypes2885Test.patch
>
>
> java.awt.image.Raster.createRaster(SampleModel sm, DataBuffer db, Point location) doesn't throw RasterFormatException if DataBuffer type is not the same as SampleModel has as it is done on RI.
> Test case to reproduce, it fails on Harmony and passes on RI:
> ------------------ test.java --------------------
> import java.awt.Point;
> import java.awt.image.DataBuffer;
> import java.awt.image.DataBufferShort;
> import java.awt.image.Raster;
> import java.awt.image.RasterFormatException;
> import java.awt.image.SinglePixelPackedSampleModel;
> 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 dataType = DataBuffer.TYPE_USHORT;
>         int w = 2;
>         int h = 26;
>         int[] array0 = new int[798];
>         SinglePixelPackedSampleModel sm = new SinglePixelPackedSampleModel(
>                 dataType, w, h, array0);
>         DataBufferShort localDataBufferShort = new DataBufferShort(1,1);
>         Point location = new Point();
>         try {
>             Raster localRaster = Raster.createRaster(sm, localDataBufferShort,
>                     location);
>             fail("RasterFormatException expected!");
>         } catch (RasterFormatException expectedException) {
>             // Expected
>             System.out.println(expectedException + " was thrown");
>         }
>     }
> }
> ---------------------------------------------------
> On RI output is:
> ============
> .java.awt.image.RasterFormatException: ShortComponentRasters must have short DataBuffers was thrown
> Time: 0,13
> OK (1 test)

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

        

[jira] Updated: (HARMONY-2885) [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if DataBuffer type is incorrect

Posted by "Alexander D Shipilov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexander D Shipilov updated HARMONY-2885:
------------------------------------------

    Attachment: RasterDataTypes2885Test.patch

> [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if DataBuffer type is incorrect
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2885
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2885
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ilya Okomin
>            Priority: Minor
>         Attachments: RasterDataTypes2885.patch, RasterDataTypes2885Test.patch
>
>
> java.awt.image.Raster.createRaster(SampleModel sm, DataBuffer db, Point location) doesn't throw RasterFormatException if DataBuffer type is not the same as SampleModel has as it is done on RI.
> Test case to reproduce, it fails on Harmony and passes on RI:
> ------------------ test.java --------------------
> import java.awt.Point;
> import java.awt.image.DataBuffer;
> import java.awt.image.DataBufferShort;
> import java.awt.image.Raster;
> import java.awt.image.RasterFormatException;
> import java.awt.image.SinglePixelPackedSampleModel;
> 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 dataType = DataBuffer.TYPE_USHORT;
>         int w = 2;
>         int h = 26;
>         int[] array0 = new int[798];
>         SinglePixelPackedSampleModel sm = new SinglePixelPackedSampleModel(
>                 dataType, w, h, array0);
>         DataBufferShort localDataBufferShort = new DataBufferShort(1,1);
>         Point location = new Point();
>         try {
>             Raster localRaster = Raster.createRaster(sm, localDataBufferShort,
>                     location);
>             fail("RasterFormatException expected!");
>         } catch (RasterFormatException expectedException) {
>             // Expected
>             System.out.println(expectedException + " was thrown");
>         }
>     }
> }
> ---------------------------------------------------
> On RI output is:
> ============
> .java.awt.image.RasterFormatException: ShortComponentRasters must have short DataBuffers was thrown
> Time: 0,13
> OK (1 test)

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

        

[jira] Assigned: (HARMONY-2885) [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if DataBuffer type is incorrect

Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexei Zakharov reassigned HARMONY-2885:
----------------------------------------

    Assignee: Alexei Zakharov

> [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if DataBuffer type is incorrect
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2885
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2885
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ilya Okomin
>         Assigned To: Alexei Zakharov
>            Priority: Minor
>         Attachments: RasterDataTypes2885.patch, RasterDataTypes2885Test.patch
>
>
> java.awt.image.Raster.createRaster(SampleModel sm, DataBuffer db, Point location) doesn't throw RasterFormatException if DataBuffer type is not the same as SampleModel has as it is done on RI.
> Test case to reproduce, it fails on Harmony and passes on RI:
> ------------------ test.java --------------------
> import java.awt.Point;
> import java.awt.image.DataBuffer;
> import java.awt.image.DataBufferShort;
> import java.awt.image.Raster;
> import java.awt.image.RasterFormatException;
> import java.awt.image.SinglePixelPackedSampleModel;
> 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 dataType = DataBuffer.TYPE_USHORT;
>         int w = 2;
>         int h = 26;
>         int[] array0 = new int[798];
>         SinglePixelPackedSampleModel sm = new SinglePixelPackedSampleModel(
>                 dataType, w, h, array0);
>         DataBufferShort localDataBufferShort = new DataBufferShort(1,1);
>         Point location = new Point();
>         try {
>             Raster localRaster = Raster.createRaster(sm, localDataBufferShort,
>                     location);
>             fail("RasterFormatException expected!");
>         } catch (RasterFormatException expectedException) {
>             // Expected
>             System.out.println(expectedException + " was thrown");
>         }
>     }
> }
> ---------------------------------------------------
> On RI output is:
> ============
> .java.awt.image.RasterFormatException: ShortComponentRasters must have short DataBuffers was thrown
> Time: 0,13
> OK (1 test)

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

        

[jira] Resolved: (HARMONY-2885) [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if DataBuffer type is incorrect

Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexei Zakharov resolved HARMONY-2885.
--------------------------------------

    Resolution: Fixed

The patch was applied at the revision r495321. Thanks to everybody. Please check.

> [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if DataBuffer type is incorrect
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2885
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2885
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ilya Okomin
>         Assigned To: Alexei Zakharov
>            Priority: Minor
>         Attachments: RasterDataTypes2885.patch, RasterDataTypes2885Test.patch
>
>
> java.awt.image.Raster.createRaster(SampleModel sm, DataBuffer db, Point location) doesn't throw RasterFormatException if DataBuffer type is not the same as SampleModel has as it is done on RI.
> Test case to reproduce, it fails on Harmony and passes on RI:
> ------------------ test.java --------------------
> import java.awt.Point;
> import java.awt.image.DataBuffer;
> import java.awt.image.DataBufferShort;
> import java.awt.image.Raster;
> import java.awt.image.RasterFormatException;
> import java.awt.image.SinglePixelPackedSampleModel;
> 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 dataType = DataBuffer.TYPE_USHORT;
>         int w = 2;
>         int h = 26;
>         int[] array0 = new int[798];
>         SinglePixelPackedSampleModel sm = new SinglePixelPackedSampleModel(
>                 dataType, w, h, array0);
>         DataBufferShort localDataBufferShort = new DataBufferShort(1,1);
>         Point location = new Point();
>         try {
>             Raster localRaster = Raster.createRaster(sm, localDataBufferShort,
>                     location);
>             fail("RasterFormatException expected!");
>         } catch (RasterFormatException expectedException) {
>             // Expected
>             System.out.println(expectedException + " was thrown");
>         }
>     }
> }
> ---------------------------------------------------
> On RI output is:
> ============
> .java.awt.image.RasterFormatException: ShortComponentRasters must have short DataBuffers was thrown
> Time: 0,13
> OK (1 test)

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

        

[jira] Reopened: (HARMONY-2885) [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if DataBuffer type is incorrect

Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexei Zakharov reopened HARMONY-2885:
--------------------------------------


Ouch. Reopened.

> [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if DataBuffer type is incorrect
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2885
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2885
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ilya Okomin
>         Assigned To: Alexei Zakharov
>            Priority: Minor
>         Attachments: RasterDataTypes2885.patch, RasterDataTypes2885Test.patch
>
>
> java.awt.image.Raster.createRaster(SampleModel sm, DataBuffer db, Point location) doesn't throw RasterFormatException if DataBuffer type is not the same as SampleModel has as it is done on RI.
> Test case to reproduce, it fails on Harmony and passes on RI:
> ------------------ test.java --------------------
> import java.awt.Point;
> import java.awt.image.DataBuffer;
> import java.awt.image.DataBufferShort;
> import java.awt.image.Raster;
> import java.awt.image.RasterFormatException;
> import java.awt.image.SinglePixelPackedSampleModel;
> 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 dataType = DataBuffer.TYPE_USHORT;
>         int w = 2;
>         int h = 26;
>         int[] array0 = new int[798];
>         SinglePixelPackedSampleModel sm = new SinglePixelPackedSampleModel(
>                 dataType, w, h, array0);
>         DataBufferShort localDataBufferShort = new DataBufferShort(1,1);
>         Point location = new Point();
>         try {
>             Raster localRaster = Raster.createRaster(sm, localDataBufferShort,
>                     location);
>             fail("RasterFormatException expected!");
>         } catch (RasterFormatException expectedException) {
>             // Expected
>             System.out.println(expectedException + " was thrown");
>         }
>     }
> }
> ---------------------------------------------------
> On RI output is:
> ============
> .java.awt.image.RasterFormatException: ShortComponentRasters must have short DataBuffers was thrown
> Time: 0,13
> OK (1 test)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-2885) [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if DataBuffer type is incorrect

Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2885?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12468269 ] 

Alexei Zakharov commented on HARMONY-2885:
------------------------------------------

Reverted at the revision 501036. IMO we should fix this issue nevertheless since RI behavior seems logic to me in this case. Whole RasterTest was added to exclude list.

> [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if DataBuffer type is incorrect
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2885
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2885
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ilya Okomin
>         Assigned To: Alexei Zakharov
>            Priority: Minor
>         Attachments: RasterDataTypes2885.patch, RasterDataTypes2885Test.patch
>
>
> java.awt.image.Raster.createRaster(SampleModel sm, DataBuffer db, Point location) doesn't throw RasterFormatException if DataBuffer type is not the same as SampleModel has as it is done on RI.
> Test case to reproduce, it fails on Harmony and passes on RI:
> ------------------ test.java --------------------
> import java.awt.Point;
> import java.awt.image.DataBuffer;
> import java.awt.image.DataBufferShort;
> import java.awt.image.Raster;
> import java.awt.image.RasterFormatException;
> import java.awt.image.SinglePixelPackedSampleModel;
> 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 dataType = DataBuffer.TYPE_USHORT;
>         int w = 2;
>         int h = 26;
>         int[] array0 = new int[798];
>         SinglePixelPackedSampleModel sm = new SinglePixelPackedSampleModel(
>                 dataType, w, h, array0);
>         DataBufferShort localDataBufferShort = new DataBufferShort(1,1);
>         Point location = new Point();
>         try {
>             Raster localRaster = Raster.createRaster(sm, localDataBufferShort,
>                     location);
>             fail("RasterFormatException expected!");
>         } catch (RasterFormatException expectedException) {
>             // Expected
>             System.out.println(expectedException + " was thrown");
>         }
>     }
> }
> ---------------------------------------------------
> On RI output is:
> ============
> .java.awt.image.RasterFormatException: ShortComponentRasters must have short DataBuffers was thrown
> Time: 0,13
> OK (1 test)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-2885) [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if DataBuffer type is incorrect

Posted by "Alexander D Shipilov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexander D Shipilov updated HARMONY-2885:
------------------------------------------

    Attachment: RasterDataTypes2885.patch

> [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if DataBuffer type is incorrect
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2885
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2885
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ilya Okomin
>            Priority: Minor
>         Attachments: RasterDataTypes2885.patch, RasterDataTypes2885Test.patch
>
>
> java.awt.image.Raster.createRaster(SampleModel sm, DataBuffer db, Point location) doesn't throw RasterFormatException if DataBuffer type is not the same as SampleModel has as it is done on RI.
> Test case to reproduce, it fails on Harmony and passes on RI:
> ------------------ test.java --------------------
> import java.awt.Point;
> import java.awt.image.DataBuffer;
> import java.awt.image.DataBufferShort;
> import java.awt.image.Raster;
> import java.awt.image.RasterFormatException;
> import java.awt.image.SinglePixelPackedSampleModel;
> 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 dataType = DataBuffer.TYPE_USHORT;
>         int w = 2;
>         int h = 26;
>         int[] array0 = new int[798];
>         SinglePixelPackedSampleModel sm = new SinglePixelPackedSampleModel(
>                 dataType, w, h, array0);
>         DataBufferShort localDataBufferShort = new DataBufferShort(1,1);
>         Point location = new Point();
>         try {
>             Raster localRaster = Raster.createRaster(sm, localDataBufferShort,
>                     location);
>             fail("RasterFormatException expected!");
>         } catch (RasterFormatException expectedException) {
>             // Expected
>             System.out.println(expectedException + " was thrown");
>         }
>     }
> }
> ---------------------------------------------------
> On RI output is:
> ============
> .java.awt.image.RasterFormatException: ShortComponentRasters must have short DataBuffers was thrown
> Time: 0,13
> OK (1 test)

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

        

[jira] Closed: (HARMONY-2885) [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if DataBuffer type is incorrect

Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexei Zakharov closed HARMONY-2885.
------------------------------------


verified by Alexander

> [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if DataBuffer type is incorrect
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2885
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2885
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ilya Okomin
>         Assigned To: Alexei Zakharov
>            Priority: Minor
>         Attachments: RasterDataTypes2885.patch, RasterDataTypes2885Test.patch
>
>
> java.awt.image.Raster.createRaster(SampleModel sm, DataBuffer db, Point location) doesn't throw RasterFormatException if DataBuffer type is not the same as SampleModel has as it is done on RI.
> Test case to reproduce, it fails on Harmony and passes on RI:
> ------------------ test.java --------------------
> import java.awt.Point;
> import java.awt.image.DataBuffer;
> import java.awt.image.DataBufferShort;
> import java.awt.image.Raster;
> import java.awt.image.RasterFormatException;
> import java.awt.image.SinglePixelPackedSampleModel;
> 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 dataType = DataBuffer.TYPE_USHORT;
>         int w = 2;
>         int h = 26;
>         int[] array0 = new int[798];
>         SinglePixelPackedSampleModel sm = new SinglePixelPackedSampleModel(
>                 dataType, w, h, array0);
>         DataBufferShort localDataBufferShort = new DataBufferShort(1,1);
>         Point location = new Point();
>         try {
>             Raster localRaster = Raster.createRaster(sm, localDataBufferShort,
>                     location);
>             fail("RasterFormatException expected!");
>         } catch (RasterFormatException expectedException) {
>             // Expected
>             System.out.println(expectedException + " was thrown");
>         }
>     }
> }
> ---------------------------------------------------
> On RI output is:
> ============
> .java.awt.image.RasterFormatException: ShortComponentRasters must have short DataBuffers was thrown
> Time: 0,13
> OK (1 test)

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