cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/language/generator GeneratorSelector.java
Date Thu, 28 Feb 2002 14:26:43 GMT
vgritsenko    02/02/28 06:26:43

  Modified:    src/java/org/apache/cocoon/components/language/generator
                        GeneratorSelector.java
  Log:
  Log meaningful exceptions, don't produce NullPointerException
  
  Revision  Changes    Path
  1.9       +8 -3      xml-cocoon2/src/java/org/apache/cocoon/components/language/generator/GeneratorSelector.java
  
  Index: GeneratorSelector.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/generator/GeneratorSelector.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- GeneratorSelector.java	22 Feb 2002 07:00:07 -0000	1.8
  +++ GeneratorSelector.java	28 Feb 2002 14:26:43 -0000	1.9
  @@ -77,7 +77,7 @@
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
    * @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
  - * @version CVS $Id: GeneratorSelector.java,v 1.8 2002/02/22 07:00:07 cziegeler Exp $
  + * @version CVS $Id: GeneratorSelector.java,v 1.9 2002/02/28 14:26:43 vgritsenko Exp $
    */
   public class GeneratorSelector extends ExcaliburComponentSelector implements Disposable
{
   
  @@ -133,13 +133,18 @@
       }
   
       public Component select(Object hint) throws ComponentException {
  +
  +        ComponentHandler handler = (ComponentHandler) this.componentHandlers.get(hint);
  +        if (handler == null) {
  +            throw new ComponentException("Could not find component for hint: " + hint);
  +        }
  +
           try {
  -            ComponentHandler handler = (ComponentHandler) this.componentHandlers.get(hint);
               Component component = (Component) handler.get();
               componentMapping.put(component, handler);
               return component;
           } catch (Exception ce) {
  -            getLogger().debug("Could not access component for hint: " + hint);
  +            getLogger().debug("Could not access component for hint: " + hint, ce);
               throw new ComponentException("Could not access component for hint: " + hint,
null);
           }
       }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message