Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 19238 invoked from network); 19 Aug 2004 17:21:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 19 Aug 2004 17:21:35 -0000 Received: (qmail 29278 invoked by uid 500); 19 Aug 2004 17:21:29 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 29201 invoked by uid 500); 19 Aug 2004 17:21:29 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 29181 invoked by uid 99); 19 Aug 2004 17:21:29 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [192.18.33.10] (HELO exchange.sun.com) (192.18.33.10) by apache.org (qpsmtpd/0.27.1) with SMTP; Thu, 19 Aug 2004 10:21:26 -0700 Received: (qmail 11574 invoked by uid 50); 19 Aug 2004 17:23:04 -0000 Date: 19 Aug 2004 17:23:04 -0000 Message-ID: <20040819172304.11573.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: commons-dev@jakarta.apache.org Cc: Subject: DO NOT REPLY [Bug 30759] New: - [Patch] Problem with id attribute, caused NullPointerException X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=30759 [Patch] Problem with id attribute, caused NullPointerException Summary: [Patch] Problem with id attribute, caused NullPointerException Product: Commons Version: 1.0 Beta 1 Platform: Other OS/Version: All Status: NEW Severity: Minor Priority: Other Component: Betwixt AssignedTo: commons-dev@jakarta.apache.org ReportedBy: cgaffga@triplemind.com CC: cgaffga@triplemind.com we had code like: in the bean: private Integer id = null; public Integer getId() { return this.id; } in the dot-betwixt file: and refactored our bean, so it became: private Integer productId = null; public Integer getProductId { return this.productId; } we forgot to change the dot-betwixt file, thus betwixt came up with a NullPointerException (attached at the bottom). We spent some hours <:-( debugging this, because we did't thought that it's about the forgotten change in the dot-betwixt file, sometimes I'm such an idiot. So it would be nice to have an exception that makes it a little bit clearer, what the problem could be, instead just having a NullPointerException. So, here is my patch to the AbstractBeanWriter to do so, peheaps this is not the perfect place to fix this, but it works. regards Christoph Gaffga cgaffga@triplemind.com I attached the patch to this bug report. See the NullPointerException below, wouldn't happen with the patch version. java.lang.NullPointerException at org.apache.commons.betwixt.io.AbstractBeanWriter.writeBean(AbstractBeanWriter.java:289) at org.apache.commons.betwixt.io.AbstractBeanWriter.writeElementContent(AbstractBeanWriter.java:834) at org.apache.commons.betwixt.io.AbstractBeanWriter.writeElement(AbstractBeanWriter.java:637) at org.apache.commons.betwixt.io.AbstractBeanWriter.writeElementContent(AbstractBeanWriter.java:851) at org.apache.commons.betwixt.io.AbstractBeanWriter.writeElement(AbstractBeanWriter.java:637) at org.apache.commons.betwixt.io.AbstractBeanWriter.writeBean(AbstractBeanWriter.java:302) at org.apache.commons.betwixt.io.AbstractBeanWriter.write(AbstractBeanWriter.java:155) at org.apache.commons.betwixt.io.BeanWriter.write(BeanWriter.java:190) at com.triplemind.test.TestBetwixt.main(TestBetwixt.java:41) --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org