You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sc...@apache.org on 2008/03/15 14:33:22 UTC

svn commit: r637409 - /webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/utility/PropertyDescriptorPlus.java

Author: scheu
Date: Sat Mar 15 06:33:22 2008
New Revision: 637409

URL: http://svn.apache.org/viewvc?rev=637409&view=rev
Log:
Add debug trace to PropertyDescriptorPlus to help determine failures.

Modified:
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/utility/PropertyDescriptorPlus.java

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/utility/PropertyDescriptorPlus.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/utility/PropertyDescriptorPlus.java?rev=637409&r1=637408&r2=637409&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/utility/PropertyDescriptorPlus.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/utility/PropertyDescriptorPlus.java Sat Mar 15 06:33:22 2008
@@ -130,26 +130,41 @@
     public void set(Object targetBean, Object propValue)
             throws InvocationTargetException, IllegalAccessException, JAXBWrapperException {
 
-        // No set occurs if the value is null
-        if (propValue == null) {
-            return;
-        }
+        Method writeMethod  = null;
+        try {
+            // No set occurs if the value is null
+            if (propValue == null) {
+                return;
+            }
 
-        // There are 3 different types of setters that can occur.
-        // 1) Normal Attomic Setter : setFoo(type)
-        // 2) Indexed Array Setter : setFoo(type[])
-        // 3) No Setter case if the property is a List<T>.
+            // There are 3 different types of setters that can occur.
+            // 1) Normal Attomic Setter : setFoo(type)
+            // 2) Indexed Array Setter : setFoo(type[])
+            // 3) No Setter case if the property is a List<T>.
 
-        Method writeMethod = descriptor.getWriteMethod();
-        if (descriptor instanceof IndexedPropertyDescriptor) {
-            // Set for indexed  T[]
-            setIndexedArray(targetBean, propValue, writeMethod);
-        } else if (writeMethod == null) {
-            // Set for List<T>
-            setList(targetBean, propValue);
-        } else {
-            // Normal case
-            setAtomic(targetBean, propValue, writeMethod);
+            writeMethod = descriptor.getWriteMethod();
+            if (descriptor instanceof IndexedPropertyDescriptor) {
+                // Set for indexed  T[]
+                setIndexedArray(targetBean, propValue, writeMethod);
+            } else if (writeMethod == null) {
+                // Set for List<T>
+                setList(targetBean, propValue);
+            } else {
+                // Normal case
+                setAtomic(targetBean, propValue, writeMethod);
+            }
+        } catch (RuntimeException e) {
+            
+            if (DEBUG_ENABLED) {
+                String propClass = (propValue == null) ? "null" : propValue.getClass().getName();
+                log.debug("An exception occurred while attempting to set a property on " +
+                          targetBean.getClass().getName());
+                log.debug("The setter method is " + writeMethod );
+                log.debug("The class of the argument is :" +propClass);
+                log.debug("The PropertyDescriptor is: " + this.toString());
+                log.debug("The exception is: " + e);
+            }
+            throw e;
         }
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org