Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 96111 invoked from network); 5 Dec 2006 01:54:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Dec 2006 01:54:39 -0000 Received: (qmail 38498 invoked by uid 500); 5 Dec 2006 01:54:46 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 38466 invoked by uid 500); 5 Dec 2006 01:54:46 -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 38457 invoked by uid 99); 5 Dec 2006 01:54:46 -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 17:54:46 -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 nbeyer@gmail.com designates 66.249.82.235 as permitted sender) Received: from [66.249.82.235] (HELO wx-out-0506.google.com) (66.249.82.235) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Dec 2006 17:54:35 -0800 Received: by wx-out-0506.google.com with SMTP id i26so3763739wxd for ; Mon, 04 Dec 2006 17:54:15 -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=lPsGwwdUkl3CmW0BvtrODpFkM993tHR2ecMjUWoWEQ1ScueM0kC4Xjma34MmbSOcTvzfpxE4ylqRVEqOBGBYZINOvgtmBmEeSUccfhJHDdtfMo9EHn4YQ3dnU1TPwH5FAMbUxvXdNbnMeP2d+9xwivNXx5Dw+0ehD1zTM5cZYuA= Received: by 10.90.117.15 with SMTP id p15mr8922876agc.1165283655166; Mon, 04 Dec 2006 17:54:15 -0800 (PST) Received: by 10.90.66.18 with HTTP; Mon, 4 Dec 2006 17:54:15 -0800 (PST) Message-ID: <3b3f27c60612041754j29946ccfp9cc69a36d6dddb53@mail.gmail.com> Date: Mon, 4 Dec 2006 19:54:15 -0600 From: "Nathan Beyer" 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: <45742354.20203@pobox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; 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> X-Virus-Checked: Checked by ClamAV on apache.org 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 > >> >