Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 905 invoked from network); 28 Jul 2006 05:38:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Jul 2006 05:38:05 -0000 Received: (qmail 36324 invoked by uid 500); 28 Jul 2006 05:38:02 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 36015 invoked by uid 500); 28 Jul 2006 05:38:02 -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 36004 invoked by uid 99); 28 Jul 2006 05:38:02 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Jul 2006 22:38:02 -0700 X-ASF-Spam-Status: No, hits=2.1 required=10.0 tests=DNS_FROM_RFC_ABUSE,MAILTO_TO_SPAM_ADDR,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: 202.81.18.154 is neither permitted nor denied by domain of firepure@gmail.com) Received: from [202.81.18.154] (HELO ausmtp05.au.ibm.com) (202.81.18.154) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Jul 2006 22:38:00 -0700 Received: from sd0208e0.au.ibm.com (d23rh904.au.ibm.com [202.81.18.202]) by ausmtp05.au.ibm.com (8.13.6/8.13.6) with ESMTP id k6S5eIn37655580 for ; Fri, 28 Jul 2006 15:40:20 +1000 Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.250.242]) by sd0208e0.au.ibm.com (8.12.10/NCO/VER6.8) with ESMTP id k6S5efnM223254 for ; Fri, 28 Jul 2006 15:40:52 +1000 Received: from d23av01.au.ibm.com (loopback [127.0.0.1]) by d23av01.au.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id k6S5bEUh002909 for ; Fri, 28 Jul 2006 15:37:14 +1000 Received: from d23m0011.cn.ibm.com ([9.181.32.74]) by d23av01.au.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id k6S5bCtU001340 for ; Fri, 28 Jul 2006 15:37:13 +1000 Received: from [9.181.107.166] ([9.181.107.166]) by d23m0011.cn.ibm.com (Lotus Domino Release 6.5.5HF262) with ESMTP id 2006072813354942-3079 ; Fri, 28 Jul 2006 13:35:49 +0800 Message-ID: <44C9A23C.60702@gmail.com> Date: Fri, 28 Jul 2006 13:35:56 +0800 From: "Jimmy, Jing Lv" User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) MIME-Version: 1.0 To: harmony-dev@incubator.apache.org Subject: Re: [classLib]Given a long value, RI behaves differently on windows and linux (and TestNG?) References: <44C5C171.3020104@gmail.com> <2c9597b90607250432y5e273bffy2b7d16fdaec1992@mail.gmail.com> <44C721CE.3030509@gmail.com> In-Reply-To: X-MIMETrack: Itemize by SMTP Server on D23M0011/23/M/IBM(Release 6.5.5HF262 | April 5, 2006) at 28/07/2006 13:35:49, Serialize by Router on D23M0011/23/M/IBM(Release 6.5.5HF262 | April 5, 2006) at 28/07/2006 13:37:13, Serialize complete at 28/07/2006 13:37:13 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-8859-1; format=flowed X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Mikhail Fursov wrote: > The comments to this bug > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5105464 > can give us some additional thoughts. > As follows from this comment any (positive or negative) value could be if >> MAX_INTEGER is passed. > So I propose not to follow RI here. > > The comment: > "Indeed, FileChannelImpl.transferFromArbitraryChannel casts a long value to > an int, it gets a negative value if the long value is bigger than > Integer.MAX_VALUE" > Hi, Thanks, Mikhail :) I read though that bug detail, but I think this is not the same thing we are talking about. That bug was caused by a long-to-integer-cast, "Integer.MAX_VALUE + 1" is a integer value that is less than zero. The evaluation of that bug says: "... file.transferFrom(socket, 0, Integer.MAX_VALUE + 1); this is not correct, it should be: file.transferFrom(socket, 0, (long)Integer.MAX_VALUE + 1L); ..." And it throws IllegalArgumentException. But in our topic, the IOException was caused by native operation. The question is, shall we modify native code/Harmony portlib to allow system-call deal with the long parameter itself, instead of dealing it in Harmony code? RI seems doing in this way. > On 7/26/06, Jimmy, Jing Lv wrote: >> >> Alexei Zakharov wrote: >> > Hi, >> > >> > Is there any known real applications that use NIO for reading stuff >> > with 4GB blocks? >> > >> >> I've never heard of that. However, I believe there may be some in the >> future, or the operation system may support this. That's the reason I >> suggest Harmony use system call to solve the problem, not cut long to a >> integer in Harmony's Java or native code. >> Currently the problem is that the portlib has ignored the difference >> between Linux and windows, so we see no difference in Harmony, while RI >> behaves differently. >> >> And again, any sounds for TestNG? :) >> >> > >> > Regards, >> > >> > 2006/7/25, Leo Li : >> >> 2006/7/25, Jimmy, Jing Lv : >> >> > >> >> > Hi: >> >> > >> >> > I find another platform-dependent operation >> >> > FileChannel.transforFrom(ReadableByteChannel src, long position, >> long >> >> > count) in java.nio.channels. RI behaves differently if the given >> count >> >> > is larger than Integer.MAX_VALUE: on windows, it throws an >> IOException; >> >> > on Linux, it return zero silently. It is clear that the >> difference is >> >> > caused by system call. Unfortunately Harmony fails to behave like RI >> as >> >> > its has the same native code using the port-lib. >> >> > If it is necessary to make Harmony behaving exactly like RI, I >> >> > suggest writing native code for transforFrom. This may be a >> >> > waste-of-effect as it is nearly the same except for this little >> >> > difference.However, currently people have few chances to use a size >> >> > larger than Integer.MAX_VALUE(nearly 4G, is it?), and system call >> does >> >> > not support long value to pass in. >> >> > >> >> > Another thing I'd like to mention is that it'll be great if we >> can >> >> > use testNG, or decide some other way to go. At least 2 testcases >> should >> >> > be written for different platform as I remember, including the one >> for >> >> > this problem. :) >> >> > >> >> > -- >> >> > >> >> > Best Regards! >> >> > >> >> > Jimmy, Jing Lv >> >> > 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 >> >> > >> >> > Dear Jimmy: >> >> As spec is not clear about how to deal with the argument >> greater >> >> than Integer.MAX_VALUE, maybe we shall look more closely at what RI >> >> does and >> >> how the system call behaves. >> >> I think it will be a good idea to let native code or even >> system >> >> call itself treat with such affairs, provided that Harmony will >> >> support some >> >> 64-bit platforms one day. Thus it may be not so wise to throw some >> >> exception in java code if encountering the data longer than 32-bits. >> >> Besides, whether we should behaves the same as RI, even if >> it is >> >> different on different platforms? :) >> >> >> >> >> >> >> >> -- >> >> Leo Li >> >> China Software Development Lab, IBM >> > >> > >> >> >> -- >> >> Best Regards! >> >> Jimmy, Jing Lv >> 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 >> >> > > -- Best Regards! Jimmy, Jing Lv 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