Index: trunk/modules/awt/src/test/api/java/common/java/awt/image/IndexColorModelRTest.java =================================================================== --- trunk/modules/awt/src/test/api/java/common/java/awt/image/IndexColorModelRTest.java (revision 495562) +++ trunk/modules/awt/src/test/api/java/common/java/awt/image/IndexColorModelRTest.java (working copy) @@ -101,4 +101,20 @@ assertEquals(1, icm6.getTransparentPixel()); } + + public void testGetDataElementOffset() { + // A regression test for harmony-2799 + int bits = 4; + int size = 166; + IndexColorModel localIndexColorModel = new IndexColorModel(bits, size, + new byte[size], new byte[size], new byte[size]); + int[] components = new int[] { 0, 0, 0, 0, 0, 0, 0 }; + int offset = 6; + try { + localIndexColorModel.getDataElement(components, offset); + fail("ArrayIndexOutOfBoundsException expected"); + } catch (ArrayIndexOutOfBoundsException unexpectedException) { + } + + } }