forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From je...@apache.org
Subject cvs commit: xml-forrest/src/scratchpad/src/java/org/apache/forrest/components/sourcetype SourceTypeAction.java
Date Thu, 28 Nov 2002 15:51:41 GMT
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;
       }
   }
  
  
  

Mime
View raw message