Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 4630 invoked from network); 8 Aug 2006 13:06:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Aug 2006 13:06:49 -0000 Received: (qmail 44303 invoked by uid 500); 8 Aug 2006 13:06:46 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 44269 invoked by uid 500); 8 Aug 2006 13:06:46 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 44258 invoked by uid 99); 8 Aug 2006 13:06:46 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Aug 2006 06:06:46 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of mike.fursov@gmail.com designates 64.233.182.189 as permitted sender) Received: from [64.233.182.189] (HELO nf-out-0910.google.com) (64.233.182.189) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Aug 2006 06:06:44 -0700 Received: by nf-out-0910.google.com with SMTP id a25so235363nfc for ; Tue, 08 Aug 2006 06:06:23 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=t6BQwOyLc18a8HAAK1RvJD5kCXpTItk9i/KAKJymIxKkr9qSpMcM3LQljXGOWetpvUfHi64aoud7k+A00zrDVNoAXzNYChh8uftuIMX6v9d+EN57zIw0t8jUbYX3LQsBrByLTgLO038RA8CFYclAgOpQOut7wyOMsGmlA5Zyrh8= Received: by 10.78.142.14 with SMTP id p14mr2743138hud; Tue, 08 Aug 2006 06:06:23 -0700 (PDT) Received: by 10.78.193.11 with HTTP; Tue, 8 Aug 2006 06:06:22 -0700 (PDT) Message-ID: Date: Tue, 8 Aug 2006 20:06:23 +0700 From: "Mikhail Fursov" To: harmony-dev@incubator.apache.org Subject: Re: [classlib][io] compatibility: need an advise In-Reply-To: <7273946b0608080316p46f401eau3734f31fefef93f3@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_5761_28526299.1155042383015" References: <7273946b0608080212hc10f0cfh8adb36cbd96a582a@mail.gmail.com> <44D85D06.9020702@gmail.com> <7273946b0608080316p46f401eau3734f31fefef93f3@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_5761_28526299.1155042383015 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline +1 to follow RI Here are links to similar bugs: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4010323 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4012133 AFAIU this is not a RI bug but a feature today. On 8/8/06, Vladimir Ivanov wrote: > > On 8/8/06, Richard Liang wrote: > > > > > > > > Vladimir Ivanov wrote: > > > I need a consultation: should we follow RI or spec in the case of > issue > > > 1100? > > > > > I think we shall follow RI for this this problem. Because the behavior > > of RI is reasonable though it seems that it is not compliant with Spec. > > If we decide to throw NPE, maybe some use applications would break. > > > OK, I'll prepare patch if nobody objects. > > Thanks, Vladimir > > > Thanks a lot. > > > > Best regards, > > Richard > > > > > Thanks, Vladimir > > > > > > > > > On 8/8/06, Vladimir Ivanov (JIRA) wrote: > > >> > > >> [classlib][io] compatibility: Harmony method > > >> DataOutputStream(null).writeBytes("") throws NPE while RI does not > > >> > > >> > > > --------------------------------------------------------------------------------------------------------------- > > >> > > >> > > >> Key: HARMONY-1100 > > >> URL: > http://issues.apache.org/jira/browse/HARMONY-1100 > > >> Project: Harmony > > >> Issue Type: Bug > > >> Components: Classlib > > >> Reporter: Vladimir Ivanov > > >> > > >> > > >> The spec says for the java.io package: "Unless otherwise noted, > > >> passing a > > >> null argument to a constructor or method in any class or interface in > > >> this > > >> package will cause a NullPointerException to be thrown". > > >> and says nothing about 'null' for DataOutputStream constructor. > > >> So, according to spec the DataOutputStream(null) should lead to the > > NPE > > >> instead of writeBytes but according to RI no NPE for constructor and > > >> zero-length string for writeBytes. > > >> > > >> =================== test.java ========================= > > >> import java.io.DataOutputStream; > > >> > > >> public class test { > > >> public static void main(String args[]) throws Exception { > > >> System.out.println("res = " + new DataOutputStream(null)); > > >> new DataOutputStream(null).writeBytes(""); > > >> System.out.println("OK"); > > >> } > > >> } > > >> =================================================== > > >> > > >> Output: > > >> C:\tmp\tmp17>C:\jrockit-jdk1.5.0-windows-ia32\bin\java.exe -cp . > > >> -showversion test > > >> java version "1.5.0" > > >> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64) > > >> BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, > > >> R25.0.0-75, GC: System optimized over throughput (initial strategy > > >> singleparpar)) > > >> > > >> res = java.io.DataOutputStream@1b3494 > > >> OK > > >> > > >> C:\tmp\tmp17>C:\harmony\trunk_0427\deploy\jdk\jre\bin\java.exe -cp . > > >> -showversion test > > >> java version 1.5 (subset) > > >> > > >> (c) Copyright 1991, 2006 The Apache Software Foundation or its > > >> licensors, > > >> as applicable. > > >> res = java.io.DataOutputStream@13541354 > > >> Exception in thread "main" java.lang.NullPointerException > > >> at java.io.DataOutputStream.writeBytes(DataOutputStream.java > > :163) > > >> at test.main(test.java:6) > > >> > > >> > > >> -- > > >> 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 > > >> > > >> > > >> > > > > > > > -- > > Richard Liang > > China Software Development Lab, IBM > > > > > > > > --------------------------------------------------------------------- > > Terms of use : http://incubator.apache.org/harmony/mailing.html > > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org > > For additional commands, e-mail: harmony-dev-help@incubator.apache.org > > > > > > -- Mikhail Fursov ------=_Part_5761_28526299.1155042383015--