Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 58532 invoked from network); 22 Nov 2007 23:32:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Nov 2007 23:32:32 -0000 Received: (qmail 64280 invoked by uid 500); 22 Nov 2007 23:32:19 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 64191 invoked by uid 500); 22 Nov 2007 23:32:19 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 64180 invoked by uid 99); 22 Nov 2007 23:32:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Nov 2007 15:32:19 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of joerg.heinicke@gmx.de designates 213.165.64.20 as permitted sender) Received: from [213.165.64.20] (HELO mail.gmx.net) (213.165.64.20) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 22 Nov 2007 23:32:08 +0000 Received: (qmail invoked by alias); 22 Nov 2007 23:32:00 -0000 Received: from c-68-39-239-103.hsd1.pa.comcast.net (EHLO c-68-39-239-103.hsd1.pa.comcast.net) [68.39.239.103] by mail.gmx.net (mp006) with SMTP; 23 Nov 2007 00:32:00 +0100 X-Authenticated: #3483660 X-Provags-ID: V01U2FsdGVkX18M2FtsD7wMBOJZ/B1Kxd2Ogz//0b2JS1RHt7yJBH uM19hWQLXnPlO9 Message-ID: <4746116D.3040700@gmx.de> Date: Thu, 22 Nov 2007 18:31:57 -0500 From: Joerg Heinicke User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.8) Gecko/20071008 SeaMonkey/1.1.5 MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: Re: svn commit: r597440 - /cocoon/trunk/core/cocoon-configuration/cocoon-configuration-api/src/main/java/org/apache/cocoon/configuration/PropertyHelper.java References: <20071122154901.D24721A9832@eris.apache.org> In-Reply-To: <20071122154901.D24721A9832@eris.apache.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Virus-Checked: Checked by ClamAV on apache.org On 22.11.2007 10:49 Uhr, giacomo@apache.org wrote: > Author: giacomo > Date: Thu Nov 22 07:49:00 2007 > New Revision: 597440 > > URL: http://svn.apache.org/viewvc?rev=597440&view=rev > Log: > fixing NPE > > Modified: > cocoon/trunk/core/cocoon-configuration/cocoon-configuration-api/src/main/java/org/apache/cocoon/configuration/PropertyHelper.java > > Modified: cocoon/trunk/core/cocoon-configuration/cocoon-configuration-api/src/main/java/org/apache/cocoon/configuration/PropertyHelper.java > URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-configuration/cocoon-configuration-api/src/main/java/org/apache/cocoon/configuration/PropertyHelper.java?rev=597440&r1=597439&r2=597440&view=diff > ============================================================================== > --- cocoon/trunk/core/cocoon-configuration/cocoon-configuration-api/src/main/java/org/apache/cocoon/configuration/PropertyHelper.java (original) > +++ cocoon/trunk/core/cocoon-configuration/cocoon-configuration-api/src/main/java/org/apache/cocoon/configuration/PropertyHelper.java Thu Nov 22 07:49:00 2007 > @@ -159,8 +159,10 @@ > String value = props.getProperty(key); > // replace > value = replace(value, props, settings); > - // and put back > - props.put(key, value); > + // and put back but prevent NPE because of null value ?!?!? > + // TODO: How to handle value==null situations? > + if (value != null) > + props.put(key, value); > } > } > } How can this be null after all? From what I see value can only be null if value was null in the first place, i.e. before replace(..). This means that null must already have been in the Properties object which is kind of impossible since Properties.put(..) inherited from HashTable throws NPE on value being null. Where do you have this Properties object from which is only injected by the user into AbstractSettingsBeanFactoryPostProcessor? Joerg