Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C9F40F9A7 for ; Sat, 24 Aug 2013 20:00:52 +0000 (UTC) Received: (qmail 21501 invoked by uid 500); 24 Aug 2013 20:00:52 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 21429 invoked by uid 500); 24 Aug 2013 20:00:52 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 21421 invoked by uid 99); 24 Aug 2013 20:00:52 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 24 Aug 2013 20:00:52 +0000 Date: Sat, 24 Aug 2013 20:00:52 +0000 (UTC) From: "Oliver Heger (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (CONFIGURATION-26) Consider returning a concatenation of the list properties with getString() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CONFIGURATION-26?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Oliver Heger resolved CONFIGURATION-26. --------------------------------------- Resolution: Fixed While the requested feature is still not supported out of the box, it is now possible to achieve the desired effect by using a custom {{ConversionHandler}}. Each configuration object is now associated with a {{ConversionHandler}} object. The conversion handler is responsible for all kinds of data type conversions. This includes conversions from complex objects (like arrays or lists) to single values. Here a custom {{ConversionHandler}} implementation can hook in to return a verbatim string value or whatever it sees appropriate. There is already a default implementation called {{DefaultConversionHandler}} which offers some protected methods a subclass may override to adapt conversions. The user's guide was updated to describe these new features. > Consider returning a concatenation of the list properties with getString() > -------------------------------------------------------------------------- > > Key: CONFIGURATION-26 > URL: https://issues.apache.org/jira/browse/CONFIGURATION-26 > Project: Commons Configuration > Issue Type: Bug > Reporter: Ittay Dror > Priority: Minor > Fix For: 2.0 > > > in AbstractConfiguration.resolveContainerStore (javadoc): > * Returns an object from the store described by the key. If the value is a > * List object, replace it with the first object in the list. > but what if getProperty returns a List because this is the type of the property? > this code will silently grab the first elemen. I don't understand why. Probably > the reason is that some class extending AbstractConfiguration returns List for > properties. In this case I think the better approach is to have that class > return the first element instead, rather than returning the List and letting > AbstractConfiguration (which is used by many other implementations, including > outside of the configuration package) handle it -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira