Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 59492 invoked from network); 15 Jun 2002 03:46:17 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 15 Jun 2002 03:46:17 -0000 Received: (qmail 23014 invoked by uid 97); 15 Jun 2002 03:46:27 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 22984 invoked by uid 97); 15 Jun 2002 03:46:26 -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 22972 invoked by uid 98); 15 Jun 2002 03:46:26 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: Fri, 14 Jun 2002 20:46:11 -0700 (PDT) From: "Craig R. McClanahan" To: Jakarta Commons Developers List Subject: Re: [Digester] Digester.peek very verbose.. In-Reply-To: <1024092324.11294.536.camel@swami> Message-ID: <20020614204134.G19197-100000@icarus.apache.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: localhost 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On 15 Jun 2002, Martin van den Bemt wrote: > Date: 15 Jun 2002 00:05:24 +0200 > From: Martin van den Bemt > Reply-To: Jakarta Commons Developers List > To: Jakarta Commons Developers List > Subject: [Digester] Digester.peek very verbose.. > > Hi, > > I just fixed some "annoying" message we got in betwixt saying "[WARN] > Empty stack return null". > > on the Digester.peek() methods and the pop() method it is documented > that it will return null when there are no more objects on the stack. So > I think it can be assumed that developers know they have to check for > null, which makes the loglevel of WARN to verbose for these methods. > > Anyone in favour of moving it to DEBUG or TRACE level ? > I'm not in favor of this, but not adamantly opposed either. It's a common programming mistake to attempt to pop a stack more times than you have pushed -- and hiding the corresponding log message makes it more likely that naive developers will end up with an NPE someplace, which is generally harder to debug. Besides, avoiding this message is trivially simple: Object peekObject = null; if (digester.getCount() > 0) { peekObject = digester.peek(); } else { ... something is wrong ... there is nothing on the stack! ... } Personally, I'd rather "annoy" folks into defenseive programming :-). > Mvgr, > Martin > Craig -- To unsubscribe, e-mail: For additional commands, e-mail: