Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 98475 invoked from network); 5 Dec 2006 02:04:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Dec 2006 02:04:50 -0000 Received: (qmail 48585 invoked by uid 500); 5 Dec 2006 02:04:52 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 48542 invoked by uid 500); 5 Dec 2006 02:04:52 -0000 Mailing-List: contact dev-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 dev@harmony.apache.org Received: (qmail 48522 invoked by uid 99); 5 Dec 2006 02:04:52 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Dec 2006 18:04:52 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of wuyuehao@gmail.com designates 66.249.82.233 as permitted sender) Received: from [66.249.82.233] (HELO wx-out-0506.google.com) (66.249.82.233) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Dec 2006 18:04:41 -0800 Received: by wx-out-0506.google.com with SMTP id i26so3765794wxd for ; Mon, 04 Dec 2006 18:04:20 -0800 (PST) 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:content-transfer-encoding:content-disposition:references; b=QFNOkJ61j0QVdQAuXmSJXTvHZV/OItcpsDFS6K8yzk9B/Mqnkc4Ysddqea/0Yy5wXPd7Reu+3HHf6JPudT0d81nGXpeKN+Pi9uFPTNr6FMzqjwh17hjpRnfjR1jxLs9H3vEvj83N6PouuLnQc+hg4SL/IU6NVuZm7ksMMCyssvI= Received: by 10.70.130.19 with SMTP id c19mr16439907wxd.1165284260025; Mon, 04 Dec 2006 18:04:20 -0800 (PST) Received: by 10.70.54.5 with HTTP; Mon, 4 Dec 2006 18:04:19 -0800 (PST) Message-ID: <211709bc0612041804o7cf32fc8g2936b28252e8f8ed@mail.gmail.com> Date: Tue, 5 Dec 2006 10:04:19 +0800 From: "Tony Wu" To: dev@harmony.apache.org Subject: Re: svn commit: r480871 - in /harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/lang/ProcessBuilder.java main/java/org/apache/harmony/luni/platform/Environment.java test/java/org/apache/harmony/luni/tests/java/lang/SystemTest.java In-Reply-To: <3b3f27c60612041754j29946ccfp9cc69a36d6dddb53@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20061130081959.0B5381A9846@eris.apache.org> <4570467F.5010207@pobox.com> <211709bc0612032250u15c98f97k6a4f103056c9476@mail.gmail.com> <45742354.20203@pobox.com> <3b3f27c60612041754j29946ccfp9cc69a36d6dddb53@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org And AFAIK, the value is generated according to the field of the class. So is it correct that the generated SID will be 1L if no field present? On 12/5/06, Nathan Beyer wrote: > That's not a magic value. A serial version UID of 1 is considered, by > some, a default value. I know that within a Eclipse, you can either > generate a value (ala serialver tool) or insert the default value > (1L). > > The serial version UID is an arbitrary value that's meant to be a > marker for a given class if two serialized objects are compatible. > Using small iterative values (1, 2, etc) is really no different than > using a complex weighted calculation that changes when the class > changes. As long as the number changes or doesn't change for a given > class, then the compatability or incompatibility, respectively, is > deterministic. > > -Nathan > > On 12/4/06, Geir Magnusson Jr. wrote: > > > > > > Alexey Varlamov wrote: > > > 2006/12/4, Tony Wu : > > >> This class will never be serialized. I think the meanless variable > > >> here is created to avoid compiler warining. > > > > > > How about using @SupressWarnings("serial")? It is more readable IMO. > > > > Thank you. I didn't know what to suggest, but a magic value was > > misleading w/o a comment... > > > > geir > > > > > > > >> > > >> On 12/1/06, Geir Magnusson Jr. wrote: > > >> > > > >> > > > >> > liangyx@apache.org wrote: > > >> > > Author: liangyx > > >> > > Date: Thu Nov 30 00:19:55 2006 > > >> > > New Revision: 480871 > > >> > > > > >> > > URL: http://svn.apache.org/viewvc?view=rev&rev=480871 > > >> > > Log: > > >> > > Apply patch for HARMONY-2356 ([classlib][luni]The Map from > > >> System.getEnv should throw NullPointerException while get(null) and is > > >> not modifiable.) > > >> > > > > >> > > Modified: > > >> > > > > >> harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ProcessBuilder.java > > >> > > >> > > > > >> harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/Environment.java > > >> > > >> > > > > >> harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/SystemTest.java > > >> > > >> > > > > >> > > > >> > > + > > >> > > + public static class EnvironmentMap extends HashMap > >> String> { > > >> > > + > > >> > > + private static final long serialVersionUID = 1L; > > >> > > + > > >> > > + public EnvironmentMap() { > > >> > > + super(); > > >> > > + } > > >> > > + > > >> > > + public EnvironmentMap(Map map) { > > >> > > + super(map); > > >> > > + } > > >> > > + > > >> > > + public boolean containsKey(Object key) { > > >> > > + checkParam(key); > > >> > > + return super.containsKey(key); > > >> > > + } > > >> > > > >> > > > >> > > > >> > I'm curious - why set the ServialVersionUID to 1? > > >> > > > >> > geir > > >> > > > >> > > >> > > >> -- > > >> Tony Wu > > >> China Software Development Lab, IBM > > >> > > > -- Tony Wu China Software Development Lab, IBM