Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 19530 invoked from network); 20 Oct 2010 15:32:58 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 20 Oct 2010 15:32:58 -0000 Received: (qmail 2845 invoked by uid 500); 20 Oct 2010 15:32:57 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 2767 invoked by uid 500); 20 Oct 2010 15:32:57 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 2759 invoked by uid 99); 20 Oct 2010 15:32:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Oct 2010 15:32:57 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gudnabrsam@gmail.com designates 74.125.83.43 as permitted sender) Received: from [74.125.83.43] (HELO mail-gw0-f43.google.com) (74.125.83.43) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Oct 2010 15:32:48 +0000 Received: by gwb11 with SMTP id 11so2132931gwb.30 for ; Wed, 20 Oct 2010 08:32:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:content-type:mime-version :subject:from:in-reply-to:date:content-transfer-encoding:message-id :references:to:x-mailer; bh=KSDD06N9TlJyNxe708L6tGWe34SqPzSSEV//vTzdej0=; b=dqlIa24nsRwLcl0t0j8lOUlLf3VyHrqE/ZAXfhHhBzyulaC86TWPljMbc1obxIPbdV qog0SqoAoZVieivmauK6E+10a4baUI7GhsFp+Zepm4E3/gGdDhDC/IIWB492fRIqCxHh pP+vKFENe8i9pgicHllT+EeYlQkwYGeD4qJqI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=Xz0L58CpNI7wanR8yJMXeepQZfMC5Ij4B5iymPC0HQIDfzOoeQL/lJsbvJksQ8JY2y yLwOC4MtQ7eFtSp79vz/+iYGzlCJ4s7mmpAlbhsDAo1qTQI4reuer1ImMlqxZMV3sm27 iCuJE9VwpSYSE5uvv7CtE9U9dad+7HBE9WkLA= Received: by 10.42.121.139 with SMTP id j11mr5755680icr.208.1287588746787; Wed, 20 Oct 2010 08:32:26 -0700 (PDT) Received: from [192.168.1.209] (adsl-068-213-090-227.sip.bhm.bellsouth.net [68.213.90.227]) by mx.google.com with ESMTPS id t14sm264884yhc.8.2010.10.20.08.32.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 20 Oct 2010 08:32:26 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1081) Subject: Re: [COLLECTIONS] ExtendedProperties oddities From: Matt Benson In-Reply-To: Date: Wed, 20 Oct 2010 10:32:00 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: "Commons Developers List" X-Mailer: Apple Mail (2.1081) X-Virus-Checked: Checked by ClamAV on apache.org On Oct 19, 2010, at 9:29 PM, sebb wrote: > IMO, the ExtendedProperties class has rather odd behaviour. >=20 > It is documented as an extension of normal Java properties, yet it > allows Objects to be used as values: >=20 > addProperty(String, Object) > setProperty(String, Object) >=20 > The save() method ignores anything but String and List, so it > won't save such values. >=20 > The following sequence fails: >=20 > eprop.addProperty("xxx", "true"); > eprop.getString("xxx"); > eprop.getBoolean("xxx"); > eprop.getString("xxx"); // ClassCastException: 'xxx' doesn't map to a > String object >=20 > This is because the call to getBoolean() replaces the String value > with a Boolean value. > Presumably this is intended to make it faster to retrieve next time, > but it's rather unexpected for a get() method to change the value. >=20 > Is this behaviour really intended? >=20 > If there really is a use case for including non-String values, then it > seems to me that load() and save() ought to handle these. >=20 > In any case, it seems to me that the get() behaviour ought to be = changed. No comment, other than that now you can see why I didn't touch this = class when I was working in the branch. -Matt >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > For additional commands, e-mail: dev-help@commons.apache.org >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org