Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 51772 invoked from network); 27 Nov 2006 20:01:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Nov 2006 20:01:14 -0000 Received: (qmail 17570 invoked by uid 500); 27 Nov 2006 20:01:20 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 17541 invoked by uid 500); 27 Nov 2006 20:01:20 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 17485 invoked by uid 99); 27 Nov 2006 20:01:19 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Nov 2006 12:01:18 -0800 X-ASF-Spam-Status: No, hits=0.3 required=10.0 tests=MAILTO_TO_SPAM_ADDR,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of jason.dillon@gmail.com designates 66.249.92.169 as permitted sender) Received: from [66.249.92.169] (HELO ug-out-1314.google.com) (66.249.92.169) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Nov 2006 12:01:03 -0800 Received: by ug-out-1314.google.com with SMTP id m2so1645850ugc for ; Mon, 27 Nov 2006 12:00:42 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer:sender; b=IVJt5C4gATPYXbSRLnTrXJf9XoaZtPmG/XdBoAo8LkoWow7KLZywQdBQqV+823TdMTzUkXCNhniux8hND6B24TNzVt8n7rBIz2oGvQOywGl0HDjMXYmi9ZE3vYxyEx2ePhLK2sonqxWz3dIKR+/F5y/f6npvIeNohParU2PEYdA= Received: by 10.78.201.2 with SMTP id y2mr13608973huf.1164657640983; Mon, 27 Nov 2006 12:00:40 -0800 (PST) Received: from ?10.0.1.3? ( [24.7.69.241]) by mx.google.com with ESMTP id 33sm21590913hue.2006.11.27.12.00.39; Mon, 27 Nov 2006 12:00:40 -0800 (PST) In-Reply-To: <20061127105439.765D71A984A@eris.apache.org> References: <20061127105439.765D71A984A@eris.apache.org> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <577C5BED-E5EB-4A69-8BD1-DB8392607E82@planet57.com> Cc: scm@geronimo.apache.org Content-Transfer-Encoding: 7bit From: Jason Dillon Subject: Re: svn commit: r479586 - /geronimo/server/trunk/modules/geronimo-common/src/main/java/org/apache/geronimo/common/propertyeditor/MapEditor.java Date: Mon, 27 Nov 2006 11:58:44 -0800 To: dev@geronimo.apache.org X-Mailer: Apple Mail (2.752.3) Sender: Jason Dillon X-Virus-Checked: Checked by ClamAV on apache.org Please... please... please... put more context into the commit log. "MapEditor does not work" tells me nothing about what was actually changed. When auditing changes it helps to have some context to the change in the commit log so that its easy to comprehend what the change was, with out having to dig around, or bounce into JIRA, etc. I've mentioned this a few times before... while its is good to include the JIRA issue ID, only including that ID, or in this case the ID and the issue subject, in the SVN commit message is not sufficient. Please... please... please... try to put some more meaningful context into commit messages. Thanks, --jason On Nov 27, 2006, at 2:54 AM, vamsic007@apache.org wrote: > Author: vamsic007 > Date: Mon Nov 27 02:54:38 2006 > New Revision: 479586 > > URL: http://svn.apache.org/viewvc?view=rev&rev=479586 > Log: > GERONIMO-2458 MapEditor does not work > > Modified: > geronimo/server/trunk/modules/geronimo-common/src/main/java/org/ > apache/geronimo/common/propertyeditor/MapEditor.java > > Modified: geronimo/server/trunk/modules/geronimo-common/src/main/ > java/org/apache/geronimo/common/propertyeditor/MapEditor.java > URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/ > geronimo-common/src/main/java/org/apache/geronimo/common/ > propertyeditor/MapEditor.java?view=diff&rev=479586&r1=479585&r2=479586 > ====================================================================== > ======== > --- geronimo/server/trunk/modules/geronimo-common/src/main/java/org/ > apache/geronimo/common/propertyeditor/MapEditor.java (original) > +++ geronimo/server/trunk/modules/geronimo-common/src/main/java/org/ > apache/geronimo/common/propertyeditor/MapEditor.java Mon Nov 27 > 02:54:38 2006 > @@ -19,17 +19,22 @@ > > import java.io.ByteArrayInputStream; > import java.io.IOException; > +import java.util.Iterator; > import java.util.Properties; > import java.util.Map; > > +import org.apache.commons.logging.Log; > +import org.apache.commons.logging.LogFactory; > + > /** > - * A property editor for {@link java.util.Properties}. > + * A property editor for {@link java.util.Map}. > * > * @version $Rev$ $Date$ > */ > public class MapEditor > extends TextPropertyEditorSupport > { > + private static final Log log = LogFactory.getLog > (MapEditor.class); > /** > * > * @throws PropertyEditorException An IOException occured. > @@ -50,11 +55,30 @@ > Map map = (Map) getValue(); > if (!(map instanceof Properties)) { > Properties p = new Properties(); > - if (map != null) { > - p.putAll(map); > + if(map != null) { > + if(!map.containsKey(null) && !map.containsValue > (null)) { > + p.putAll(map); > + } else { > + // Map contains null keys or values. Replace > null with empty string. > + log.warn("Map contains null keys or values. > Replacing null values with empty string."); > + for(Iterator itr = map.entrySet().iterator(); > itr.hasNext(); ) { > + Map.Entry entry = (Map.Entry) itr.next(); > + Object key = entry.getKey(); > + Object value = entry.getValue(); > + if(key == null) { > + key = ""; > + } > + if(value == null) { > + value = ""; > + } > + p.put(key, value); > + } > + } > + map = p; > } > - map = p; > } > - return map.toString(); > + PropertiesEditor pe = new PropertiesEditor(); > + pe.setValue(map); > + return pe.getAsText(); > } > } > >