cvs diff -u BeanPropertyDescriptor.java Index: BeanPropertyDescriptor.java =================================================================== RCS file: /home/cvspublic/ws-axis/java/src/org/apache/axis/utils/BeanPropertyDescriptor.java,v retrieving revision 1.19 diff -u -r1.19 BeanPropertyDescriptor.java --- BeanPropertyDescriptor.java 6 Dec 2004 06:23:00 -0000 1.19 +++ BeanPropertyDescriptor.java 9 Dec 2004 17:37:40 -0000 @@ -49,6 +49,9 @@ protected PropertyDescriptor myPD = null; protected static final Object[] noArgs = new Object[] {}; + protected boolean isIndexed = false; + protected Class arrayType = null; + protected Class componentType = null; /** * Constructor (takes a PropertyDescriptor) @@ -57,6 +60,22 @@ */ public BeanPropertyDescriptor(PropertyDescriptor pd) { myPD = pd; + Method rm = myPD.getReadMethod(); + Method wm = myPD.getWriteMethod(); + + // We should not depends on indexed properties. (JAX-RPC 1.1 - 5.4.1) + if (wm != null && rm != null) { + Class[] params = wm.getParameterTypes(); + if (params.length == 1) { + Class ret = rm.getReturnType(); + if (params[0].isArray() && ret.isArray() + && params[0].isAssignableFrom(ret)) { + arrayType = ret; + isIndexed = true; + componentType = ret.getComponentType(); + } + } + } } /** @@ -92,7 +111,7 @@ * @return true if indexed methods exist */ public boolean isIndexed() { - return (myPD instanceof IndexedPropertyDescriptor); + return isIndexed; } /** @@ -136,10 +155,8 @@ if (!isIndexed()) { return Array.get(get(obj), i); } else { - IndexedPropertyDescriptor id = (IndexedPropertyDescriptor)myPD; - return id.getIndexedReadMethod().invoke(obj, - new Object[] { - new Integer(i)}); + Object array = get(obj); + return Array.get(array, i); } } @@ -153,11 +170,9 @@ throws InvocationTargetException, IllegalAccessException { // Set the new value if (isIndexed()) { - IndexedPropertyDescriptor id = (IndexedPropertyDescriptor)myPD; - growArrayToSize(obj, id.getIndexedPropertyType(), i); - id.getIndexedWriteMethod().invoke(obj, - new Object[] { - new Integer(i), newValue}); + growArrayToSize(obj, componentType, i); + Object array = get(obj); + Array.set(array, i, newValue); } else { Array.set(get(obj), i, newValue); } @@ -192,7 +207,7 @@ */ public Class getType() { if (isIndexed()) { - return ((IndexedPropertyDescriptor)myPD).getIndexedPropertyType(); + return arrayType.getComponentType(); } else { return myPD.getPropertyType(); } ***** CVS exited normally with code 1 *****