Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 86732 invoked from network); 12 Jan 2007 15:30:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Jan 2007 15:30:50 -0000 Received: (qmail 4480 invoked by uid 500); 12 Jan 2007 15:30:55 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 4458 invoked by uid 500); 12 Jan 2007 15:30:55 -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 4401 invoked by uid 99); 12 Jan 2007 15:30:55 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Jan 2007 07:30:55 -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; Fri, 12 Jan 2007 07:30:47 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id D0706714314 for ; Fri, 12 Jan 2007 07:30:27 -0800 (PST) Message-ID: <21444874.1168615827849.JavaMail.jira@brutus> Date: Fri, 12 Jan 2007 07:30:27 -0800 (PST) From: "Alexander D Shipilov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-2801) [classlib][awt] Compatibility: java.awt.image.ComponentSampleModel.getSamples(int,int,int,int,int[],DataBuffer) does not throw NPE while RI does In-Reply-To: <28136383.1166546421086.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-2801?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alexander D Shipilov updated HARMONY-2801: ------------------------------------------ Attachment: ComponentSampleModel2801.patch > [classlib][awt] Compatibility: java.awt.image.ComponentSampleModel.getSamples(int,int,int,int,int[],DataBuffer) does not throw NPE while RI does > ------------------------------------------------------------------------------------------------------------------------------------------------ > > Key: HARMONY-2801 > URL: https://issues.apache.org/jira/browse/HARMONY-2801 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Oleg Khaschansky > Priority: Trivial > Attachments: ComponentSampleModel2783Test.patch, ComponentSampleModel2801.patch > > > Under some specific circumstances java.awt.image.ComponentSampleModel.getSamples(int,int,int,int,int[],DataBuffer) does not throw NPE on Harmony, but RI does. This is a case when integer overflow occurs with the passed coordinates/width/height values. NPE is not documented in the API spec. I don't think that this is a big issue and suggest to treat this as a non-bug difference from RI. The following testcase demonstrates this behavior: > ------------------------------------------------------------------------------------------ > import junit.framework.TestCase; > import java.awt.image.*; > public class Test0 extends TestCase { > public void testcase0() { > ComponentSampleModel csm = new ComponentSampleModel(3, 10, 10, 1, 10, new int[]{0}); > try { > int[] returnValue = > csm.getSamples(Integer.MAX_VALUE,4,1,1,0,new int[]{0},(DataBuffer) null); > fail("No exception"); > } catch(NullPointerException expectedException) { > System.out.println(expectedException +" was thrown"); > } > } > } > ------------------------------------------------------------------------------------------ > Harmony: > No exception > junit.framework.AssertionFailedError > at Test0.testcase0(Test0.java:33) > at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25) > ------------------------------------------------------------------------------------------ > RI: > java.lang.NullPointerException was thrown -- 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