From dev-return-20917-apmail-harmony-dev-archive=harmony.apache.org@harmony.apache.org Tue Dec 05 07:05:49 2006 Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 66607 invoked from network); 5 Dec 2006 07:05:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Dec 2006 07:05:49 -0000 Received: (qmail 26859 invoked by uid 500); 5 Dec 2006 07:05:55 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 26500 invoked by uid 500); 5 Dec 2006 07:05:54 -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 26490 invoked by uid 99); 5 Dec 2006 07:05:54 -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 23:05:54 -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 alexey.v.varlamov@gmail.com designates 66.249.82.225 as permitted sender) Received: from [66.249.82.225] (HELO wx-out-0506.google.com) (66.249.82.225) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Dec 2006 23:05:43 -0800 Received: by wx-out-0506.google.com with SMTP id i26so3823063wxd for ; Mon, 04 Dec 2006 23:05:22 -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=L9m7T2BsohPFGiwLZ+ouV+VoIYqrSbhXgBtZxrPdUvhmooVoV9nbNBId89wXHo0rkYy34VnQK1mfBX9HhR2pe6kT4XtlUBKxEV09ypmn5f4I1mAITUIytNrkLLrX15VRAL0eV/VjxTdX6oPKFCQxj9eBS7h8BbmmLWIyuVfRLTg= Received: by 10.70.19.20 with SMTP id 20mr16846557wxs.1165302322298; Mon, 04 Dec 2006 23:05:22 -0800 (PST) Received: by 10.70.23.14 with HTTP; Mon, 4 Dec 2006 23:05:22 -0800 (PST) Message-ID: Date: Tue, 5 Dec 2006 13:05:22 +0600 From: "Alexey Varlamov" 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: <211709bc0612041804o7cf32fc8g2936b28252e8f8ed@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> <211709bc0612041804o7cf32fc8g2936b28252e8f8ed@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org 2006/12/5, Tony Wu : > 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? No - the value is a hash calculated on a sequence of complete class name, descriptors of it's fields, etc; you may find comprehensive description in the setialization framework specification. So suid == 1L is basically a bogus and indeed may hint it is a no-op default. But still it needs to be commented just for certainty. OTOH @SupressWarnings("serial") is self-documenting. -- Alexey > > 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 >