Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 90860 invoked from network); 29 Jan 2007 16:24:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Jan 2007 16:24:12 -0000 Received: (qmail 50515 invoked by uid 500); 29 Jan 2007 16:24:18 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 50495 invoked by uid 500); 29 Jan 2007 16:24:17 -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 50474 invoked by uid 99); 29 Jan 2007 16:24:17 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Jan 2007 08:24:17 -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; Mon, 29 Jan 2007 08:24:09 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id BD6047142E4 for ; Mon, 29 Jan 2007 08:23:49 -0800 (PST) Message-ID: <3990816.1170087829773.JavaMail.jira@brutus> Date: Mon, 29 Jan 2007 08:23:49 -0800 (PST) From: "Andrey Pavlenko (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-2779) [classlib][awt] Compatibility: java.awt.image.MultiPixelPackedSampleModel.setDataElements(int ,int,Object ,DataBuffer) throws unspecified NPE while Ri throws ArrayIndexOutOfBoundsException In-Reply-To: <8654720.1166456301046.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-2779?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12468329 ] Andrey Pavlenko commented on HARMONY-2779: ------------------------------------------ Alexei, the patches have been applied as expected, you can close the issue, thanks. > [classlib][awt] Compatibility: java.awt.image.MultiPixelPackedSampleModel.setDataElements(int ,int,Object ,DataBuffer) throws unspecified NPE while Ri throws ArrayIndexOutOfBoundsException > -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: HARMONY-2779 > URL: https://issues.apache.org/jira/browse/HARMONY-2779 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Oleg Khaschansky > Assigned To: Alexei Zakharov > Priority: Minor > Attachments: MultiPixelPackedSampleModel.patch, MultiPixelPackedSampleModelTest.patch > > > Harmony throws unspecified NPE for java.awt.image.MultiPixelPackedSampleModel.setDataElements(int x,int y, > Object obj,DataBuffer data) while RI throws specified ArrayIndexOutOfBoundsException. It's definitely related to the different order of usage of the passed parameters. Harmony uses Object obj first and throws NPE if it is null while RI throws exceptions related to the invalid DataBuffer data param first. The following testcase illustrates this: > ------------------------------------------------------------------------------------------ > import junit.framework.TestCase; > import javax.swing.*; > import java.awt.image.MultiPixelPackedSampleModel; > import java.awt.image.DataBufferFloat; > import java.awt.image.DataBuffer; > public class Test0 extends TestCase { > public void testcase0() { > MultiPixelPackedSampleModel localMultiPixelPackedSampleModel = > new MultiPixelPackedSampleModel(0,52,4,8); > DataBufferFloat localDataBufferFloat = new DataBufferFloat(4,1); > try { > localMultiPixelPackedSampleModel.setDataElements(6,2,(Object) null, localDataBufferFloat); > fail(); > } catch (NullPointerException npe) { > fail(npe+" was thrown"); > } catch (ArrayIndexOutOfBoundsException expectedException) { > System.out.println(expectedException +" was thrown"); > } > } > public void testcase1() { > MultiPixelPackedSampleModel localMultiPixelPackedSampleModel = > new MultiPixelPackedSampleModel(0,14907,18936,2); > JSplitPane localJSplitPane = new JSplitPane(); > try { > localMultiPixelPackedSampleModel.setDataElements(14,14, localJSplitPane,(DataBuffer) null); > fail(); > } catch (ClassCastException expectedException) { > fail(expectedException +" was thrown"); > } catch (NullPointerException npe) { > System.out.println(npe +" was thrown"); > } > } > } > ------------------------------------------------------------------------------------------ > Harmony: > junit.framework.AssertionFailedError: java.lang.NullPointerException was thrown > at Test0.testcase0(Test0.java:35) > at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25) > at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40) > at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25) > at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90) > junit.framework.AssertionFailedError: java.lang.ClassCastException: javax.swing.JSplitPane incompatible with [B was thrown > at Test0.testcase1(Test0.java:49) > at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25) > at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40) > at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25) > at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90) > RI: > java.lang.NullPointerException was thrown > java.lang.ArrayIndexOutOfBoundsException: 110 was thrown -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.