jmcnally    02/01/16 18:03:52

  Modified:    src/java/org/apache/stratum/xo Mapper.java
  Log:
  do not swallow exceptions.
  
  Revision  Changes    Path
  1.11      +8 -26     
jakarta-turbine-stratum/src/java/org/apache/stratum/xo/Mapper.java
  
  Index: Mapper.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/xo/Mapper.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Mapper.java       15 Jan 2002 14:04:52 -0000      1.10
  +++ Mapper.java       17 Jan 2002 02:03:52 -0000      1.11
  @@ -140,7 +140,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Jason van Zyl</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Daniel Rall</a>
  - * @version $Id: Mapper.java,v 1.10 2002/01/15 14:04:52 dlr Exp $
  + * @version $Id: Mapper.java,v 1.11 2002/01/17 02:03:52 jmcnally Exp $
    */
   
   // How to use the resources package to pull in the
  @@ -382,15 +382,7 @@
                           
                           if (o == null)
                           {
  -                            // Catch this
  -                            try
  -                            {
  -                                o = createInstance((Element) node, null);
  -                            }
  -                            catch (Exception e)
  -                            {
  -                                debug("Problem instantiating class: " + e);
  -                            }
  +                            o = createInstance((Element) node, null);
                           }                            
                           
                           // Now we have to attach the newly created object
  @@ -427,20 +419,9 @@
                           {
                               debug("Using className metadata to build object");
   
  -                            try
  -                            {
  -                                o = createInstance((Element) node, null);
  -                            }
  -                            catch (Exception e)
  -                            {
  -                                debug("Problem instantiating class: " + e);
  -                            }
  -
  -                            if (o != null)
  -                            {
  -                                debug("Created new object -> " +
  -                                      o.getClass().getName());
  -                            }
  +                            o = createInstance((Element) node, null);
  +                            debug("Created new object -> " +
  +                                  o.getClass().getName());
                           }
                           else
                           {
  @@ -532,6 +513,7 @@
               if (className == null || className.length() == 0)
               {
                   className = element.attributeValue(CLASS_NAME);
  +                debug(CLASS_NAME + " attribute -> " + className);
               }
               return Class.forName(className).newInstance();
           }
  @@ -543,7 +525,7 @@
               if (basePackage == null)
               {
                   throw new Exception("Base package not known and " + CLASS_NAME +
  -                                    " attribute not specified");
  +                                    " attribute not specified (or wrong)");
               }
               className = (basePackage.length() == 0 ? "" : basePackage + '.') +
                   nodeName.substring(0, 1).toUpperCase() + nodeName.substring(1);
  @@ -556,7 +538,7 @@
               {
                   throw new Exception
                       ("No class name for node '" + element.getName() +
  -                     "': This can be resolved by adding a " + CLASS_NAME +
  +                     "': This may be resolved by adding a " + CLASS_NAME +
                        " attribute");
               }
           }
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to