Return-Path: Delivered-To: apmail-xml-forrest-dev-archive@xml.apache.org Received: (qmail 58156 invoked by uid 500); 28 Nov 2002 15:51:42 -0000 Mailing-List: contact forrest-cvs-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: forrest-dev@xml.apache.org Delivered-To: mailing list forrest-cvs@xml.apache.org Received: (qmail 58144 invoked from network); 28 Nov 2002 15:51:41 -0000 Received: from icarus.apache.org (63.251.56.143) by daedalus.apache.org with SMTP; 28 Nov 2002 15:51:41 -0000 Received: (qmail 13664 invoked by uid 1352); 28 Nov 2002 15:51:41 -0000 Date: 28 Nov 2002 15:51:41 -0000 Message-ID: <20021128155141.13662.qmail@icarus.apache.org> From: jefft@apache.org To: xml-forrest-cvs@apache.org Subject: cvs commit: xml-forrest/src/scratchpad/src/java/org/apache/forrest/components/sourcetype SourceTypeAction.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N jefft 2002/11/28 07:51:41 Modified: src/scratchpad/src/java/org/apache/forrest/components/sourcetype SourceTypeAction.java Log: Comments, and getLogger().isDebugEnabled() around log statements. Submitted by: Bruno Dumon Revision Changes Path 1.3 +8 -2 xml-forrest/src/scratchpad/src/java/org/apache/forrest/components/sourcetype/SourceTypeAction.java Index: SourceTypeAction.java =================================================================== RCS file: /home/cvs/xml-forrest/src/scratchpad/src/java/org/apache/forrest/components/sourcetype/SourceTypeAction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- SourceTypeAction.java 4 Nov 2002 10:53:53 -0000 1.2 +++ SourceTypeAction.java 28 Nov 2002 15:51:41 -0000 1.3 @@ -111,6 +111,8 @@ // note: namespace-aware parsing is by default true SourceInfo sourceInfo = new SourceInfo(); + // pull-parse the document until we reach the document element and put the collected information + // into the sourceInfo object try { XMLEvent event; @@ -142,9 +144,11 @@ } finally { + // this will also close the inputstream parser.cleanup(); } + // Run over the SourceTypes until one is found that matches the information collected in sourceInfo Iterator sourceTypeIt = sourceTypes.iterator(); while (sourceTypeIt.hasNext()) { @@ -153,11 +157,13 @@ { HashMap returnMap = new HashMap(); returnMap.put("sourcetype", sourceType.getName()); - getLogger().debug("SourceTypeAction: found sourcetype " + sourceType.getName() + " for source " + src); + if (getLogger().isDebugEnabled()) + getLogger().debug("SourceTypeAction: found sourcetype " + sourceType.getName() + " for source " + src); return returnMap; } } - getLogger().debug("SourceTypeAction: found no sourcetype for source " + src); + if (getLogger().isDebugEnabled()) + getLogger().debug("SourceTypeAction: found no sourcetype for source " + src); return null; } }