Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 64180 invoked from network); 15 Jan 2007 07:50:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Jan 2007 07:50:50 -0000 Received: (qmail 38717 invoked by uid 500); 15 Jan 2007 07:50:56 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 38613 invoked by uid 500); 15 Jan 2007 07:50:56 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 38523 invoked by uid 99); 15 Jan 2007 07:50:56 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Jan 2007 23:50:56 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Jan 2007 23:50:48 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 2F9577142F7 for ; Sun, 14 Jan 2007 23:50:28 -0800 (PST) Message-ID: <4725641.1168847428192.JavaMail.jira@brutus> Date: Sun, 14 Jan 2007 23:50:28 -0800 (PST) From: "Alexei Zakharov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Assigned: (HARMONY-2796) [classlib][awt] java.awt.image.IndexColorModel.getNormalizedComponents() throws UnsupportedOperationException while RI throws NPE In-Reply-To: <492872.1166539401405.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-2796?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alexei Zakharov reassigned HARMONY-2796: ---------------------------------------- Assignee: Alexei Zakharov > [classlib][awt] java.awt.image.IndexColorModel.getNormalizedComponents() throws UnsupportedOperationException while RI throws NPE > --------------------------------------------------------------------------------------------------------------------------------- > > Key: HARMONY-2796 > URL: https://issues.apache.org/jira/browse/HARMONY-2796 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Ilya Okomin > Assigned To: Alexei Zakharov > Priority: Minor > Attachments: ColorModel2796.patch, ColorModel2796Test.patch > > > Harmony throws specified UnsupportedOperationException for java.awt.image.IndexColorModel.getNormalizedComponents(Object pixel,float[] > normComponents,int normOffset) while RI throws unspecified NPE. > Spec says:"Throws: ClassCastException - if pixel is not a primitive array of type transferType ". > Test case to reproduce: > ----------------------- test.java ------------------------- > import java.awt.image.IndexColorModel; > 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 size = 2; > int bits = 4; > IndexColorModel cm = new IndexColorModel(bits, size, new byte[size], > new byte[size], new byte[size]); > float[] normComponentes = new float[] {}; > int normOffset = 5; > Object pixel = null; > try { > cm.getNormalizedComponents(pixel, normComponentes, normOffset); > fail("NPE exception expected!"); > } catch (NullPointerException npe) { > npe.printStackTrace(); > } > } > } > ------------------------------------------------------------- > Output RI: > ======== > .java.lang.NullPointerException > at java.awt.image.IndexColorModel.getComponents(IndexColorModel.java:1047) > at java.awt.image.ColorModel.getNormalizedComponents(ColorModel.java:1414) > at test.testRun(test.java:24) > at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source) > at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source) > at junit.framework.TestCase.runTest(TestCase.java:154) > at junit.framework.TestCase.runBare(TestCase.java:127) > at junit.framework.TestResult$1.protect(TestResult.java:106) > at junit.framework.TestResult.runProtected(TestResult.java:124) > at junit.framework.TestResult.run(TestResult.java:109) > at junit.framework.TestCase.run(TestCase.java:118) > at junit.framework.TestSuite.runTest(TestSuite.java:208) > at junit.framework.TestSuite.run(TestSuite.java:203) > at junit.textui.TestRunner.doRun(TestRunner.java:116) > at junit.textui.TestRunner.doRun(TestRunner.java:109) > at junit.textui.TestRunner.run(TestRunner.java:72) > at junit.textui.TestRunner.run(TestRunner.java:57) > at test.main(test.java:9) > Time: 0,06 > OK (1 test) > Output Harmony: > ============= > .E > Time: 0.371 > There was 1 error: > 1) testRun(test)java.lang.UnsupportedOperationException: This transferType is not supported by this color model > at java.awt.image.IndexColorModel.getComponents(IndexColorModel.java:462) > at java.awt.image.ColorModel.getNormalizedComponents(ColorModel.java) > at test.testRun(test.java:21) > at java.lang.reflect.VMReflection.invokeMethod(Native Method) > at test.main(test.java:9) > 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: https://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira