You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ps...@apache.org on 2004/11/03 22:40:51 UTC

svn commit: rev 56529 - incubator/directory/naming/trunk/factory/src/java/org/apache/naming/factory

Author: psteitz
Date: Wed Nov  3 13:40:51 2004
New Revision: 56529

Modified:
   incubator/directory/naming/trunk/factory/src/java/org/apache/naming/factory/BeanFactory.java
Log:
Added support for boolean values and chained exceptions.
Jira: DIRNAMING-4
Contributed by: Jarek Gawor


Modified: incubator/directory/naming/trunk/factory/src/java/org/apache/naming/factory/BeanFactory.java
==============================================================================
--- incubator/directory/naming/trunk/factory/src/java/org/apache/naming/factory/BeanFactory.java	(original)
+++ incubator/directory/naming/trunk/factory/src/java/org/apache/naming/factory/BeanFactory.java	Wed Nov  3 13:40:51 2004
@@ -186,6 +186,9 @@
                             } else if (propType.equals(Double.class) 
                                        || propType.equals(double.class)) {
                                 valueArray[0] = new Double(value);
+                            } else if (propType.equals(Boolean.class)
+                                       || propType.equals(boolean.class)) {
+                                valueArray[0] = new Boolean(value);
                             } else {
                                 throw new NamingException
                                     ("String conversion for property type '"
@@ -217,13 +220,21 @@
                 return bean;
 
             } catch (java.beans.IntrospectionException ie) {
-                throw new NamingException(ie.getMessage());
+                NamingException ne = new NamingException(ie.getMessage());
+                ne.setRootCause(ie);
+                throw ne;
             } catch (java.lang.IllegalAccessException iae) {
-                throw new NamingException(iae.getMessage());
+                NamingException ne = new NamingException(iae.getMessage());
+                ne.setRootCause(iae);
+                throw ne;
             } catch (java.lang.InstantiationException ie2) {
-                throw new NamingException(ie2.getMessage());
+                NamingException ne = new NamingException(ie2.getMessage());
+                ne.setRootCause(ie2);
+                throw ne;
             } catch (java.lang.reflect.InvocationTargetException ite) {
-                throw new NamingException(ite.getMessage());
+                NamingException ne = new NamingException(ite.getMessage());
+                ne.setRootCause(ite);
+                throw ne;
             }
 
         } else {