Commits

Anonymous committed 5f82db4

XW-592 StackOverflowError
XW-724 StackOverflowError in XWorkBasicConverter

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@2055e221344d-f017-0410-9bd5-d282ab1896d7

  • Participants
  • Parent commits f76e2d3

Comments (0)

Files changed (2)

File core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkBasicConverter.java

 
                 if (array.length >= 1) {
                     value = array[0];
+                } else {
+                    value = null;
                 }
 
                 // let's try to convert the first element only

File core/src/test/java/com/opensymphony/xwork2/conversion/impl/XWorkBasicConverterTest.java

 
 import com.opensymphony.xwork2.ActionContext;
 import com.opensymphony.xwork2.XWorkException;
+import com.opensymphony.xwork2.test.annotations.Person;
 import junit.framework.TestCase;
 
 import java.text.DateFormat;
 import java.util.*;
+import java.lang.reflect.Member;
 
 /**
  * Test case for XWorkBasicConverter
         assertEquals(ParentClass.NestedEnum.TEST, convertedObject);
     }
 
+
+    public void testConvert() {
+        XWorkBasicConverter converter = new XWorkBasicConverter();
+        Map context = new HashMap();
+        Person o = new Person();
+        Member member = null;
+        String s = "names";
+        Object value = new Person[0];
+        Class toType = String.class;
+        converter.convertValue(context, value, member, s, value, toType);
+    }     
+
 }