Author: sagara
Date: Sun Feb  3 12:39:46 2013
New Revision: 1441908

URL: http://svn.apache.org/viewvc?rev=1441908&view=rev
Log:
Merged r1441907 in to 1.6 branch

Modified:
    axis/axis2/java/core/branches/1_6/   (props changed)
    
axis/axis2/java/core/branches/1_6/modules/kernel/src/org/apache/axis2/engine/DefaultObjectSupplier.java
    axis/axis2/java/core/branches/1_6/modules/saaj/   (props changed)

Propchange: axis/axis2/java/core/branches/1_6/
------------------------------------------------------------------------------
  Merged /axis/axis2/java/core/trunk:r1441907

Modified: 
axis/axis2/java/core/branches/1_6/modules/kernel/src/org/apache/axis2/engine/DefaultObjectSupplier.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/branches/1_6/modules/kernel/src/org/apache/axis2/engine/DefaultObjectSupplier.java?rev=1441908&r1=1441907&r2=1441908&view=diff
==============================================================================
--- 
axis/axis2/java/core/branches/1_6/modules/kernel/src/org/apache/axis2/engine/DefaultObjectSupplier.java
 (original)
+++ 
axis/axis2/java/core/branches/1_6/modules/kernel/src/org/apache/axis2/engine/DefaultObjectSupplier.java
 Sun Feb  3 12:39:46 2013
@@ -20,6 +20,7 @@
 package org.apache.axis2.engine;
 
 import java.lang.reflect.Modifier;
+import java.lang.Enum;
 
 import org.apache.axis2.AxisFault;
 
@@ -38,6 +39,14 @@ public class DefaultObjectSupplier imple
                                // those classes have to be instantiated in a 
different way than a normal initialization.
                                instance = clazz.getConstructor(new Class[] { 
parent })
                                                .newInstance(new Object[] { 
getObject(parent) });
+                       } else if (clazz.isEnum()) {
+                               // enum just can create a new instance, so we 
have to resort
+                               // to a default value, obviously many options 
are possible.
+                               try {
+                                       instance = Enum.valueOf(clazz, "NULL");
+                               } catch (IllegalArgumentException iae) {
+                                       throw AxisFault.makeFault(new 
Exception("Cannot create an enum object of type ("+clazz.getName()+") without a 
default value, please add a 'NULL' value to the enum that can be used as 
default."));
+                               }       
                        } else {
                                instance = clazz.newInstance();
                        }

Propchange: axis/axis2/java/core/branches/1_6/modules/saaj/
------------------------------------------------------------------------------
  Merged 
/axis/axis2/java/core/trunk/modules/saaj:r1358494,1358508,1358691,1359499,1359504,1360573,1362377,1364536,1441907


Reply via email to