Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 63948 invoked from network); 22 Jul 2004 18:30:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 22 Jul 2004 18:30:50 -0000 Received: (qmail 56615 invoked by uid 500); 22 Jul 2004 18:30:20 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 56554 invoked by uid 500); 22 Jul 2004 18:30:20 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 56529 invoked by uid 99); 22 Jul 2004 18:30:19 -0000 X-ASF-Spam-Status: No, hits=2.1 required=10.0 tests=FROM_ENDS_IN_NUMS,HTML_60_70,HTML_MESSAGE,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [129.9.82.74] (HELO fxodpr13.extra.daimlerchrysler.com) (129.9.82.74) by apache.org (qpsmtpd/0.27.1) with ESMTP; Thu, 22 Jul 2004 11:30:18 -0700 Received: (from uucp@localhost) by fxodpr13.extra.daimlerchrysler.com (8.12.8/8.9.0) id i6MIUF8c027966 for ; Thu, 22 Jul 2004 14:30:15 -0400 (EDT) Received: from unknown(53.231.71.24) by fxodpr13.extra.daimlerchrysler.com via csmap (V6.0) id srcAAAgAaON2; Thu, 22 Jul 04 14:30:15 -0400 Received: from odconpr2-hme0.oddc.chrysler.com ([127.0.0.1]) by odconpr2-hme0.oddc.chrysler.com (Mail-Gear 2.0.0 bld 66) with SMTP id M2004072214301503449 for ; Thu, 22 Jul 2004 14:30:15 -0400 Received: from odmrspr2-hme0.oddc.chrysler.com ([53.231.2.113]) by odconpr2-hme0.oddc.chrysler.com (SMSSMTP 4.0.0.59) with SMTP id M2004072214301523176 for ; Thu, 22 Jul 2004 14:30:15 -0400 Received: from shsecpr1-ce0.shdc.chrysler.com (shsecpr1-ce0.shdc.chrysler.com [53.231.128.176]) by odmrspr2-hme0.oddc.chrysler.com (8.12.10/8.12.10/daimlerchrysler-relay-1.1-kcd) with SMTP id i6MIU1RI011670 for ; Thu, 22 Jul 2004 14:30:15 -0400 (EDT) Received: from sodddg04.wk.dcx.com ([53.231.136.243]) by shsecpr1-ce0.shdc.chrysler.com (SMSSMTP 4.0.0.59) with SMTP id M2004072214301509137 for ; Thu, 22 Jul 2004 14:30:15 -0400 To: commons-user@jakarta.apache.org Subject: [beanutils] copyProperties from Boolean to boolean MIME-Version: 1.0 X-Mailer: Lotus Notes Release 5.0.11 July 24, 2002 Message-ID: From: bb26@daimlerchrysler.com Date: Thu, 22 Jul 2004 14:30:14 -0400 X-MIMETrack: Serialize by Router on sodddg04.wk.dcx.com/Server/Prod/DCX(Release 6.0.2CF2|July 23, 2003) at 07/22/2004 14:30:14, Serialize complete at 07/22/2004 14:30:14 Content-Type: multipart/alternative; boundary="=_alternative 0065A53885256ED9_=" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N --=_alternative 0065A53885256ED9_= Content-Type: text/plain; charset="us-ascii" Hi all, My apologies if this is covered somewhere, I was unable to find anything on google. I have two beans with similar signatures, one with a primitive type (boolean) and the other with the wrapper class (Boolean). When the Boolean is set to null and I use copyProperties, I get a NullPointerException. Is this known behaviour, a bug, something else? Specifically i'm using struts and copying a form bean to a backend class. I'll append a test case that demos the problem (Bean1 has the Boolean and Bean2 the boolean). Thanks in Advance, Brian import org.apache.commons.beanutils.PropertyUtils; public class PropTest { public PropTest() { Bean1 bean1 = new Bean1(); bean1.setFlag(null); Bean2 bean2 = new Bean2(); bean2.setFlag(false); try { PropertyUtils.copyProperties(bean2, bean1); } catch (Exception e) { e.printStackTrace(System.err); } } public static void main(String args[]) { PropTest pt = new PropTest(); } } --=_alternative 0065A53885256ED9_=--