Return-Path: Delivered-To: apmail-xml-axis-dev-archive@xml.apache.org Received: (qmail 81227 invoked by uid 500); 30 Jul 2002 13:11:10 -0000 Mailing-List: contact axis-dev-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-dev@xml.apache.org Received: (qmail 81205 invoked from network); 30 Jul 2002 13:11:09 -0000 Importance: Normal Sensitivity: Subject: Re: You changed the sequence test? (was: Re: cvs commit: xml-axis/java/test/wsdl/sequence SequenceService.java deploy.wsdd readme.txt SequenceTest.wsdl SequenceTestServiceTestCase.java buildComponent.xml SequenceInfo.java SequenceTestSoapBindingImpl.java) To: axis-dev@xml.apache.org X-Mailer: Lotus Notes Release 5.0.7 March 21, 2001 Message-ID: From: butek@us.ibm.com Date: Tue, 30 Jul 2002 07:54:08 -0500 X-MIMETrack: Serialize by Router on D04NM203/04/M/IBM(Build M13TT_07122002 Pre-release 2|July 12, 2002) at 07/30/2002 09:11:03 MIME-Version: 1.0 Content-type: multipart/alternative; Boundary="0__=09BBE695DFD53C0B8f9e8a93df938690918c09BBE695DFD53C0B" Content-Disposition: inline X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N --0__=09BBE695DFD53C0B8f9e8a93df938690918c09BBE695DFD53C0B Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: quoted-printable What happened here? My note was empty! Is Lotus notes screwing up my fonts again? Made them of size 0? Colored them white? Let me try again... Just one comment, Glen. You've simplified the sequence test. That mea= ns it doesn't test what it used to. I won't argue whether it tested the proper thing - I don't really know that test well - I don't know what R= ich intended with it. I just want to flag your change so that he can take = a look at it once he gets back from vacation. Russell Butek butek@us.ibm.com Russell Butek/Austin/IBM@IBMUS on 07/30/2002 07:23:25 AM Please respond to axis-dev@xml.apache.org To: axis-dev@xml.apache.org cc: Subject: You changed the sequence test? (was: Re: cvs commit: xml- axis/java/test/wsdl/sequence SequenceService.java deploy.wsdd readme.txt SequenceTest.wsdl SequenceTestServiceTestCase.java buildComponent.xml SequenceInfo.java SequenceTestSoapBindingImpl= . java) Russell Butek butek@us.ibm.com Please respond to axis-dev@xml.apache.org To: xml-axis-cvs@apache.org cc: Subject: cvs commit: xml-axis/java/test/wsdl/sequence SequenceServic= e. java deploy.wsdd readme.txt SequenceTest.wsdl SequenceTestServiceTestCa= se. java buildComponent.xml SequenceInfo.java SequenceTestSoapBindingImpl.j= ava gdaniels =A0 =A02002/07/29 23:16:04 Modified: =A0 =A0java/src/org/apache/axis/encoding/ser BeanDeseriali= zer.java BeanPropertyTarget.java java/src/org/apache/axis/message BodyBuilder.java java/src/org/apache/axis/utils BeanPropertyDescriptor.ja= va BeanUtils.java java/test/wsdl Wsdl2javaTestSuite.xml java/test/wsdl/arrays PersonalInfoBookServiceTestCase.ja= va java/test/wsdl/sequence SequenceTest.wsdl SequenceTestServiceTestCase.java buildComponent.xml Added: =A0 =A0 =A0 java/src/org/apache/axis/utils FieldPropertyDescr= iptor.java java/test/wsdl/sequence SequenceService.java deploy.wsdd= readme.txt Removed: =A0 =A0 java/test/wsdl/sequence SequenceInfo.java SequenceTestSoapBindingImpl.java Log: Several changes which came up while investigating a problem serializing s in the correct order. * Fixed sequence test Sequence test now tests the actual XML produced, instead of going through a deserialization test with a custom class which was obscuring the actual generated class produced by WSDL2Java. There is also a possible test here which confirms that the schema generated from our generated Java classes still has the right declaration, but since that wasn't being done, the roundtripping through Java2WSDL again didn't make sense to me. End result, test is much simpler now and actually tests what it seems to be intending to. =A0(and has a readme.txt) * Revamped BeanPropertyDescriptor for cleanliness and shrinkage The old version of this class was repeating a lot of work which is done for us automatically by the bean framework itself. =A0For instance, keeping track of indexed properties - this just works via the standard PropertyDescriptor class, so this new version takes advantage of that fact and simply wraps the PD. One might wonder why we need this class at all if it's just a wrapper - two answers. =A0First, we do some cool stuff with array maintenance, and second, we use this same interface to deal with publically accessible fields, something that standard PD's can't do. =A0Speaking of which... * Deal with Fields with an explicit subclass of BPD This removes the need for a lot of if statements and cleans up the code a good deal. =A0Now we just make sure to create a FieldPropertyDescriptor where we used to use the Field constructor of the BeanPropertyDescriptor. =A0Now the vtable does our branching for us with no conditionals. * BeanUtils vastly simplified This I'd really appreciate comments on. =A0I pulled out the code that does the "manual" run through the introspected methods of our target class, and instead just start with the PropertyDescriptors returned by the Introspector, adding only the public Fields. As I understand it the purpose of the code that was there before was to try to order the generated descriptor in something close to the order that things are defined in the... Java source, perhaps? =A0I don't think there's any guarantee that a given compiler will order things in any particular way, so I don't see the point of bothering. All tests pass fine without this code, but if people can explain to me why what it did was useful, I'll be happy to put it back. * BeanDeserializer only uses indexed BPT when appropriate We now only use the indexed version of the BeanPropertyTarget when the deserializer found for a given QName is NOT the ArrayDeserializer. =A0If we have the ArrayDeserializer, we know this is a SOAP array, which will have an outer "wrapper" element, and whose value will be a single array object (i.e. a String []). =A0In this case, we want to use the normal BPT because the value which will be set is for the array field, not the items of the array. NOTE: This will likely fail with arrays of arrays, we should a) think about that, and b) write a test for it. * Remove some try/catch blocks in test cases, so that we can see the actual failures as they happen. TODO : I plan to change the TestCase-generating framework, as discussed before, to stop putting in the try/catch blocks around everything. =A0Tests should let most Exceptions bubble up through. * Various bits of cleanup NOTES: we don't have enough tests. =A0There should be a grueling regression test for the BPD/BeanUtils related classes, amongst other things. =A0There is also some more potential refactoring of BeanPropertyDescriptor / FieldDesc / Target which might make sense to lean things down even more. I'm going to stop writing now before the checkin comments get longer than the diffs... :) Revision =A0Changes =A0 =A0Path 1.41 =A0 =A0 =A0+48 -26 =A0 =A0xml- axis/java/src/org/apache/axis/encoding/ser/BeanDeserializer.java Index: BeanDeserializer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/xml- axis/java/src/org/apache/axis/encoding/ser/BeanDeserializer.java,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- BeanDeserializer.java 23 Jul 2002 12:54:01 -0000 1.40 +++ BeanDeserializer.java 30 Jul 2002 06:16:04 -0000 1.41 @@ -1,8 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * - * Copyright (c) 2001 The Apache Software Foundation. =A0All rights= + * Copyright (c) 2001-2002 The Apache Software Foundation. =A0All r= ights * reserved. * * Redistribution and use in source and binary forms, with or without= @@ -147,7 +146,8 @@ * @param namespace is the namespace of the element * @param localName is the name of the element * @param qName is the prefixed qName of the element - =A0 =A0 * @param attributes are the attributes on the element...us= ed to get the type + =A0 =A0 * @param attributes are the attributes on the element...us= ed to get the + =A0 =A0 * =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 type * @param context is the DeserializationContext */ public void startElement(String namespace, String localName, @@ -223,7 +223,8 @@ propDesc =3D (BeanPropertyDescriptor) propertyMap.get(local= Name); } - =A0 =A0 =A0 =A0// try and see if this is an xsd:any namespace=3D"#= #any" element before reporting a problem + =A0 =A0 =A0 =A0// try and see if this is an xsd:any namespace=3D"#= #any" element before + =A0 =A0 =A0 =A0// reporting a problem QName qn =3D null; Deserializer dSer =3D null; MessageContext messageContext =3D context.getMessageContext= (); @@ -234,8 +235,11 @@ dSer =3D context.getDeserializerForType(elemQName); if (dSer =3D=3D null) =A0{ qn =3D Constants.XSD_ANY; - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// make sure that the Eleme= nt Deserializer deserializes the current element and not the child - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0messageContext.setProperty(= ElementDeserializer. DESERIALIZE_CURRENT_ELEMENT, Boolean.TRUE); + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// make sure that the Eleme= nt Deserializer deserializes + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// the current element and = not the child + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0messageContext.setProperty(= ElementDeserializer. + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0DESERIALIZE_CURRENT_ELEMENT, + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 Boolean.TRUE); } else { qn =3D elemQName; } @@ -254,7 +258,8 @@ // Look at the type attribute specified. =A0If this fails, // use the javaType of the property to get the type qname. if (qn =3D=3D null) { - =A0 =A0 =A0 =A0 =A0 =A0qn =3D context.getTypeFromAttributes(namesp= ace, localName, attributes); + =A0 =A0 =A0 =A0 =A0 =A0qn =3D context.getTypeFromAttributes(namesp= ace, localName, + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 attributes); } // get the deserializer @@ -274,28 +279,41 @@ } if (propDesc.isWriteable()) { - =A0 =A0 =A0 =A0 =A0 =A0if (!propDesc.isIndexed()) { - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// Success! =A0Register the target = and deserializer. - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0collectionIndex =3D -1; - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0dSer.registerValueTarget( - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 new BeanPropertyTarget(value, propDesc)); + =A0 =A0 =A0 =A0 =A0 =A0// If this is an indexed property, and the = deserializer we found + =A0 =A0 =A0 =A0 =A0 =A0// was NOT the ArrayDeserializer, this is a= non-SOAP array: + =A0 =A0 =A0 =A0 =A0 =A0// + =A0 =A0 =A0 =A0 =A0 =A0// =A0 value1 + =A0 =A0 =A0 =A0 =A0 =A0// =A0 value2 + =A0 =A0 =A0 =A0 =A0 =A0// ... + =A0 =A0 =A0 =A0 =A0 =A0// In this case, we want to use the collect= ionIndex and make sure + =A0 =A0 =A0 =A0 =A0 =A0// the deserialized value for the child ele= ment goes into the + =A0 =A0 =A0 =A0 =A0 =A0// right place in the collection. + =A0 =A0 =A0 =A0 =A0 =A0if (propDesc.isIndexed() && !(dSer instance= of ArrayDeserializer)) { + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0collectionIndex++; + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0dSer.registerValueTarget(ne= w BeanPropertyTarget(value, + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0propDesc, collectionIndex)); } else { - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// Success! This is a collection of= properties so use the index - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0collectionIndex++; - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0dSer.registerValueTarget( - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 new BeanPropertyTarget(value, - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0propDesc, - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0collectionIndex)); + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// If we're here, the element maps = to a single field value, + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// whether that be a "basic" type o= r an array, so use the + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// normal (non-indexed) BeanPropert= yTarget form. + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0collectionIndex =3D -1; + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0dSer.registerValueTarget(new BeanPr= opertyTarget(value, + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0propDesc));= } } return (SOAPHandler)dSer; } - =A0 =A0 public BeanPropertyDescriptor getObjectPropertyDesc(QName = qname, DeserializationContext context) { - =A0 =A0 =A0 =A0for (Iterator iterator =3D propertyMap.values().ite= rator(); iterator.hasNext();) { - =A0 =A0 =A0 =A0 =A0 =A0BeanPropertyDescriptor propertyDesc =3D (BeanPropertyDescriptor) iterator.next(); + =A0 =A0 public BeanPropertyDescriptor + =A0 =A0 =A0 =A0 =A0 =A0 getObjectPropertyDesc(QName qname, + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= DeserializationContext context) { + =A0 =A0 =A0 =A0for (Iterator iterator =3D propertyMap.values().ite= rator(); + =A0 =A0 =A0 =A0 =A0 =A0 iterator.hasNext();) { + =A0 =A0 =A0 =A0 =A0 =A0BeanPropertyDescriptor propertyDesc =3D + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(BeanPropertyDescriptor) it= erator.next(); // try to find xsd:any namespace=3D"##any" property - =A0 =A0 =A0 =A0 =A0 =A0if (propertyDesc.getName().equals("any") &&= propertyDesc. getType().getName().equals("java.lang.Object")) { + =A0 =A0 =A0 =A0 =A0 =A0if (propertyDesc.getName().equals("any") &&= + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0propertyDesc.getType().getName().eq= uals("java.lang. Object")) { return propertyDesc; } } @@ -306,11 +324,13 @@ * Set the bean properties that correspond to element attribute= s. * * This method is invoked after startElement when the element requires - =A0 =A0 * deserialization (i.e. the element is not an href and the= value is not nil.) + =A0 =A0 * deserialization (i.e. the element is not an href and the= value is not + =A0 =A0 * nil.) * @param namespace is the namespace of the element * @param localName is the name of the element * @param qName is the prefixed qName of the element - =A0 =A0 * @param attributes are the attributes on the element...us= ed to get the type + =A0 =A0 * @param attributes are the attributes on the element...us= ed to get the + =A0 =A0 * =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 type * @param context is the DeserializationContext */ public void onStartElement(String namespace, String localName, @@ -357,7 +377,8 @@ QName qn =3D tm.getTypeQName(type); if (qn =3D=3D null) throw new SAXException( - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0JavaUtils.g= etMessage("unregistered00", type.toString())); + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0JavaUtils.g= etMessage("unregistered00", + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 type.toString())); // get the deserializer Deserializer dSer =3D context.getDeserializerForType(= qn); @@ -373,7 +394,8 @@ // Success! =A0Create an object from the string and set // it in the bean try { - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0dSer.onStartElement(namespa= ce, localName, qName, attributes, context); + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0dSer.onStartElement(namespa= ce, localName, qName, + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0attributes, context); Object val =3D ((SimpleDeserializer)dSer). makeValue(attributes.getValue(i)); bpd.set(value, val); 1.13 =A0 =A0 =A0+0 -1 =A0 =A0 =A0xml- axis/java/src/org/apache/axis/encoding/ser/BeanPropertyTarget.java Index: BeanPropertyTarget.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/xml- axis/java/src/org/apache/axis/encoding/ser/BeanPropertyTarget.java,v= retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- BeanPropertyTarget.java 3 Jul 2002 17:50:22 -0000 1.12 +++ BeanPropertyTarget.java 30 Jul 2002 06:16:04 -0000 1.13 @@ -55,7 +55,6 @@ package org.apache.axis.encoding.ser; -import org.apache.axis.AxisProperties; import org.apache.axis.encoding.Target; import org.apache.axis.utils.BeanPropertyDescriptor; import org.apache.axis.utils.JavaUtils; 1.44 =A0 =A0 =A0+9 -4 =A0 =A0 =A0xml- axis/java/src/org/apache/axis/message/BodyBuilder.java Index: BodyBuilder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/xml- axis/java/src/org/apache/axis/message/BodyBuilder.java,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- BodyBuilder.java 3 Jul 2002 17:50:29 -0000 1.43 +++ BodyBuilder.java 30 Jul 2002 06:16:04 -0000 1.44 @@ -60,9 +60,9 @@ * @author Glen Daniels (gdaniels@allaire.com) */ -import org.apache.axis.AxisProperties; import org.apache.axis.Constants; import org.apache.axis.MessageContext; +import org.apache.axis.soap.SOAPConstants; import org.apache.axis.description.OperationDesc; import org.apache.axis.encoding.DeserializationContext; import org.apache.axis.enum.Style; @@ -149,6 +149,8 @@ throw new SAXException(e); } + =A0 =A0 =A0 =A0Style style =3D operations =3D=3D null ? Style.RPC = : operations[0]. getStyle(); + /** Now we make a plain SOAPBodyElement IF we either: * a) have an non-root element, or * b) have a non-RPC service @@ -160,9 +162,7 @@ handler =3D new SOAPFaultBuilder((SOAPFault)element, context); } else if (!gotRPCElement) { - =A0 =A0 =A0 =A0 =A0 =A0if (isRoot && - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(operations =3D=3D null || - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (operations[0].getStyle() !=3D Sty= le.MESSAGE))) { + =A0 =A0 =A0 =A0 =A0 =A0if (isRoot && (style !=3D Style.MESSAGE)) {= gotRPCElement =3D true; try { @@ -194,6 +194,11 @@ } if (element =3D=3D null) { + =A0 =A0 =A0 =A0 =A0 =A0if (style =3D=3D Style.RPC && + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0context.getMessageContext()= .getSOAPConstants() =3D=3D + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0SOAPConstants.SOAP12_CONSTA= NTS) { + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0throw new SAXException("Only one bo= dy allowed for SOAP 1.2 RPC"); + =A0 =A0 =A0 =A0 =A0 =A0} element =3D new SOAPBodyElement(namespace, localName, pr= efix, attributes, context); if (element.getFixupDeserializer() !=3D null) 1.11 =A0 =A0 =A0+64 -152 =A0 xml- axis/java/src/org/apache/axis/utils/BeanPropertyDescriptor.java Index: BeanPropertyDescriptor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/xml- axis/java/src/org/apache/axis/utils/BeanPropertyDescriptor.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- BeanPropertyDescriptor.java 12 Jul 2002 22:38:55 -0000 1.10 +++ BeanPropertyDescriptor.java 30 Jul 2002 06:16:04 -0000 1.11 @@ -55,139 +55,82 @@ package org.apache.axis.utils; import java.lang.reflect.Array; -import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; +import java.beans.PropertyDescriptor; +import java.beans.IndexedPropertyDescriptor; import org.apache.axis.components.logger.LogFactory; -import org.apache.axis.AxisFault; import org.apache.commons.logging.Log; /** - * This class is essentially a copy of the PropertyDescriptor information, except - * that the values in it can be modified. - * Updated this to include fields that don't have getter/setters. + * This class represents a field/property in a value type (a class = with either + * bean-style getters/setters or public fields). + * + * It is essentially a thin wrapper around the PropertyDescriptor f= rom the + * JavaBean utilities. =A0We wrap it with this class so that we can= create + * the subclass FieldPropertyDescriptor and access public fields (w= ho + * wouldn't have PropertyDescriptors normally) via the same interfa= ce. + * + * There are also some interesting tricks where indexed properties = are + * concerned, mostly involving the fact that we manage the arrays h= ere + * rather than relying on the value type class to do it itself. + * * @author Rich Scheuerle + * @author Glen Daniels (gdaniels@apache.org) **/ public class BeanPropertyDescriptor { protected static Log log =3D LogFactory.getLog(BeanPropertyDescriptor.class.getName()); - =A0 =A0private String name =3D null; - =A0 =A0private Method getter =3D null; - =A0 =A0private Method setter =3D null; - =A0 =A0private Method getterIndexed =3D null; - =A0 =A0private Method setterIndexed =3D null; - =A0 =A0private Field field =3D null; - =A0 =A0private static final Object[] noArgs =3D new Object[] {}; + =A0 =A0protected PropertyDescriptor myPD =3D null; - =A0 =A0/** - =A0 =A0 * Construct a BPD with getter/setter methods - =A0 =A0 * Both must be set - =A0 =A0 * @param _name is the name of the property - =A0 =A0 * @param _getter is the accessor method - =A0 =A0 * @param _setter is the modifier method - =A0 =A0 */ - =A0 =A0public BeanPropertyDescriptor(String _name, - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= Method _getter, - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= Method _setter) { - =A0 =A0 =A0 =A0name =3D _name; - =A0 =A0 =A0 =A0getter =3D _getter; - =A0 =A0 =A0 =A0setter =3D _setter; - =A0 =A0 =A0 =A0if (_getter =3D=3D null || _setter =3D=3D null || _= name =3D=3D null) { - =A0 =A0 =A0 =A0 =A0 =A0throw new IllegalArgumentException( - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0JavaUtils.getMessage(_gette= r =3D=3D null ? - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 "badGetter00" : - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 (_setter =3D=3D null ? - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 "badSetter00" : "badProp03"))); - =A0 =A0 =A0 =A0} - =A0 =A0} + =A0 =A0protected static final Object[] noArgs =3D new Object[] {};= - =A0 =A0/** - =A0 =A0 * Construct a BPD with getter/setter methods for - =A0 =A0 * an indexed property. =A0All params must be set. - =A0 =A0 * @param _name is the name of the property - =A0 =A0 * @param _getter is the accessor method - =A0 =A0 * @param _setter is the modifier method - =A0 =A0 * @param _getterIndexed is the accessor method - =A0 =A0 * @param _setterIndexed is the modifier method + =A0 =A0/** + =A0 =A0 * Constructor (takes a PropertyDescriptor) + =A0 =A0 * + =A0 =A0 * @param pd */ - =A0 =A0public BeanPropertyDescriptor(String _name, - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= Method _getter, - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= Method _setter, - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= Method _getterIndexed, - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= Method _setterIndexed) { - =A0 =A0 =A0 =A0this(_name, _getter, _setter); - =A0 =A0 =A0 =A0getterIndexed =3D _getterIndexed; - =A0 =A0 =A0 =A0setterIndexed =3D _setterIndexed; - =A0 =A0 =A0 =A0if (_getterIndexed =3D=3D null || _setterIndexed =3D= =3D null) { - =A0 =A0 =A0 =A0 =A0 =A0throw new IllegalArgumentException( - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0JavaUtils.getMessage(_gette= rIndexed =3D=3D null ? - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 "badAccessor00" : "badModifier00")); - =A0 =A0 =A0 =A0} + =A0 =A0public BeanPropertyDescriptor(PropertyDescriptor pd) { + =A0 =A0 =A0 =A0myPD =3D pd; } - =A0 =A0/** - =A0 =A0 * Construct a BPD with only a getter method - =A0 =A0 * @param _name is the name of the property - =A0 =A0 * @param _getter is the accessor method + =A0 =A0/** + =A0 =A0 * Protected constructor for use by our children */ - =A0 =A0public BeanPropertyDescriptor(String _name, - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= Method _getter) { - =A0 =A0 =A0 =A0name =3D _name; - =A0 =A0 =A0 =A0getter =3D _getter; - =A0 =A0 =A0 =A0setter =3D null; - =A0 =A0 =A0 =A0if (_getter =3D=3D null || _name =3D=3D null) { - =A0 =A0 =A0 =A0 =A0 =A0throw new IllegalArgumentException( - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0JavaUtils.getMessage(getter= =3D=3D null ? - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 "badGetter00" : - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 "badProp03")); - =A0 =A0 =A0 =A0} + =A0 =A0protected BeanPropertyDescriptor() { } - =A0 =A0/** - =A0 =A0 * Construct a BPD with a field - =A0 =A0 * Both must be set - =A0 =A0 * @param _name is the name of the property - =A0 =A0 * @param _field is the name of the public instance field + =A0 =A0/** + =A0 =A0 * Get our property name. */ - =A0 =A0public BeanPropertyDescriptor(String _name, - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= Field _field) { - =A0 =A0 =A0 =A0name =3D _name; - =A0 =A0 =A0 =A0field =3D _field; - =A0 =A0 =A0 =A0if (_field =3D=3D null || _name =3D=3D null) { - =A0 =A0 =A0 =A0 =A0 =A0throw new IllegalArgumentException( - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0JavaUtils.getMessage(_field= =3D=3D null ? - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 "badField00" : "badProp03")); - =A0 =A0 =A0 =A0} + =A0 =A0public String getName(){ + =A0 =A0 =A0 =A0return myPD.getName(); } - - =A0 =A0/** + + =A0 =A0/** * Query if property is readable * @return true if readable */ public boolean isReadable() { - =A0 =A0 =A0 =A0return (getter !=3D null || - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0field !=3D null); + =A0 =A0 =A0 =A0return (myPD.getReadMethod() !=3D null); } - =A0 =A0/** + + =A0 =A0/** * Query if property is writeable * @return true if writeable */ public boolean isWriteable() { - =A0 =A0 =A0 =A0return (setter !=3D null || - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0field !=3D null); + =A0 =A0 =A0 =A0return (myPD.getWriteMethod() !=3D null); } /** * Query if property is indexed. - =A0 =A0 * Indexed properties require valid setters/getters * @return true if indexed methods exist */ public boolean isIndexed() { - =A0 =A0 =A0 =A0return (getterIndexed !=3D null && - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0setterIndexed !=3D null); + =A0 =A0 =A0 =A0return (myPD instanceof IndexedPropertyDescriptor);= } /** @@ -197,10 +140,8 @@ */ public Object get(Object obj) throws InvocationTargetException, IllegalAccessException { - =A0 =A0 =A0 =A0if (getter !=3D null) { - =A0 =A0 =A0 =A0 =A0 =A0return getter.invoke(obj, noArgs); - =A0 =A0 =A0 =A0} else if (field !=3D null) { - =A0 =A0 =A0 =A0 =A0 =A0return field.get(obj); + =A0 =A0 =A0 =A0if (myPD.getReadMethod() !=3D null) { + =A0 =A0 =A0 =A0 =A0 =A0return myPD.getReadMethod().invoke(obj, noA= rgs); } throw new IllegalAccessException(JavaUtils. getMessage("badGetter00")); } @@ -211,10 +152,8 @@ */ public void set(Object obj, Object newValue) throws InvocationTargetException, IllegalAccessException { - =A0 =A0 =A0 =A0if (setter !=3D null) { - =A0 =A0 =A0 =A0 =A0 =A0setter.invoke(obj, new Object[] {newValue})= ; - =A0 =A0 =A0 =A0} else if (field !=3D null) { - =A0 =A0 =A0 =A0 =A0 =A0field.set(obj, newValue); + =A0 =A0 =A0 =A0if (myPD.getWriteMethod() !=3D null) { + =A0 =A0 =A0 =A0 =A0 =A0myPD.getWriteMethod().invoke(obj, new Objec= t[] {newValue}); } else { throw new IllegalAccessException(JavaUtils. getMessage("badSetter00")); } @@ -230,9 +169,13 @@ if (!isIndexed()) { return Array.get(get(obj), i); } else { - =A0 =A0 =A0 =A0 =A0 =A0return getterIndexed.invoke(obj, new Object= [] { new Integer(i)}); + =A0 =A0 =A0 =A0 =A0 =A0IndexedPropertyDescriptor id =3D (IndexedPr= opertyDescriptor) myPD; + =A0 =A0 =A0 =A0 =A0 =A0return id.getIndexedReadMethod().invoke(obj= , + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0new Object[] { + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0new Integer(i)}); } } + /** * Set an indexed property value * @param obj is the object @@ -241,22 +184,27 @@ */ public void set(Object obj, int i, Object newValue) throws InvocationTargetException, IllegalAccessException { + =A0 =A0 =A0 =A0// Set the new value + =A0 =A0 =A0 =A0if (isIndexed()) { + =A0 =A0 =A0 =A0 =A0 =A0IndexedPropertyDescriptor id =3D (IndexedPr= opertyDescriptor) myPD; + =A0 =A0 =A0 =A0 =A0 =A0growArrayToSize(obj, id.getIndexedPropertyT= ype(), i); + =A0 =A0 =A0 =A0 =A0 =A0id.getIndexedWriteMethod().invoke(obj, + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0new Object[] { + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0new Integer(i), newValue}); + =A0 =A0 =A0 =A0} else { + =A0 =A0 =A0 =A0 =A0 =A0Array.set(get(obj), i, newValue); + =A0 =A0 =A0 =A0} + =A0 =A0} + =A0 =A0protected void growArrayToSize(Object obj, Class componentT= ype, int i) + =A0 =A0 =A0 =A0 =A0 =A0throws InvocationTargetException, IllegalAc= cessException { // Get the entire array and make sure it is large enough Object array =3D get(obj); if (array =3D=3D null || Array.getLength(array) <=3D i) { // Construct a larger array of the same type - =A0 =A0 =A0 =A0 =A0 =A0Class componentType =3D null; - =A0 =A0 =A0 =A0 =A0 =A0if (getterIndexed !=3D null) { - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0componentType =3D getterIndexed.get= ReturnType(); - =A0 =A0 =A0 =A0 =A0 =A0} else if (getter !=3D null) { - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0componentType =3D getter.getReturnT= ype(). getComponentType(); - =A0 =A0 =A0 =A0 =A0 =A0} else { - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0componentType =3D field.getType().g= etComponentType(); - =A0 =A0 =A0 =A0 =A0 =A0} - =A0 =A0 =A0 =A0 =A0 =A0Object newArray =3D - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Array.newInstance(componentType,i+1= ); - + =A0 =A0 =A0 =A0 =A0 =A0Object newArray =3D + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Array.newInstance(component= Type,i+1); + // Set the object to use the larger array set(obj, newArray); @@ -269,21 +217,6 @@ set(obj, index, Array.get(array, index)); } } - - =A0 =A0 =A0 =A0// Set the new value - =A0 =A0 =A0 =A0if (isIndexed()) { - =A0 =A0 =A0 =A0 =A0 =A0setterIndexed.invoke(obj, new Object[] {new= Integer(i), newValue}); - =A0 =A0 =A0 =A0} else { - =A0 =A0 =A0 =A0 =A0 =A0Array.set(get(obj), i, newValue); - =A0 =A0 =A0 =A0} - =A0 =A0} - - =A0 =A0/** - =A0 =A0 * Get the name of a property - =A0 =A0 * @return String name of the property - =A0 =A0 */ - =A0 =A0public String getName() { - =A0 =A0 =A0 =A0return name; } /** @@ -292,30 +225,9 @@ */ public Class getType() { if (isIndexed()) { - =A0 =A0 =A0 =A0 =A0 =A0return getterIndexed.getReturnType(); - =A0 =A0 =A0 =A0} else if (getter !=3D null) { - =A0 =A0 =A0 =A0 =A0 =A0return getter.getReturnType(); + =A0 =A0 =A0 =A0 =A0 =A0return ((IndexedPropertyDescriptor)myPD). getIndexedPropertyType(); } else { - =A0 =A0 =A0 =A0 =A0 =A0return field.getType(); + =A0 =A0 =A0 =A0 =A0 =A0return myPD.getPropertyType(); } - =A0 =A0} - - =A0 =A0/** - =A0 =A0 * Get the read Method. - =A0 =A0 * (This is package visibility so that Bean Utils - =A0 =A0 * can access this information. =A0The other methods - =A0 =A0 * should be used during serialization/deserialization.) - =A0 =A0 */ - =A0 =A0Method getReadMethod() { - =A0 =A0 =A0 =A0return getter; - =A0 =A0} - =A0 =A0/** - =A0 =A0 * Get the write Method. - =A0 =A0 * (This is package visibility so that Bean Utils - =A0 =A0 * can access this information. =A0The other methods - =A0 =A0 * should be used during serialization/deserialization.) - =A0 =A0 */ - =A0 =A0Method getWriteMethod() { - =A0 =A0 =A0 =A0return setter; } } 1.11 =A0 =A0 =A0+32 -163 =A0 xml-axis/java/src/org/apache/axis/utils= /BeanUtils. java Index: BeanUtils.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/BeanUtil= s. java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- BeanUtils.java 12 Jul 2002 22:38:55 -0000 1.10 +++ BeanUtils.java 30 Jul 2002 06:16:04 -0000 1.11 @@ -80,13 +80,19 @@ /** * Create a BeanPropertyDescriptor array for the indicated class. - =A0 =A0 * @param Class javaType - =A0 =A0 * @param TypeDesc meta-data or null - =A0 =A0 * @return array of properties in order + =A0 =A0 * @param javaType + =A0 =A0 * @return an ordered array of properties */ public static BeanPropertyDescriptor[] getPd(Class javaType) { return getPd(javaType, null); } + + =A0 =A0/** + =A0 =A0 * Create a BeanPropertyDescriptor array for the indicated = class. + =A0 =A0 * @param javaType + =A0 =A0 * @param typeDesc + =A0 =A0 * @return an ordered array of properties + =A0 =A0 */ public static BeanPropertyDescriptor[] getPd(Class javaType, Type= Desc typeDesc) { BeanPropertyDescriptor[] pd; try { @@ -179,173 +185,55 @@ PropertyDescriptor[] rawPd, Class cls) { return processPropertyDescriptors(rawPd, cls, null); } + public static BeanPropertyDescriptor[] processPropertyDescriptors( PropertyDescriptor[] rawPd, Class cls, TypeDesc typeDesc) { // Create a copy of the rawPd called myPd BeanPropertyDescriptor[] myPd =3D new BeanPropertyDescriptor[rawPd.length]; - =A0 =A0 =A0 =A0int index1 =3D 0; - =A0 =A0 =A0 =A0for (int i=3D0; i < rawPd.length; i++) { - =A0 =A0 =A0 =A0 =A0 =A0if (rawPd[i].getReadMethod() !=3D null && - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0rawPd[i].getWriteMethod() !=3D null= ) { - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0myPd[index1++] =3D new BeanProperty= Descriptor(rawPd[i]. getName(), - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0rawPd[i]. getReadMethod(), - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0rawPd[i]. getWriteMethod()); - =A0 =A0 =A0 =A0 =A0 =A0} - =A0 =A0 =A0 =A0} + =A0 =A0 =A0 =A0ArrayList pd =3D new ArrayList(); try { - - =A0 =A0 =A0 =A0 =A0 =A0// Create an Array List - =A0 =A0 =A0 =A0 =A0 =A0ArrayList pd =3D new ArrayList(); - =A0 =A0 =A0 =A0 =A0 =A0for (int i=3D0; i < myPd.length; i++) { - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (myPd[i] !=3D null) { - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pd.add(myPd[i]); - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} - =A0 =A0 =A0 =A0 =A0 =A0} -= - =A0 =A0 =A0 =A0 =A0 =A0// Build a new pd array - =A0 =A0 =A0 =A0 =A0 =A0// defined by the order of the set methods.= - =A0 =A0 =A0 =A0 =A0 =A0// *Note that this is not guaranteed since = the getMethods - =A0 =A0 =A0 =A0 =A0 =A0// is not required to return the methods in= the declared order; - =A0 =A0 =A0 =A0 =A0 =A0// however it seems to be the case most of = the time. =A0The only way - =A0 =A0 =A0 =A0 =A0 =A0// to guarantee the correct ordering is if = TypeDesc meta- data is available. - =A0 =A0 =A0 =A0 =A0 =A0int index =3D 0; - =A0 =A0 =A0 =A0 =A0 =A0ArrayList newPd =3D new ArrayList(); - =A0 =A0 =A0 =A0 =A0 =A0for (int i=3D0; i 0) = { + =A0 =A0 =A0 =A0 =A0 =A0if (fields !=3D null && fields.length > 0) = { // See if the field is in the list of properties // add it if not. for (int i=3D0; i < fields.length; i++) { Field f =3D fields[i]; - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// skip field if it is fina= l, transient, or static + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// skip field if it is fina= l, transient, or static if (!(Modifier.isStatic(f.getModifiers()) || - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Modifier.isFina= l(f.getModifiers()) || - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Modifier.isTran= sient(f.getModifiers()))) { + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Modifier.is= Final(f.getModifiers()) || + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Modifier.is= Transient(f.getModifiers()))) { String fName =3D f.getName(); boolean found =3D false; - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0for (int j=3D0; j. */ package org.apache.axis.utils; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Array; import java.beans.PropertyDescriptor; /** * * @author Glen Daniels (gdaniels@apache.org) */ public class FieldPropertyDescriptor extends BeanPropertyDescriptor = { private Field field =3D null; /** * Construct a BPD with a field * Both must be set * @param _name is the name of the property * @param _field is the name of the public instance field */ public FieldPropertyDescriptor(String _name, Field _field) { field =3D _field; try { myPD =3D new PropertyDescriptor(_name, null, null); } catch (Exception e) { // ??? } if (_field =3D=3D null || _name =3D=3D null) { throw new IllegalArgumentException( JavaUtils.getMessage(_field =3D=3D null ? "badField00" : "badProp03")); } } public String getName() { return field.getName(); } /** * Query if property is readable * @return true if readable */ public boolean isReadable() { return true; } /** * Query if property is writeable * @return true if writeable */ public boolean isWriteable() { return true; } /** * Query if property is indexed. * Indexed properties require valid setters/getters * @return true if indexed methods exist */ public boolean isIndexed() { return (field.getType().getComponentType() !=3D null); } /** * Get the property value * @param obj is the object * @return the entire propery value */ public Object get(Object obj) throws InvocationTargetException, IllegalAccessException { return field.get(obj); } /** * Set the property value * @param obj is the object * @param newValue is the new value */ public void set(Object obj, Object newValue) throws InvocationTargetException, IllegalAccessException { field.set(obj, newValue); } /** * Get an indexed property * @param obj is the object * @param i the index * @return the object at the indicated index */ public Object get(Object obj, int i) throws InvocationTargetException, IllegalAccessException { if (!isIndexed()) { throw new IllegalAccessException("Not an indexed property"); } Object array =3D field.get(obj); return Array.get(array, i); } /** * Set an indexed property value * @param obj is the object * @param i the index * @param newValue is the new value */ public void set(Object obj, int i, Object newValue) throws InvocationTargetException, IllegalAccessException { if (!isIndexed()) { throw new IllegalAccessException("Not an indexed field!"); } Class componentType =3D field.getType().getComponentType(); growArrayToSize(obj, componentType, i); Array.set(get(obj), i, newValue); } /** * Get the type of a property * @return the type of the property */ public Class getType() { if (isIndexed()) { return field.getType().getComponentType(); } else { return field.getType(); } } } 1.119 =A0 =A0 +3 -26 =A0 =A0 xml-axis/java/test/wsdl/Wsdl2javaTestSu= ite.xml Index: Wsdl2javaTestSuite.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/xml-axis/java/test/wsdl/Wsdl2javaTestSuite.xml,v= retrieving revision 1.118 retrieving revision 1.119 diff -u -r1.118 -r1.119 --- Wsdl2javaTestSuite.xml 26 Jul 2002 15:48:28 -0000 1.118 +++ Wsdl2javaTestSuite.xml 30 Jul 2002 06:16:04 -0000 1.119 @@ -263,8 +263,7 @@ @@ -273,37 +272,15 @@ - =A0 =A0 =A0 =A0 + =A0 =A0 =A0 =A0 + =A0 =A0 =A0 =A0 - =A0 =A0 =A0 - =A0 =A0 =A0 - =A0 =A0 - =A0 =A0 - =A0 =A0 =A0 =A0 - =A0 =A0 - =A0 =A0 - =A0 =A0 - =A0 =A0 - =A0 =A0 - =A0 =A0 =A0 =A0 - =A0 =A0 - - @@ -36,7 +34,7 @@ - =A0 =A0 + =A0 =A0 1.5 =A0 =A0 =A0 +6 -16 =A0 =A0 xml- axis/java/test/wsdl/sequence/SequenceTestServiceTestCase.java Index: SequenceTestServiceTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/xml- axis/java/test/wsdl/sequence/SequenceTestServiceTestCase.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- SequenceTestServiceTestCase.java 5 Feb 2002 16:22:40 -0000 = 1.4 +++ SequenceTestServiceTestCase.java 30 Jul 2002 06:16:04 -0000 = 1.5 @@ -1,7 +1,8 @@ /** * SequenceTestServiceTestCase.java * - * @author: Rich Scheuerle (scheu@us.ibm.com) + * @author Rich Scheuerle (scheu@us.ibm.com) + * @author Glen Daniels (gdaniels@apache.org) */ package test.wsdl.sequence; @@ -11,23 +12,12 @@ super(name); } - =A0 =A0public void testSequenceTest() { + =A0 =A0public void testSequenceTest() throws Exception { test.wsdl.sequence.SequenceTestPortType binding; - =A0 =A0 =A0 =A0try { - =A0 =A0 =A0 =A0 =A0 =A0binding =3D new SequenceTestLocator().getSe= quenceTest(); - =A0 =A0 =A0 =A0} - =A0 =A0 =A0 =A0catch (javax.xml.rpc.ServiceException jre) { - =A0 =A0 =A0 =A0 =A0 =A0throw new junit.framework.AssertionFailedEr= ror("JAX-RPC ServiceException caught: " + jre ); - =A0 =A0 =A0 =A0} + =A0 =A0 =A0 =A0binding =3D new SequenceTestLocator().getSequenceTe= st(); assertTrue("binding is null", binding !=3D null); - =A0 =A0 =A0 =A0try { - =A0 =A0 =A0 =A0 =A0 =A0Integer value =3D null; - =A0 =A0 =A0 =A0 =A0 =A0value =3D binding.testSequence(new test.wsd= l.sequence. SequenceInfo()); - =A0 =A0 =A0 =A0 =A0 =A0assertTrue("Test Sequence Failed=3D"+value,= (value !=3D null)); - =A0 =A0 =A0 =A0 =A0 =A0assertTrue("Test Sequence Failed=3D"+value.= intValue() , (value.intValue() =3D=3D 0)); - =A0 =A0 =A0 =A0} catch (java.rmi.RemoteException re) { - =A0 =A0 =A0 =A0 =A0 =A0throw new junit.framework.AssertionFailedEr= ror("Remote Exception caught: " + re ); - =A0 =A0 =A0 =A0} + =A0 =A0 =A0 =A0assertTrue("Test failed!", + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 binding.testSequence(new test.= wsdl.sequence. SequenceInfo())); } } 1.2 =A0 =A0 =A0 +0 -29 =A0 =A0 xml-axis/java/test/wsdl/sequence/buil= dComponent.xml Index: buildComponent.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/xml-axis/java/test/wsdl/sequence/buildComponent.= xml, v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- buildComponent.xml 22 Jul 2002 20:14:25 -0000 1.1 +++ buildComponent.xml 30 Jul 2002 06:16:04 -0000 1.2 @@ -34,40 +34,11 @@ testcase=3D"no"> - =A0 =A0 - =A0 =A0 - =A0 =A0 =A0 - =A0 =A0 =A0 =A0 - =A0 =A0 =A0 - =A0 =A0 - =A0 =A0 =A0 - =A0 =A0 =A0 - =A0 =A0 - =A0 =A0 - =A0 =A0 =A0 =A0 - =A0 =A0 - =A0 =A0 - =A0 =A0 - =A0 =A0 - =A0 =A0 - =A0 =A0 =A0 =A0 - =A0 =A0 1.1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0xml-axis/java/test/wsdl/seque= nce/SequenceService. java Index: SequenceService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D /* * The Apache Software License, Version 1.1 * * * Copyright (c) 2001 The Apache Software Foundation. =A0All rights * reserved. * * Redistribution and use in source and binary forms, with or without= * modification, are permitted provided that the following conditions= * are met: * * 1. Redistributions of source code must retain the above copyright * =A0 =A0notice, this list of conditions and the following disclaime= r. * * 2. Redistributions in binary form must reproduce the above copyrig= ht * =A0 =A0notice, this list of conditions and the following disclaime= r in * =A0 =A0the documentation and/or other materials provided with the * =A0 =A0distribution. * * 3. The end-user documentation included with the redistribution, * =A0 =A0if any, must include the following acknowledgment: * =A0 =A0 =A0 "This product includes software developed by the * =A0 =A0 =A0 =A0Apache Software Foundation (http://www.apache.org/)= ." * =A0 =A0Alternately, this acknowledgment may appear in the software= itself, * =A0 =A0if and wherever such third-party acknowledgments normally a= ppear. * * 4. The names "Axis" and "Apache Software Foundation" must * =A0 =A0not be used to endorse or promote products derived from thi= s * =A0 =A0software without prior written permission. For written * =A0 =A0permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache",= * =A0 =A0nor may "Apache" appear in their name, without prior writte= n * =A0 =A0permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. =A0IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR= * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AN= D * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,= * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT= * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF= * SUCH DAMAGE. * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. =A0For mo= re * information on the Apache Software Foundation, please see * . */ package test.wsdl.sequence; import org.w3c.dom.Element; import org.w3c.dom.NodeList; import org.w3c.dom.Node; import org.w3c.dom.Document; import org.w3c.dom.Text; import org.apache.axis.utils.XMLUtils; import java.util.Vector; /** * Sequence test service. =A0This is a custom built message-style ser= vice * which confirms that * * @author Glen Daniels (gdaniels@apache.org) */ public class SequenceService { private String [] names =3D new String [] { "zero", "one", "two", "three", "four", "five" }; /** * This is a message-style service because we're just testing the * serialization. * * @return */ public Element [] testSequence(Vector elems) { Element zero =3D null; for (int i =3D 0; i < elems.size(); i++) { zero =3D findTheZero((Element)elems.get(i)); if (zero !=3D null) break; } Document retDoc =3D XMLUtils.newDocument(); Element [] ret =3D new Element [1]; ret[0] =3D retDoc.createElementNS("urn:SequenceTest", "testSequenceResponse"); boolean success =3D false; Element resultElement; if (zero !=3D null) { // Check for correct ordering int i =3D 1; Node sib =3D zero.getNextSibling(); for (i =3D 1; i < names.length; i++) { while ((sib !=3D null) && !(sib instanceof Element)) sib =3D sib.getNextSibling(); if ((sib =3D=3D null) || !(names[i].equals(((Element)sib).getLocalName()))) break; sib =3D sib.getNextSibling(); } if (i =3D=3D names.length) success =3D true; } resultElement =3D retDoc.createElement("return"); String resultStr =3D "false"; if (success) { resultStr =3D "true"; } Text text =3D retDoc.createTextNode(resultStr); resultElement.appendChild(text); ret[0].appendChild(resultElement); return ret; } /** * Walk an XML tree, looking for a element * @param start * @return */ private Element findTheZero(Element start) { if (names[0].equals(start.getLocalName())) { return start; } NodeList nl =3D start.getChildNodes(); for (int i =3D 0; i < nl.getLength(); i++) { Node node =3D nl.item(i); if (node instanceof Element) { Element result =3D findTheZero((Element)node); if (result !=3D null) { return result; } } } return null; } } 1.1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0xml-axis/java/test/wsdl/seque= nce/deploy.wsdd Index: deploy.wsdd =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 1.1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0xml-axis/java/test/wsdl/seque= nce/readme.txt Index: readme.txt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D This test confirms that the WSDL2Java / serialization system does th= e right thing with ordering of XML elements (which map to bean fields). In the WSDL file, we have a type with six ordered elements. =A0We bu= ild this into a bean, then use the generated client + bean to call a test service. The service is NOT generated, but a custom built message-style servi= ce which simply confirms the XML looks right by walking the DOM tree until it= finds the element, then checking the siblings look right. =A0It ret= urns a boolean true/false which indicates if the run was successful. --Glen Daniels July 30, 2002 = --0__=09BBE695DFD53C0B8f9e8a93df938690918c09BBE695DFD53C0B Content-type: text/html; charset=ISO-8859-1 Content-Disposition: inline Content-transfer-encoding: quoted-printable What happened here? My note was empty! Is Lotus notes scr= ewing up my fonts again? Made them of size 0? Colored them white? Le= t me try again...

Just one comment, Glen. You've simplified the sequence test. That mea= ns it doesn't test what it used to. I won't argue whether it tested th= e proper thing - I don't really know that test well - I don't know what= Rich intended with it. I just want to flag your change so that he can= take a look at it once he gets back from vacation.

Russell Butek
butek@us.ibm.com

Please respond to axis-dev@xml.ap= ache.org

To: axis-= dev@xml.apache.org
cc:
Subject: You= changed the sequence test? (was: Re: cvs commit: xml-axis/java/test/ws= dl/sequence SequenceService.java deploy.wsdd readme.txt SequenceTest.ws= dl SequenceTestServiceTestCase.java buildComponent.xml SequenceInfo.jav= a SequenceTestSoapBindingImpl.java)




Russell Butek
butek@us.ibm.com

Please respond to axis-dev@xml.apache.org
=
To: xml-axis-cvs@apache.org
cc:
Subject: cvs commit: xml-axis/java/test/wsdl/sequence SequenceService.j= ava deploy.wsdd readme.txt SequenceTest.wsdl SequenceTestServiceTestCas= e.java buildComponent.xml SequenceInfo.java SequenceTestSoapBindingImpl= .java



gdaniels =A0 =A02002/07/29 23:16:04

    Modified: =A0 =A0java/src/org/apache/axis/enco= ding/ser BeanDeserializer.java
    BeanPropertyTarget.java
            java/src/org/apache/axis/message BodyBuilder.j= ava
            java/src/org/apache/axis/utils BeanPropertyDescrip= tor.java
            BeanUtils.java
            java/test/wsdl Wsdl2javaTestSuite.xml<= br> java/test/wsdl/arrays PersonalInfoBookServiceTestC= ase.java
            java/test/wsdl/sequence SequenceTest.wsdl
    SequenceTestServiceTestCase.java buildComponent.xm= l
    Added: =A0 =A0 =A0 java/src/org/apache/axis/utils = FieldPropertyDescriptor.java
            java/test/wsdl/sequence SequenceService.java d= eploy.wsdd
            readme.txt
    Removed: =A0 =A0 java/test/wsdl/sequence SequenceI= nfo.java
    SequenceTestSoapBindingImpl.java
    Log:
    Several changes which came up while investigating = a problem
    serializing <sequence>s in the correct order= .
    * Fixed sequence test

    Sequence test now tests the actual XML produced, i= nstead of
    going through a deserialization test with a custom= class which
    was obscuring the actual generated class produced = by WSDL2Java.
    There is also a possible test here which confi= rms that the schema
    generated from our generated Java classes still ha= s the right
    <sequence> declaration, but since that wasn'= t being done, the
    roundtripping through Java2WSDL again didn't make = sense to me.
    End result, test is much simpler now and actua= lly tests what it
    seems to be intending to. =A0(and has a readme.txt= )
    * Revamped BeanPropertyDescriptor for cleanlin= ess and shrinkage

    The old version of this class was repeating a lot = of work which is
    done for us automatically by the bean framework it= self. =A0For
    instance, keeping track of indexed properties - th= is just works
    via the standard PropertyDescriptor class, so this= new version
    takes advantage of that fact and simply wraps the = PD.
    One might wonder why we need this class at all= if it's just
    a wrapper - two answers. =A0First, we do some cool= stuff with array
    maintenance, and second, we use this same interfac= e to deal with
    publically accessible fields, something that stand= ard PD's can't
    do. =A0Speaking of which...
    * Deal with Fields with an explicit subclass o= f BPD

    This removes the need for a lot of if statements a= nd cleans
    up the code a good deal. =A0Now we just make sure = to create
    a FieldPropertyDescriptor where we used to use the= Field
    constructor of the BeanPropertyDescriptor. =A0Now = the vtable
    does our branching for us with no conditionals.
    * BeanUtils vastly simplified

    This I'd really appreciate comments on. =A0I pulle= d out the
    code that does the "manual" run through = the introspected
    methods of our target class, and instead just star= t with
    the PropertyDescriptors returned by the Introspect= or,
    adding only the public Fields.
    As I understand it the purpose of the code tha= t was there
    before was to try to order the generated descripto= r
    in something close to the order that things are de= fined
    in the... Java source, perhaps? =A0I don't think t= here's
    any guarantee that a given compiler will order thi= ngs
    in any particular way, so I don't see the point of=
    bothering.
    All tests pass fine without this code, but if = people
    can explain to me why what it did was useful, I'll= be
    happy to put it back.
    * BeanDeserializer only uses indexed BPT when = appropriate

    We now only use the indexed version of the BeanPro= pertyTarget
    when the deserializer found for a given QName is N= OT the
    ArrayDeserializer. =A0If we have the ArrayDeserial= izer, we know
    this is a SOAP array, which will have an outer &qu= ot;wrapper"
    element, and whose value will be a single array ob= ject (i.e.
    a String []). =A0In this case, we want to use the = normal
    BPT because the value which will be set is for the= array
    field, not the items of the array.
      NOTE: This will likely fail with arrays of arr= ays, we should
      a) think about that, and b) write a test for it.
      * Remove some try/catch blocks in test cases, = so that we can
      see the actual failures as they happen.
      TODO : I plan to change the TestCase-generatin= g framework, as
      discussed before, to stop putting in the try/catch= blocks
      around everything. =A0Tests should let most Except= ions bubble
      up through.
      * Various bits of cleanup

      NOTES: we don't have enough tests. =A0There should= be a
      grueling regression test for the BPD/BeanUtils rel= ated
      classes, amongst other things. =A0There is also so= me more
      potential refactoring of BeanPropertyDescriptor /<= /font>
      FieldDesc / Target which might make sense to lean = things
      down even more.
      I'm going to stop writing now before the check= in comments
      get longer than the diffs... :)
      Revision =A0Changes =A0 =A0Path 1.41 =A0 =A0 =A0+48 -26 =A0 =A0xml-axis/java/src/o= rg/apache/axis/encoding/ser/BeanDeserializer.java
      Index: BeanDeserializer.java
      =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
      RCS file: /home/cvs/xml-axis/java/src/org/apache/a= xis/encoding/ser/BeanDeserializer.java,v
      retrieving revision 1.40
      retrieving revision 1.41
      diff -u -r1.40 -r1.41
      --- BeanDeserializer.java 23 Jul 2002 12:54:01 -00= 00 1.40
      +++ BeanDeserializer.java 30 Jul 2002 06:16:04 -00= 00 1.41
      @@ -1,8 +1,7 @@
      /*
      * The Apache Software License, Version 1.1<= /tt>
      *
      - *
      - * Copyright (c) 2001 The Apache Software Foundat= ion. =A0All rights
      + * Copyright (c) 2001-2002 The Apache Software Fo= undation. =A0All rights
      * reserved.
      *
      * Redistribution and use in source and binary form= s, with or without
      @@ -147,7 +146,8 @@
      * @param namespace is the namespace of the element=
      * @param localName is the name of the element
      * @param qName is the prefixed qName of the elemen= t
      - =A0 =A0 * @param attributes are the attributes o= n the element...used to get the type
      + =A0 =A0 * @param attributes are the attributes o= n the element...used to get the
      + =A0 =A0 * =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ty= pe
          * @param context is the DeserializationContext=
          */
      public void startElement(String namespace, String = localName,
      @@ -223,7 +223,8 @@ <= /font>
            propDesc =3D (BeanPropertyDescriptor) property= Map.get(localName);
            }
      - =A0 =A0 =A0 =A0// try and see if this is an xsd:= any namespace=3D"##any" element before reporting a problem
      + =A0 =A0 =A0 =A0// try and see if this is an xsd:= any namespace=3D"##any" element before
      + =A0 =A0 =A0 =A0// reporting a problem
            QName qn =3D null;
            Deserializer dSer =3D null;
            MessageContext messageContext =3D context.getMessa= geContext();
      @@ -234,8 +235,11 @@
      dSer =3D context.getDeserializerForType(elemQName)= ;
      if (dSer =3D=3D null) =A0{
      qn =3D Constants.XSD_ANY;
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// make s= ure that the Element Deserializer deserializes the current element and = not the child
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0messageCo= ntext.setProperty(ElementDeserializer.DESERIALIZE_CURRENT_ELEMENT, Bool= ean.TRUE);
      + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// make s= ure that the Element Deserializer deserializes
      + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// the cu= rrent element and not the child
      + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0messageCo= ntext.setProperty(ElementDeserializer.
      + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0DESERIALIZE_CURR= ENT_ELEMENT,
      + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Boolean.TRUE);<= font size=3D"4">
                } else {
                qn =3D elemQName;
      }
      @@ -254,7 +258,8 @@ <= /font>
            // Look at the type attribute specified. =A0If= this fails,
            // use the javaType of the property to get the typ= e qname.
            if (qn =3D=3D null) {
      - =A0 =A0 =A0 =A0 =A0 =A0qn =3D context.getTypeFro= mAttributes(namespace, localName, attributes);
      + =A0 =A0 =A0 =A0 =A0 =A0qn =3D context.getTypeFro= mAttributes(namespace, localName,
      + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 attributes);
            }
      // get the deserializer
      @@ -274,28 +279,41 @@=
            }
      if (propDesc.isWriteable()) {
      - =A0 =A0 =A0 =A0 =A0 =A0if (!propDesc.isIndexed()= ) {
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// Success! =A0Re= gister the target and deserializer.
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0collectionIndex =3D= -1;
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0dSer.registerValu= eTarget(
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 new BeanPropertyTarget(value, propDesc)= );
      + =A0 =A0 =A0 =A0 =A0 =A0// If this is an indexed = property, and the deserializer we found
      + =A0 =A0 =A0 =A0 =A0 =A0// was NOT the ArrayDeser= ializer, this is a non-SOAP array:
      + =A0 =A0 =A0 =A0 =A0 =A0// <bean>
      + =A0 =A0 =A0 =A0 =A0 =A0// =A0 <field>value= 1</field>
      + =A0 =A0 =A0 =A0 =A0 =A0// =A0 <field>value= 2</field>
      + =A0 =A0 =A0 =A0 =A0 =A0// ...
      + =A0 =A0 =A0 =A0 =A0 =A0// In this case, we want = to use the collectionIndex and make sure
      + =A0 =A0 =A0 =A0 =A0 =A0// the deserialized value= for the child element goes into the
      + =A0 =A0 =A0 =A0 =A0 =A0// right place in the col= lection.
      + =A0 =A0 =A0 =A0 =A0 =A0if (propDesc.isIndexed() = && !(dSer instanceof ArrayDeserializer)) {
      + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0collectio= nIndex++;
      + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0dSer.regi= sterValueTarget(new BeanPropertyTarget(value,
      + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0propDesc, collec= tionIndex));
      } else {
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// Success! This = is a collection of properties so use the index
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0collectionIndex++= ;
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0dSer.registerValu= eTarget(
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 new BeanPropertyTarget(value,
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0propDesc,
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0collectionIndex)); + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// If we're here,= the element maps to a single field value,
      + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// whether that b= e a "basic" type or an array, so use the
      + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// normal (non-in= dexed) BeanPropertyTarget form.
      + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0collectionIndex =3D= -1;
      + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0dSer.registerValu= eTarget(new BeanPropertyTarget(value,
      + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0propDesc));
            }
            }
            return (SOAPHandler)dSer;
        }
      - =A0 =A0 public BeanPropertyDescriptor getObjectP= ropertyDesc(QName qname, DeserializationContext context) {<= br> - =A0 =A0 =A0 =A0for (Iterator iterator =3D proper= tyMap.values().iterator(); iterator.hasNext();) {
      - =A0 =A0 =A0 =A0 =A0 =A0BeanPropertyDescriptor pr= opertyDesc =3D (BeanPropertyDescriptor) iterator.next(); + =A0 =A0 public BeanPropertyDescriptor
      + =A0 =A0 =A0 =A0 =A0 =A0 getObjectPropertyDesc(QN= ame qname,
      + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 DeserializationContext context) {
      + =A0 =A0 =A0 =A0for (Iterator iterator =3D proper= tyMap.values().iterator();
      + =A0 =A0 =A0 =A0 =A0 =A0 iterator.hasNext();) {
      + =A0 =A0 =A0 =A0 =A0 =A0BeanPropertyDescriptor pr= opertyDesc =3D
      + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(BeanProp= ertyDescriptor) iterator.next();
      // try to find xsd:any namespace=3D"##any&quo= t; property
      - =A0 =A0 =A0 =A0 =A0 =A0if (propertyDesc.getName(= ).equals("any") && propertyDesc.getType().getName().e= quals("java.lang.Object")) {
      + =A0 =A0 =A0 =A0 =A0 =A0if (propertyDesc.getName(= ).equals("any") &&
      + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0propertyDesc.getT= ype().getName().equals("java.lang.Object")) {
              return propertyDesc;
              }
      }
      @@ -306,11 +324,13 @@
          * Set the bean properties that correspond to e= lement attributes.
          *
          * This method is invoked after startElement when t= he element requires
      - =A0 =A0 * deserialization (i.e. the element is n= ot an href and the value is not nil.)
      + =A0 =A0 * deserialization (i.e. the element is n= ot an href and the value is not
      + =A0 =A0 * nil.)
          * @param namespace is the namespace of the ele= ment
          * @param localName is the name of the element
          * @param qName is the prefixed qName of the elemen= t
      - =A0 =A0 * @param attributes are the attributes o= n the element...used to get the type
      + =A0 =A0 * @param attributes are the attributes o= n the element...used to get the
      + =A0 =A0 * =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ty= pe
          * @param context is the DeserializationContext=
          */
      public void onStartElement(String namespace, Strin= g localName,
      @@ -357,7 +377,8 @@ <= /font>
                QName qn =3D tm.getTypeQName(type);
                if (qn =3D=3D null)
      throw new SAXException(
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0JavaUtils.getMessage("unregistered00", type.toString()= ));
      + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0JavaUtils.getMessage("unregistered00",
      = + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 type.toString()));
                // get the deserializer
                Deserializer dSer =3D context.getDeserializerForTy= pe(qn);
      @@ -373,7 +394,8 @@
      // Success! =A0Create an object from the string an= d set
      // it in the bean
      try {
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0dSer.onSt= artElement(namespace, localName, qName, attributes, context);
      + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0dSer.onSt= artElement(namespace, localName, qName,
      + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0attributes, context);
                    Object val =3D ((SimpleDeserializer)dSer).
                    makeValue(attributes.getValue(i));
                    = bpd.set(value, val);
      1.13 =A0 =A0 =A0+0 -1 =A0 =A0 =A0xml-axis/java= /src/org/apache/axis/encoding/ser/BeanPropertyTarget.java
      Index: BeanPropertyTarget.java
      =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
      RCS file: /home/cvs/xml-axis/java/src/org/apache/a= xis/encoding/ser/BeanPropertyTarget.java,v
      retrieving revision 1.12
      retrieving revision 1.13
      diff -u -r1.12 -r1.13
      --- BeanPropertyTarget.java 3 Jul 2002 17:50:22 -0= 000 1.12
      +++ BeanPropertyTarget.java 30 Jul 2002 06:16:04 -= 0000 1.13
      @@ -55,7 +55,6 @@
      package org.apache.axis.encoding.ser;

      -import org.apache.axis.AxisProperties;
      import org.apache.axis.encoding.Target;
      import org.apache.axis.utils.BeanPropertyDescripto= r;
      import org.apache.axis.utils.JavaUtils;


      1.44 =A0 =A0 =A0+9 -4 =A0 =A0 =A0xml-axis/java= /src/org/apache/axis/message/BodyBuilder.java

      Index: BodyBuilder.java
      =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
      RCS file: /home/cvs/xml-axis/java/src/org/apache/a= xis/message/BodyBuilder.java,v
      retrieving revision 1.43
      retrieving revision 1.44
      diff -u -r1.43 -r1.44
      --- BodyBuilder.java 3 Jul 2002 17:50:29 -0000 1.4= 3
      +++ BodyBuilder.java 30 Jul 2002 06:16:04 -0000 1.= 44
      @@ -60,9 +60,9 @@
      * @author Glen Daniels (gdaniels@allaire.com)
      */
      -import org.apache.axis.AxisProperties;=
      import org.apache.axis.Constants;
      import org.apache.axis.MessageContext;=
      +import org.apache.axis.soap.SOAPConstants;=
      import org.apache.axis.description.OperationDesc;<= /font>
      import org.apache.axis.encoding.DeserializationCon= text;
      import org.apache.axis.enum.Style;
      = @@ -149,6 +149,8 @@
      throw new SAXException(e);
            }
      + =A0 =A0 =A0 =A0Style style =3D operations =3D=3D= null ? Style.RPC : operations[0].getStyle();
      +
            /** Now we make a plain SOAPBodyElement IF we = either:
            * a) have an non-root element, or
            * b) have a non-RPC service
      @@ -160,9 +162,7 @@
      handler =3D new SOAPFaultBuilder((SOAPFault)elemen= t,
            context);
            } else if (!gotRPCElement) {
      - =A0 =A0 =A0 =A0 =A0 =A0if (isRoot &&
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(operations =3D=3D= null ||
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (operations[0].g= etStyle() !=3D Style.MESSAGE))) {
      + =A0 =A0 =A0 =A0 =A0 =A0if (isRoot && (st= yle !=3D Style.MESSAGE)) {
                gotRPCElement =3D true;
      try {
      @@ -194,6 +194,11 @@ =
            }
      if (element =3D=3D null) {
      + =A0 =A0 =A0 =A0 =A0 =A0if (style =3D=3D Style.RP= C &&
      + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0context.g= etMessageContext().getSOAPConstants() =3D=3D
      + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0SOAPConst= ants.SOAP12_CONSTANTS) {
      + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0throw new SAXExce= ption("Only one body allowed for SOAP 1.2 RPC");<= br> + =A0 =A0 =A0 =A0 =A0 =A0}
              element =3D new SOAPBodyElement(namespace, loc= alName, prefix,
              attributes, context);
              if (element.getFixupDeserializer() !=3D null)
      1.11 =A0 =A0 =A0+64 -152 =A0 xml-axis/java/src= /org/apache/axis/utils/BeanPropertyDescriptor.java

      Index: BeanPropertyDescriptor.java
      = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
      RCS file: /home/cvs/xml-axis/java/src/org/apache/a= xis/utils/BeanPropertyDescriptor.java,v
      retrieving revision 1.10
      retrieving revision 1.11
      diff -u -r1.10 -r1.11
      --- BeanPropertyDescriptor.java 12 Jul 2002 22:38:= 55 -0000 1.10
      +++ BeanPropertyDescriptor.java 30 Jul 2002 06:16:= 04 -0000 1.11
      @@ -55,139 +55,82 @@
      package org.apache.axis.utils;

      import java.lang.reflect.Array;
      -import java.lang.reflect.Field;
      import java.lang.reflect.InvocationTargetException= ;
      -import java.lang.reflect.Method;
      +import java.beans.PropertyDescriptor;=
      +import java.beans.IndexedPropertyDescriptor;
      import org.apache.axis.components.logger.LogFa= ctory;
      -import org.apache.axis.AxisFault;
      = import org.apache.commons.logging.Log;=
      /**
      - * This class is essentially a copy of the Proper= tyDescriptor information, except
      - * that the values in it can be modified.<= /tt>
      - * Updated this to include fields that don't have= getter/setters.
      + * This class represents a field/property in a va= lue type (a class with either
      + * bean-style getters/setters or public fields).<= /font>
      + *
      + * It is essentially a thin wrapper around the Pr= opertyDescriptor from the
      + * JavaBean utilities. =A0We wrap it with this cl= ass so that we can create
      + * the subclass FieldPropertyDescriptor and acces= s public fields (who
      + * wouldn't have PropertyDescriptors normally) vi= a the same interface.
      + *
      + * There are also some interesting tricks where i= ndexed properties are
      + * concerned, mostly involving the fact that we m= anage the arrays here
      + * rather than relying on the value type class to= do it itself.
      + *
      * @author Rich Scheuerle <scheu@us.ibm.com><= /font>
      + * @author Glen Daniels (gdaniels@apache.org)
      **/
      public class BeanPropertyDescriptor {
        protected static Log log =3D
        LogFactory.getLog(BeanPropertyDescriptor.class.get= Name());
      - =A0 =A0private String name =3D null;=
      - =A0 =A0private Method getter =3D null;
      - =A0 =A0private Method setter =3D null;
      - =A0 =A0private Method getterIndexed =3D null;
      - =A0 =A0private Method setterIndexed =3D null;
      - =A0 =A0private Field field =3D null;=
      - =A0 =A0private static final Object[] noArgs =3D = new Object[] {};
      + =A0 =A0protected PropertyDescriptor myPD =3D nul= l;
      - =A0 =A0/**
      - =A0 =A0 * Construct a BPD with getter/setter met= hods
      - =A0 =A0 * Both must be set
      - =A0 =A0 * @param _name is the name of the proper= ty
      - =A0 =A0 * @param _getter is the accessor method<= /font>
      - =A0 =A0 * @param _setter is the modifier method<= /font>
      - =A0 =A0 */
      - =A0 =A0public BeanPropertyDescriptor(String _nam= e,
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0Method _getter,
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0Method _setter) {
      - =A0 =A0 =A0 =A0name =3D _name;
      - =A0 =A0 =A0 =A0getter =3D _getter; - =A0 =A0 =A0 =A0setter =3D _setter; - =A0 =A0 =A0 =A0if (_getter =3D=3D null || _sette= r =3D=3D null || _name =3D=3D null) {
      - =A0 =A0 =A0 =A0 =A0 =A0throw new IllegalArgument= Exception(
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0JavaUtils= .getMessage(_getter =3D=3D null ?
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "badGetter00" : - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (_setter =3D=3D null ?
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "badSetter00" : "badProp= 03")));
      - =A0 =A0 =A0 =A0}
      - =A0 =A0}
      + =A0 =A0protected static final Object[] noArgs =3D= new Object[] {};
      - =A0 =A0/**
      - =A0 =A0 * Construct a BPD with getter/setter met= hods for
      - =A0 =A0 * an indexed property. =A0All params mus= t be set.
      - =A0 =A0 * @param _name is the name of the proper= ty
      - =A0 =A0 * @param _getter is the accessor method<= /font>
      - =A0 =A0 * @param _setter is the modifier method<= /font>
      - =A0 =A0 * @param _getterIndexed is the accessor = method
      - =A0 =A0 * @param _setterIndexed is the modifier = method
      + =A0 =A0/**
      + =A0 =A0 * Constructor (takes a PropertyDescripto= r)
      + =A0 =A0 *
      + =A0 =A0 * @param pd
      */
      - =A0 =A0public BeanPropertyDescriptor(String _nam= e,
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0Method _getter,
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0Method _setter,
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0Method _getterIndexed,
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0Method _setterIndexed) {
      - =A0 =A0 =A0 =A0this(_name, _getter, _setter);
      - =A0 =A0 =A0 =A0getterIndexed =3D _getterIndexed;=
      - =A0 =A0 =A0 =A0setterIndexed =3D _setterIndexed;=
      - =A0 =A0 =A0 =A0if (_getterIndexed =3D=3D null ||= _setterIndexed =3D=3D null) {
      - =A0 =A0 =A0 =A0 =A0 =A0throw new IllegalArgument= Exception(
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0JavaUtils= .getMessage(_getterIndexed =3D=3D null ?
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "badAccessor00" : "badMo= difier00"));
      - =A0 =A0 =A0 =A0}
      + =A0 =A0public BeanPropertyDescriptor(PropertyDes= criptor pd) {
      + =A0 =A0 =A0 =A0myPD =3D pd;
        }
      - =A0 =A0/**
      - =A0 =A0 * Construct a BPD with only a getter met= hod
      - =A0 =A0 * @param _name is the name of the proper= ty
      - =A0 =A0 * @param _getter is the accessor method<= /font>
      + =A0 =A0/**
      + =A0 =A0 * Protected constructor for use by our c= hildren
      */
      - =A0 =A0public BeanPropertyDescriptor(String _nam= e,
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0Method _getter) {
      - =A0 =A0 =A0 =A0name =3D _name;
      - =A0 =A0 =A0 =A0getter =3D _getter; - =A0 =A0 =A0 =A0setter =3D null;
      - =A0 =A0 =A0 =A0if (_getter =3D=3D null || _name = =3D=3D null) {
      - =A0 =A0 =A0 =A0 =A0 =A0throw new IllegalArgument= Exception(
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0JavaUtils= .getMessage(getter =3D=3D null ?
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "badGetter00" : - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "badProp03")); - =A0 =A0 =A0 =A0}
      + =A0 =A0protected BeanPropertyDescriptor() {
        }
      - =A0 =A0/**
      - =A0 =A0 * Construct a BPD with a field
      - =A0 =A0 * Both must be set
      - =A0 =A0 * @param _name is the name of the proper= ty
      - =A0 =A0 * @param _field is the name of the publi= c instance field
      + =A0 =A0/**
      + =A0 =A0 * Get our property name.
      = */
      - =A0 =A0public BeanPropertyDescriptor(String _nam= e,
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0Field _field) {
      - =A0 =A0 =A0 =A0name =3D _name;
      - =A0 =A0 =A0 =A0field =3D _field;
      = - =A0 =A0 =A0 =A0if (_field =3D=3D null || _name =3D= =3D null) {
      - =A0 =A0 =A0 =A0 =A0 =A0throw new IllegalArgument= Exception(
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0JavaUtils= .getMessage(_field =3D=3D null ?
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "badField00" : "badProp0= 3"));
      - =A0 =A0 =A0 =A0}
      + =A0 =A0public String getName(){
      + =A0 =A0 =A0 =A0return myPD.getName();
      }
      -
      - =A0 =A0/**
      +
      + =A0 =A0/**
          * Query if property is readable * @return true if readable
          */
      public boolean isReadable() {
      - =A0 =A0 =A0 =A0return (getter !=3D null ||
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0field !=3D null);=
      + =A0 =A0 =A0 =A0return (myPD.getReadMethod() !=3D= null);
      }
      - =A0 =A0/**
      +
      + =A0 =A0/**
          * Query if property is writeable * @return true if writeable
          */
      public boolean isWriteable() {
      - =A0 =A0 =A0 =A0return (setter !=3D null ||
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0field !=3D null);=
      + =A0 =A0 =A0 =A0return (myPD.getWriteMethod() !=3D= null);
        }
        /**
      * Query if property is indexed.
      - =A0 =A0 * Indexed properties require valid sette= rs/getters
          * @return true if indexed methods exist=
          */
      public boolean isIndexed() {
      - =A0 =A0 =A0 =A0return (getterIndexed !=3D null &= amp;&
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0setterIndexed !=3D= null);
      + =A0 =A0 =A0 =A0return (myPD instanceof IndexedPr= opertyDescriptor);
        }
      /**
      @@ -197,10 +140,8 @@ =
        */
        public Object get(Object obj)
      throws InvocationTargetException, IllegalAccessExc= eption {
      - =A0 =A0 =A0 =A0if (getter !=3D null) {
      - =A0 =A0 =A0 =A0 =A0 =A0return getter.invoke(obj,= noArgs);
      - =A0 =A0 =A0 =A0} else if (field !=3D null) {
      - =A0 =A0 =A0 =A0 =A0 =A0return field.get(obj);
      + =A0 =A0 =A0 =A0if (myPD.getReadMethod() !=3D nul= l) {
      + =A0 =A0 =A0 =A0 =A0 =A0return myPD.getReadMethod= ().invoke(obj, noArgs);
            }
            throw new IllegalAccessException(JavaUtils.getMess= age("badGetter00"));
      }
      @@ -211,10 +152,8 @@ =
        */
        public void set(Object obj, Object newValue)
      throws InvocationTargetException, IllegalAccessExc= eption {
      - =A0 =A0 =A0 =A0if (setter !=3D null) {
      - =A0 =A0 =A0 =A0 =A0 =A0setter.invoke(obj, new Ob= ject[] {newValue});
      - =A0 =A0 =A0 =A0} else if (field !=3D null) {
      - =A0 =A0 =A0 =A0 =A0 =A0field.set(obj, newValue);=
      + =A0 =A0 =A0 =A0if (myPD.getWriteMethod() !=3D nu= ll) {
      + =A0 =A0 =A0 =A0 =A0 =A0myPD.getWriteMethod().inv= oke(obj, new Object[] {newValue}); =
            } else {
            throw new IllegalAccessException(JavaUtils.getMess= age("badSetter00"));
      }
      @@ -230,9 +169,13 @@ =
            if (!isIndexed()) {
            return Array.get(get(obj), i);
      } else {
      - =A0 =A0 =A0 =A0 =A0 =A0return getterIndexed.invo= ke(obj, new Object[] { new Integer(i)});
      + =A0 =A0 =A0 =A0 =A0 =A0IndexedPropertyDescriptor= id =3D (IndexedPropertyDescriptor)myPD;
      + =A0 =A0 =A0 =A0 =A0 =A0return id.getIndexedReadM= ethod().invoke(obj,
      + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0new Object[] {
      + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0new Inte= ger(i)});
        }
        }
      +
      /**
          * Set an indexed property value * @param obj is the object
      @@ -241,22 +184,27 @@
      */
        public void set(Object obj, int i, Object newV= alue)
        throws InvocationTargetException, IllegalAccessExc= eption {
      + =A0 =A0 =A0 =A0// Set the new value<= br> + =A0 =A0 =A0 =A0if (isIndexed()) { + =A0 =A0 =A0 =A0 =A0 =A0IndexedPropertyDescriptor= id =3D (IndexedPropertyDescriptor)myPD;
      + =A0 =A0 =A0 =A0 =A0 =A0growArrayToSize(obj, id.g= etIndexedPropertyType(), i);
      + =A0 =A0 =A0 =A0 =A0 =A0id.getIndexedWriteMethod(= ).invoke(obj,
      + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0new Object[] { + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0new Integer(i), newV= alue});
      + =A0 =A0 =A0 =A0} else {
      + =A0 =A0 =A0 =A0 =A0 =A0Array.set(get(obj), i, ne= wValue);
      + =A0 =A0 =A0 =A0}
      + =A0 =A0}
      + =A0 =A0protected void growArrayToSize(Object= obj, Class componentType, int i)
      + =A0 =A0 =A0 =A0 =A0 =A0throws InvocationTargetEx= ception, IllegalAccessException {
            // Get the entire array and make sure it is la= rge enough
            Object array =3D get(obj);
            if (array =3D=3D null || Array.getLength(array) &l= t;=3D i) {
      // Construct a larger array of the same type
      - =A0 =A0 =A0 =A0 =A0 =A0Class componentType =3D n= ull;
      - =A0 =A0 =A0 =A0 =A0 =A0if (getterIndexed !=3D nu= ll) {
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0componentType =3D= getterIndexed.getReturnType();
      - =A0 =A0 =A0 =A0 =A0 =A0} else if (getter !=3D nu= ll) {
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0componentType =3D= getter.getReturnType().getComponentType();
      - =A0 =A0 =A0 =A0 =A0 =A0} else {
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0componentType =3D= field.getType().getComponentType();
      - =A0 =A0 =A0 =A0 =A0 =A0}
      - =A0 =A0 =A0 =A0 =A0 =A0Object newArray =3D
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Array.newInstance= (componentType,i+1);
      -
      + =A0 =A0 =A0 =A0 =A0 =A0Object newArray =3D
      + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Array.new= Instance(componentType,i+1);
      +
              // Set the object to use the larger array
              set(obj, newArray);
      @@ -269,21 +217,6 @@
      set(obj, index, Array.get(array, index));
            }
            }
      -
      - =A0 =A0 =A0 =A0// Set the new value<= br> - =A0 =A0 =A0 =A0if (isIndexed()) { - =A0 =A0 =A0 =A0 =A0 =A0setterIndexed.invoke(obj,= new Object[] {new Integer(i), newValue});
      - =A0 =A0 =A0 =A0} else {
      - =A0 =A0 =A0 =A0 =A0 =A0Array.set(get(obj), i, ne= wValue);
      - =A0 =A0 =A0 =A0}
      - =A0 =A0}
      -
      - =A0 =A0/**
      - =A0 =A0 * Get the name of a property=
      - =A0 =A0 * @return String name of the property
      - =A0 =A0 */
      - =A0 =A0public String getName() {
      = - =A0 =A0 =A0 =A0return name;
        }
      /**
      @@ -292,30 +225,9 @@ =
        */
        public Class getType() {
      if (isIndexed()) {
      - =A0 =A0 =A0 =A0 =A0 =A0return getterIndexed.getR= eturnType();
      - =A0 =A0 =A0 =A0} else if (getter !=3D null) {
      - =A0 =A0 =A0 =A0 =A0 =A0return getter.getReturnTy= pe();
      + =A0 =A0 =A0 =A0 =A0 =A0return ((IndexedPropertyD= escriptor)myPD).getIndexedPropertyType();
      } else {
      - =A0 =A0 =A0 =A0 =A0 =A0return field.getType();
      + =A0 =A0 =A0 =A0 =A0 =A0return myPD.getPropertyTy= pe();
      }
      - =A0 =A0}
      -
      - =A0 =A0/**
      - =A0 =A0 * Get the read Method.
      - =A0 =A0 * (This is package visibility so that Be= an Utils
      - =A0 =A0 * can access this information. =A0The ot= her methods
      - =A0 =A0 * should be used during serialization/de= serialization.)
      - =A0 =A0 */
      - =A0 =A0Method getReadMethod() {
      - =A0 =A0 =A0 =A0return getter;
      - =A0 =A0}
      - =A0 =A0/**
      - =A0 =A0 * Get the write Method.
      - =A0 =A0 * (This is package visibility so that Be= an Utils
      - =A0 =A0 * can access this information. =A0The ot= her methods
      - =A0 =A0 * should be used during serialization/de= serialization.)
      - =A0 =A0 */
      - =A0 =A0Method getWriteMethod() {
      = - =A0 =A0 =A0 =A0return setter;
      }
      }


      1.11 =A0 =A0 =A0+32 -163 =A0 xml-axis/java/src= /org/apache/axis/utils/BeanUtils.java

      Index: BeanUtils.java
      =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
      RCS file: /home/cvs/xml-axis/java/src/org/apache/a= xis/utils/BeanUtils.java,v
      retrieving revision 1.10
      retrieving revision 1.11
      diff -u -r1.10 -r1.11
      --- BeanUtils.java 12 Jul 2002 22:38:55 -0000 1.10=
      +++ BeanUtils.java 30 Jul 2002 06:16:04 -0000 1.11=
      @@ -80,13 +80,19 @@
        /**
        * Create a BeanPropertyDescriptor array for the in= dicated class.
      - =A0 =A0 * @param Class javaType
      - =A0 =A0 * @param TypeDesc meta-data or null
      - =A0 =A0 * @return array of properties in order
      + =A0 =A0 * @param javaType
      + =A0 =A0 * @return an ordered array of properties=
        */
        public static BeanPropertyDescriptor[] getPd(Class= javaType) {
        return getPd(javaType, null);
        }
      +
      + =A0 =A0/**
      + =A0 =A0 * Create a BeanPropertyDescriptor array = for the indicated class.
      + =A0 =A0 * @param javaType
      + =A0 =A0 * @param typeDesc
      + =A0 =A0 * @return an ordered array of properties=
      + =A0 =A0 */
        public static BeanPropertyDescriptor[] getPd(C= lass javaType, TypeDesc typeDesc) {
        BeanPropertyDescriptor[] pd;
        try {
      @@ -179,173 +185,55 @@
      PropertyDescriptor[] rawPd, Class cls) {
        return processPropertyDescriptors(rawPd, cls, = null);
        }
      +
      public static BeanPropertyDescriptor[] processProp= ertyDescriptors(
                  PropertyDescriptor[] rawPd, Class cls, TypeDes= c typeDesc) {
            // Create a copy of the rawPd called myPd
            BeanPropertyDescriptor[] myPd =3D new BeanProperty= Descriptor[rawPd.length];
      - =A0 =A0 =A0 =A0int index1 =3D 0;
      = - =A0 =A0 =A0 =A0for (int i=3D0; i < rawPd.leng= th; i++) {
      - =A0 =A0 =A0 =A0 =A0 =A0if (rawPd[i].getReadMetho= d() !=3D null &&
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0rawPd[i].getWrite= Method() !=3D null) {
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0myPd[index1++] =3D= new BeanPropertyDescriptor(rawPd[i].getName(),
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= rawPd[i].getReadMethod(),
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= rawPd[i].getWriteMethod());
      - =A0 =A0 =A0 =A0 =A0 =A0}
      - =A0 =A0 =A0 =A0}
      + =A0 =A0 =A0 =A0ArrayList pd =3D new ArrayList();=
      try {
      -
      - =A0 =A0 =A0 =A0 =A0 =A0// Create an Array List
      - =A0 =A0 =A0 =A0 =A0 =A0ArrayList pd =3D new Arra= yList();
      - =A0 =A0 =A0 =A0 =A0 =A0for (int i=3D0; i < my= Pd.length; i++) {
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (myPd[i] !=3D = null) {
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pd.add(my= Pd[i]);
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
      = - =A0 =A0 =A0 =A0 =A0 =A0}
      -
      - =A0 =A0 =A0 =A0 =A0 =A0// Build a new pd array
      - =A0 =A0 =A0 =A0 =A0 =A0// defined by the order o= f the set methods.
      - =A0 =A0 =A0 =A0 =A0 =A0// *Note that this is not= guaranteed since the getMethods
      - =A0 =A0 =A0 =A0 =A0 =A0// is not required to ret= urn the methods in the declared order;
      - =A0 =A0 =A0 =A0 =A0 =A0// however it seems to be= the case most of the time. =A0The only way
      - =A0 =A0 =A0 =A0 =A0 =A0// to guarantee the corre= ct ordering is if TypeDesc meta-data is available.
      - =A0 =A0 =A0 =A0 =A0 =A0int index =3D 0;
      - =A0 =A0 =A0 =A0 =A0 =A0ArrayList newPd =3D new A= rrayList();
      - =A0 =A0 =A0 =A0 =A0 =A0for (int i=3D0; i <pd.= size(); i++) {
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0newPd.add(null);<= /font>
      - =A0 =A0 =A0 =A0 =A0 =A0}
      - =A0 =A0 =A0 =A0 =A0 =A0Method[] methods =3D cls.= getMethods();
      - =A0 =A0 =A0 =A0 =A0 =A0for (int i=3D0; i < me= thods.length; i++) {
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Method method =3D= methods[i];
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (method.getNam= e().startsWith("set")) {
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0boolean f= ound =3D false;
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0for (int = j=3D0; j < pd.size() && !found; j++) {
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0i= f (pd.get(j) !=3D null &&
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0((BeanPropertyDescriptor)pd.get(j)).getWriteMethod() !=3D null &= amp;&
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0((BeanPropertyDescriptor)pd.get(j)).getWriteMethod().equals(meth= od)) {
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0found =3D true;
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0newPd.set(index,pd.get(j));
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0index++;
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}=
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}<= /tt>
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
      = - =A0 =A0 =A0 =A0 =A0 =A0}
      - =A0 =A0 =A0 =A0 =A0 =A0// Now if there are any a= dditional property descriptors, add them to the end.
      - =A0 =A0 =A0 =A0 =A0 =A0if (index < pd.size())= {
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0for (int m=3D0; m= < pd.size() && index < pd.size(); m++) {
      = - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0boolean f= ound =3D false;
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0for (int = n=3D0; n < index && !found; n++) {
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0f= ound =3D (pd.get(m)=3D=3DnewPd.get(n));
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}<= /tt>
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (!foun= d) {
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0n= ewPd.set(index, =A0pd.get(m));
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0i= ndex++;
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}<= /tt>
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
      = - =A0 =A0 =A0 =A0 =A0 =A0}
      - =A0 =A0 =A0 =A0 =A0 =A0// If newPd has same numb= er of elements as pd, use newPd.
      - =A0 =A0 =A0 =A0 =A0 =A0if (index =3D=3D pd.size(= )) {
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pd =3D newPd;
      - =A0 =A0 =A0 =A0 =A0 =A0}
      - =A0 =A0 =A0 =A0 =A0 =A0myPd =3D new BeanProperty= Descriptor[pd.size()];
      - =A0 =A0 =A0 =A0 =A0 =A0for (int i=3D0; i <pd.= size(); i++) {
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0myPd[i] =3D (Bean= PropertyDescriptor) pd.get(i);
      - =A0 =A0 =A0 =A0 =A0 =A0}
      - =A0 =A0 =A0 =A0 =A0 =A0// If the javaType is Thr= owable, add the getter methods to the list.
      - =A0 =A0 =A0 =A0 =A0 =A0if (Throwable.class.isAss= ignableFrom(cls)) {
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0for (int i=3D0; i= < methods.length; i++) {
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Method me= thod =3D methods[i];
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (metho= d.getParameterTypes().length =3D=3D 0 &&
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0m= ethod.getReturnType() !=3D void.class &&
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(= method.getName().startsWith("get") ||
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = ((method.getName().startsWith("is") && - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 method.getReturnType() =3D=3D boolean.class))) &&
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/= / Specifically prevent the Throwable get methods
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0!= (method.getName().equals("getMessage") ||
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0method.getName().equals("getLocalizedMessage"))) {<= /tt>
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0b= oolean found =3D false;
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0f= or (int j=3D0; j < pd.size() && !found; j++) { - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0BeanPropertyDescriptor bpd =3D (BeanPropertyDescriptor) pd.get(j= );
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0found =3D method.equals(bpd.getReadMethod());
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}=
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0i= f (!found) {
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0pd.add(new BeanPropertyDescriptor(
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 getPropNameFromReadMethod(method),
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 method));
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}=
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}<= /tt>
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
      = - =A0 =A0 =A0 =A0 =A0 =A0}
      -
      -
      - =A0 =A0 =A0 =A0 =A0 =A0// Get the methods of the= class and look for the special set and
      - =A0 =A0 =A0 =A0 =A0 =A0// get methods for proper= ty "collections"
      - =A0 =A0 =A0 =A0 =A0 =A0for (int i=3D0; i < me= thods.length; i++) {
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (methods[i].ge= tName().startsWith("set") &&
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0methods[i= ].getParameterTypes().length =3D=3D 2) {
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0for (int = j=3D0; j < methods.length; j++) {
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0i= f ((methods[j].getName().startsWith("get") ||
      = - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 methods[j].getName().startsWith("is")) &&
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0methods[j].getParameterTypes().length =3D=3D 1 &&=
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0methods[j].getReturnType() =3D=3D methods[i].getParameterTypes()= [1] &&
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0methods[j].getParameterTypes()[0] =3D=3D int.class &&
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0methods[i].getParameterTypes()[0] =3D=3D int.class) {
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0for (int k=3D0; k < pd.size(); k++) {
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0BeanPropertyDescriptor bpd =3D
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0(BeanPropertyDescriptor) pd.get(k);<= br> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0if (bpd !=3D null &&
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0bpd.getReadMethod() !=3D null &&<= /tt>
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0bpd.getWriteMethod() !=3D null &&=
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0bpd.getReadMethod().getName().equals(methods[j].= getName()) &&
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0bpd.getWriteMethod().getName().equals(methods[i]= .getName())) {
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0pd.set(k, new BeanPropertyDescriptor(bpd.getName= (),
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 bpd.getReadMethod(),
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 bpd.getWriteMethod(),
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 methods[j],
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 methods[i]));
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0}
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0}
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}=
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}<= /tt>
      - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
      = + =A0 =A0 =A0 =A0 =A0 =A0for (int i=3D0; i < ra= wPd.length; i++) {
      + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pd.add(new BeanPr= opertyDescriptor(rawPd[i]));
              }

              // Now look for public fields
              Field fields[] =3D cls.getFields();
        - =A0 =A0 =A0 =A0 =A0 =A0if (fields !=3D null &= ;& fields.length > 0) {
        + =A0 =A0 =A0 =A0 =A0 =A0if (fields !=3D null &= ;& fields.length > 0) {
                  // See if the field is in the list of properti= es
                  // add it if not.
                  for (int i=3D0; i < fields.length; i++) {
        Field f =3D fields[i];
        - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// skip f= ield if it is final, transient, or static
        + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// skip f= ield if it is final, transient, or static
        if (!(Modifier.isStatic(f.getModifiers()) ||
        - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0Modifier.isFinal(f.getModifiers()) ||
        - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0Modifier.isTransient(f.getModifiers()))) {
        + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0Modifier.isFinal(f.getModifiers()) ||
        + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0Modifier.isTransient(f.getModifiers()))) {
                        String fName =3D f.getName();
                        boolean found =3D false;
        - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0f= or (int j=3D0; j<pd.size() && !found; j++) {
        = - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0String pName =3D
        - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0((BeanPropertyDescriptor)pd.get(j)).getName();
        + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0f= or (int j=3D0; j< rawPd.length && !found; j++) {=
        + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0String pName =3D
        + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0((BeanPropertyDescriptor)pd.get(j)).getName();
        if (pName.length() =3D=3D fName.length() &&= ;
        - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0pName.substring(0,1).equalsIgnoreCase(
        - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0fName.substring(0,1))) {
        + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0pName.substring(0,1).equalsIgnoreCase(
        + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0fName.substring(0,1))) {<= /tt>
                              found =3D pName.length() =3D=3D 1 =A0||=
                              pName.substring(1).equals(fName.substring(1));
                        }
                        }
        +
        if (!found) {
        - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0pd.add(new BeanPropertyDescriptor(f.getName(), f));<= br> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0pd.add(new FieldPropertyDescriptor(f.getName(), f));=
                      }
                      }
                }
                }
        // If typeDesc meta data exists, re-order accordin= g to the fields
        - =A0 =A0 =A0 =A0 =A0 =A0if (typeDesc !=3D null &a= mp;&
        - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0typeDesc.getField= s() !=3D null) {
        + =A0 =A0 =A0 =A0 =A0 =A0if (typeDesc !=3D null &a= mp;&
        + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0typeDesc.= getFields() !=3D null) {
                  ArrayList ordered =3D new ArrayList();<= /tt>
                  // Add the TypeDesc elements first
                  = FieldDesc[] fds =3D typeDesc.getFields();
        @@ -353,11 +241,11 @@
        FieldDesc field =3D fds[i];
        if (field.isElement()) {
        boolean found =3D false;
        - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0f= or (int j=3D0;
        - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 j<pd.size() && !found;
        + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0f= or (int j=3D0;
        + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 j<pd.size() && !found; =
                          j++) {
                          if (field.getFieldName().equals(
        - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 ((BeanPropertyDescriptor)pd.get(j)).getName())) {
        + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0((BeanPropertyDescriptor)pd.get(j)).getName())) = {
                              ordered.add(pd.remove(j));
                              found =3D true;
        }
        @@ -377,30 +265,11 @@=
                myPd[i] =3D (BeanPropertyDescriptor) pd.get(i)= ;
                }
        } catch (Exception e) {
        - =A0 =A0 =A0 =A0 =A0 =A0log.error(JavaUtils.getMe= ssage("badPropertyDesc00", cls.getName()), e); + =A0 =A0 =A0 =A0 =A0 =A0log.error(JavaUtils.getMe= ssage("badPropertyDesc00",
        + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 cls.getName()), e);
              throw new InternalException(e); }
        - =A0 =A0 =A0 =A0return myPd;
        - =A0 =A0}
        - =A0 =A0/**
        - =A0 =A0 * Given a read Method (i.e. is or get Me= thod)
        - =A0 =A0 * returns the name of the property.
        - =A0 =A0 */
        - =A0 =A0private static String getPropNameFromRead= Method(Method method) {
        - =A0 =A0 =A0 =A0String name =3D method.getName();=
        - =A0 =A0 =A0 =A0if (name.startsWith("is"= ;)) {
        - =A0 =A0 =A0 =A0 =A0 =A0name =3D name.substring(2= );
        - =A0 =A0 =A0 =A0} else {
        - =A0 =A0 =A0 =A0 =A0 =A0name =3D name.substring(3= );
        - =A0 =A0 =A0 =A0}
        - =A0 =A0 =A0 =A0if (name.length() =3D=3D 0) {
        - =A0 =A0 =A0 =A0 =A0 =A0return null;<= br> - =A0 =A0 =A0 =A0} else if (name.length() =3D=3D 1= ) {
        - =A0 =A0 =A0 =A0 =A0 =A0return Character.toLowerC= ase(name.charAt(0)) + "";
        - =A0 =A0 =A0 =A0} else {
        - =A0 =A0 =A0 =A0 =A0 =A0return Character.toLowerC= ase(name.charAt(0)) + name.substring(1);
        - =A0 =A0 =A0 =A0}
        -
        + =A0 =A0 =A0 =A0return myPd;
        }
        }


        1.1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0xml-axi= s/java/src/org/apache/axis/utils/FieldPropertyDescriptor.java

        Index: FieldPropertyDescriptor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
        /*
        * The Apache Software License, Version 1.1<= /tt>
        *
        *
        * Copyright (c) 2001 The Apache Software Foundatio= n. =A0All rights
        * reserved.
        *
        * Redistribution and use in source and binary form= s, with or without
        * modification, are permitted provided that the fo= llowing conditions
        * are met:
        *
        * 1. Redistributions of source code must retain th= e above copyright
        * =A0 =A0notice, this list of conditions and the f= ollowing disclaimer.
        *
        * 2. Redistributions in binary form must reproduce= the above copyright
        * =A0 =A0notice, this list of conditions and the f= ollowing disclaimer in
        * =A0 =A0the documentation and/or other materials = provided with the
        * =A0 =A0distribution.
        *
        * 3. The end-user documentation included with the = redistribution,
        * =A0 =A0if any, must include the following acknow= ledgment:
        * =A0 =A0 =A0 "This product includes software= developed by the
        * =A0 =A0 =A0 =A0Apache Software Foundation (http://www.apache.org/)."
        * =A0 =A0Alternately, this acknowledgment may appe= ar in the software itself,
        * =A0 =A0if and wherever such third-party acknowle= dgments normally appear.
        *
        * 4. The names "Axis" and "Apache S= oftware Foundation" must
        * =A0 =A0not be used to endorse or promote product= s derived from this
        * =A0 =A0software without prior written permission= . For written
        * =A0 =A0permission, please contact apache@apache.= org.
        *
        * 5. Products derived from this software may not b= e called "Apache",
        * =A0 =A0nor may "Apache" appear in thei= r name, without prior written
        * =A0 =A0permission of the Apache Software Foundat= ion.
        *
        * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPR= ESSED OR IMPLIED
        * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE I= MPLIED WARRANTIES
        * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR = PURPOSE ARE
        * DISCLAIMED. =A0IN NO EVENT SHALL THE APACHE SOFT= WARE FOUNDATION OR
        * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIR= ECT, INCIDENTAL,
        * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (IN= CLUDING, BUT NOT
        * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR S= ERVICES; LOSS OF
        * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)= HOWEVER CAUSED AND
        * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,= STRICT LIABILITY,
        * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARIS= ING IN ANY WAY OUT
        * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF = THE POSSIBILITY OF
        * SUCH DAMAGE.
        * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D
        *
        * This software consists of voluntary contribution= s made by many
        * individuals on behalf of the Apache Software Fou= ndation. =A0For more
        * information on the Apache Software Foundation, p= lease see
        * <http://www.apache.org/>.
        */
        package org.apache.axis.utils;
        =
        import java.lang.reflect.Field;
        import java.lang.reflect.InvocationTargetException= ;
        import java.lang.reflect.Array;
        import java.beans.PropertyDescriptor;<= /ul>
          /**
          *
          * @author Glen Daniels (gdaniels@apache.org)
          */
          public class FieldPropertyDescriptor extends BeanP= ropertyDescriptor {
          private Field field =3D null;
            /**
            * Construct a BPD with a field
            * Both must be set
            * @param _name is the name of the property<= /tt>
              * @param _field is the name of the public inst= ance field
              */
            public FieldPropertyDescriptor(String _name,
            Field _field) {
                field =3D _field;
                try {
                myPD =3D new PropertyDescriptor(_name, null, null)= ;
                } catch (Exception e) {
                // ???
                }
                if (_field =3D=3D null || _name =3D=3D null) {
                  throw new IllegalArgumentException(
                  JavaUtils.getMessage(_field =3D=3D null ?
                "badField00" : "badProp03"));<= /font>
                }
            }

            public String getName() {
            return field.getName();
            }

            /**
            * Query if property is readable
            * @return true if readable
            */
            public boolean isReadable() {
            return true;
            }

            /**
            * Query if property is writeable
            * @return true if writeable
            */
            public boolean isWriteable() {
            return true;
            }

            /**
            * Query if property is indexed.
            * Indexed properties require valid setters/getters=
            * @return true if indexed methods exist
            */
            public boolean isIndexed() {
            return (field.getType().getComponentType() !=3D nu= ll);
            }

            /**
            * Get the property value
            * @param obj is the object
            * @return the entire propery value
            = */
            public Object get(Object obj)
            throws InvocationTargetException, IllegalAccessExc= eption {
            return field.get(obj);
            }
            /**
            * Set the property value
            * @param obj is the object
            * @param newValue is the new value
            = */
            public void set(Object obj, Object newValue)
            throws InvocationTargetException, IllegalAccessExc= eption {
            field.set(obj, newValue);
            }
            /**
            * Get an indexed property
            * @param obj is the object
            * @param i the index
            * @return the object at the indicated index=
            */
            public Object get(Object obj, int i) throws InvocationTargetException, IllegalAccessExc= eption {
              if (!isIndexed()) {
              throw new IllegalAccessException("Not an inde= xed property");
              }

              Object array =3D field.get(obj);
              return Array.get(array, i);
            }

            /**
            * Set an indexed property value
            * @param obj is the object
            * @param i the index
            * @param newValue is the new value
            = */
            public void set(Object obj, int i, Object newValue= )
            throws InvocationTargetException, IllegalAccessExc= eption {
              if (!isIndexed()) {
              throw new IllegalAccessException("Not an inde= xed field!");
              }
              Class componentType =3D field.getType().getCompone= ntType();
              growArrayToSize(obj, componentType, i);
              Array.set(get(obj), i, newValue);
            = }

            /**
            * Get the type of a property
            * @return the type of the property
            = */
            public Class getType() {
            if (isIndexed()) {
              return field.getType().getComponentType();
              } else {
              return field.getType();
              }
          }
          }


          1.119 =A0 =A0 +3 -26 =A0 =A0 xml-axis/java/tes= t/wsdl/Wsdl2javaTestSuite.xml

          Index: Wsdl2javaTestSuite.xml
          =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
          RCS file: /home/cvs/xml-axis/java/test/wsdl/Wsdl2j= avaTestSuite.xml,v
          retrieving revision 1.118
          retrieving revision 1.119
          diff -u -r1.118 -r1.119
          --- Wsdl2javaTestSuite.xml 26 Jul 2002 15:48:28 -0= 000 1.118
          +++ Wsdl2javaTestSuite.xml 30 Jul 2002 06:16:04 -0= 000 1.119
          @@ -263,8 +263,7 @@ <= /font>
            <wsdl2java url=3D"test/wsdl/sequ ence/SequenceTest.wsdl"
            output=3D"build/work"
            deployscope=3D"session"
          = - =A0 =A0 =A0 =A0 =A0 =A0 =A0 serverSide=3D"y= es"
          - =A0 =A0 =A0 =A0 =A0 =A0 =A0 skeletonDeploy=3D&qu= ot;yes"
          + =A0 =A0 =A0 =A0 =A0 =A0 =A0 serverSide=3D"n= o"
                    noimports=3D"no"
                    verbose=3D"no"
                    testcase=3D"no">
          @@ -273,37 +272,15 @@
          <!-- Copy modified files to work directory --&g= t;
          <copy todir=3D"${build.dir}/work/test/wsdl= /sequence" overwrite=3D"yes">
          <fileset dir=3D"${test.dir}/wsdl/sequence&= quot;>
          - =A0 =A0 =A0 =A0<include name=3D"Sequence= Info.java"/>
          + =A0 =A0 =A0 =A0<include name=3D"Sequence= Service.java"/>
          + =A0 =A0 =A0 =A0<include name=3D"deploy.w= sdd"/>
            </fileset>
            </copy>
            <!-- Compile Java -->
            <javac srcdir=3D"${build.dir}/work" d= estdir=3D"${build.dest}" debug=3D"${debug}">
              <classpath refid=3D"test-classpath&quo= t; />
              <include name=3D"test/wsdl/sequence/**.jav= a" />
          - =A0 =A0 =A0<exclude name=3D"test/wsdl/se= quence/*TestCase.java" />
          - =A0 =A0 =A0<exclude name=3D"test/wsdl/se= quence/*Impl.java" />
          </javac>
          - =A0 =A0<!-- Now create a WSDL file from the J= ava classes -->
          - =A0 =A0<java2wsdl output=3D"build/work/t= est/wsdl/sequence/SequenceTest.wsdl"
          - =A0 =A0 =A0 =A0 =A0 =A0 =A0 className=3D "t= est.wsdl.sequence.SequenceTestPortType"
          - =A0 =A0 =A0 =A0 =A0 =A0 =A0 implClass=3D "t= est.wsdl.sequence.SequenceTestSoapBindingSkeleton"
          = - =A0 =A0 =A0 =A0 =A0 =A0 =A0 namespace=3D"ur= n:SequenceTest2"
          - =A0 =A0 =A0 =A0 =A0 =A0 =A0 location=3D"<= tt>http://localhost:8080/axis/ser= vices/SequenceTest
          ">
          - =A0 =A0 =A0 =A0<mapping namespace=3D"urn= :SequenceTest2" package=3D"test.wsdl.sequence"/>
          - =A0 =A0</java2wsdl>
          - =A0 =A0<!-- Delete the intermediate files so = we recreate over a clean slate -->
          - =A0 =A0<delete dir=3D"${build.dir}/class= es/test/wsdl/sequence"/>
          - =A0 =A0<!-- Recreate Java files from the new = WSDL -->
          - =A0 =A0<wsdl2java url=3D"build/work/test= /wsdl/sequence/SequenceTest.wsdl"
          - =A0 =A0 =A0 =A0 =A0 =A0 =A0 output=3D"build= /work"
          - =A0 =A0 =A0 =A0 =A0 =A0 =A0 deployscope=3D"= session"
          - =A0 =A0 =A0 =A0 =A0 =A0 =A0 serverSide=3D"y= es"
          - =A0 =A0 =A0 =A0 =A0 =A0 =A0 skeletonDeploy=3D&qu= ot;yes"
          - =A0 =A0 =A0 =A0 =A0 =A0 =A0 noimports=3D"no= "
          - =A0 =A0 =A0 =A0 =A0 =A0 =A0 verbose=3D"no&q= uot;
          - =A0 =A0 =A0 =A0 =A0 =A0 =A0 testcase=3D"no&= quot;>
          - =A0 =A0 =A0 =A0<mapping namespace=3D"urn= :SequenceTest2" package=3D"test.wsdl.sequence"/>
          - =A0 =A0</wsdl2java>
            <!-- ArrayTest Test -->
            <wsdl2java url=3D"test/wsdl/arrays/ArrayTe= st.wsdl"

          1.9 =A0 =A0 =A0 +36 -60 =A0 =A0xml-axis/java/t= est/wsdl/arrays/PersonalInfoBookServiceTestCase.java

          Index: PersonalInfoBookServiceTestCase.java=
          =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
          RCS file: /home/cvs/xml-axis/java/test/wsdl/arrays= /PersonalInfoBookServiceTestCase.java,v
          retrieving revision 1.8
          retrieving revision 1.9
          diff -u -r1.8 -r1.9
          --- PersonalInfoBookServiceTestCase.java 30 May 20= 02 23:46:03 -0000 1.8
          +++ PersonalInfoBookServiceTestCase.java 30 Jul 20= 02 06:16:04 -0000 1.9
          @@ -16,7 +16,7 @@


          - =A0 =A0public void testPersonalInfoBook() {<= /font>
          + =A0 =A0public void testPersonalInfoBook() throws= Exception {
                // Set up some testcase values
                = String name =3D "Joe Geek";<= /ul>
            @@ -43,71 +43,47 @@
                  // Get the stub and set Session test.wsdl.arrays.PersonalInfoBook binding;<= /tt>
            - =A0 =A0 =A0 =A0try {
            - =A0 =A0 =A0 =A0 =A0 =A0binding =3D new PersonalI= nfoBookServiceLocator().getPersonalInfoBook();
            - =A0 =A0 =A0 =A0}
            - =A0 =A0 =A0 =A0catch (javax.xml.rpc.ServiceExcep= tion jre) {
            - =A0 =A0 =A0 =A0 =A0 =A0throw new junit.framework= .AssertionFailedError("JAX-RPC ServiceException caught: " + j= re );
            - =A0 =A0 =A0 =A0}
            + =A0 =A0 =A0 =A0binding =3D new PersonalInfoBookS= erviceLocator().getPersonalInfoBook();
                  assertTrue("binding is null", bindin= g !=3D null);
                  ((PersonalInfoBookSOAPBindingStub) binding).setMai= ntainSession (true);
            // Add the name and personal info for Joe Geek
            - =A0 =A0 =A0 =A0try {
            - =A0 =A0 =A0 =A0 =A0 =A0binding.addEntry(name, pi= );
            - =A0 =A0 =A0 =A0} catch (java.rmi.RemoteException= re) {
            - =A0 =A0 =A0 =A0 =A0 =A0throw new junit.framework= .AssertionFailedError("Remote Exception caught: " + re );
            - =A0 =A0 =A0 =A0}
            + =A0 =A0 =A0 =A0binding.addEntry(name, pi);
            // Now get the personal info and check validit= y
            - =A0 =A0 =A0 =A0try {
            - =A0 =A0 =A0 =A0 =A0 =A0test.wsdl.arrays.Personal= Info value =3D null;
            - =A0 =A0 =A0 =A0 =A0 =A0value =3D binding.getPers= onalInfoFromName(name);
            - =A0 =A0 =A0 =A0 =A0 =A0assertTrue("Name is = corrupted " + value,
            - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 valu= e.getName().equals(pi.getName()));
            - =A0 =A0 =A0 =A0 =A0 =A0assertTrue("Movies a= re corrupted " + value,
            - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 valu= e.getFavoriteMovies()[1].equals(pi.getFavoriteMovies()[1]));
            - =A0 =A0 =A0 =A0 =A0 =A0assertTrue("Hobbies = are corrupted " + value,
            - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 valu= e.getHobbies()[1].equals(pi.getHobbies()[1]));
            - =A0 =A0 =A0 =A0 =A0 =A0assertTrue("Pets are= corrupted " + value,
            - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 valu= e.getPets().elementAt(1).equals(pi.getPets().elementAt(1)));
            - =A0 =A0 =A0 =A0 =A0 =A0assertTrue("Id is co= rrupted " + value,
            - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 valu= e.getId()[0] =3D=3D 0 && value.getId()[1] =3D=3D 0 && v= alue.getId()[2] =3D=3D 7);
            - =A0 =A0 =A0 =A0 =A0 =A0assertTrue("Id2 is c= orrupted " + value,
            - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 valu= e.getId2() =3D=3D pi.getId2());
            - =A0 =A0 =A0 =A0 =A0 =A0assertTrue("Food are= corrupted " + value,
            - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 valu= e.getFoods(1).equals(pi.getFoods(1)));
            - =A0 =A0 =A0 =A0 =A0 =A0assertTrue("Nickname= is corrupted " + value,
            - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 valu= e.getNickName()[1] =3D=3D pi.getNickName()[1]);
            -
            - =A0 =A0 =A0 =A0} catch (java.rmi.RemoteException= re) {
            - =A0 =A0 =A0 =A0 =A0 =A0throw new junit.framework= .AssertionFailedError("Remote Exception caught: " + re );
            - =A0 =A0 =A0 =A0}
            -
            - =A0 =A0 =A0 =A0try {
            - =A0 =A0 =A0 =A0 =A0 =A0Vector value =3D null;
            - =A0 =A0 =A0 =A0 =A0 =A0value =3D binding.getPets= FromName(name);
            - =A0 =A0 =A0 =A0 =A0 =A0assertTrue("PetsFrom= Name is broken " + value,
            - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 valu= e.elementAt(1).equals(pi.getPets().elementAt(1)));
            - =A0 =A0 =A0 =A0} catch (java.rmi.RemoteException= re) {
            - =A0 =A0 =A0 =A0 =A0 =A0throw new junit.framework= .AssertionFailedError("Remote Exception caught: " + re );
            - =A0 =A0 =A0 =A0}
            - =A0 =A0 =A0 =A0try {
            - =A0 =A0 =A0 =A0 =A0 =A0int[] value =3D null;
            - =A0 =A0 =A0 =A0 =A0 =A0value =3D binding.getIDFr= omName(name);
            - =A0 =A0 =A0 =A0 =A0 =A0assertTrue("getIDFro= mName is brokent " + value,
            - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 valu= e[0] =3D=3D 0 && value[1] =3D=3D 0 && value[2] =3D=3D 7= );
            - =A0 =A0 =A0 =A0} catch (java.rmi.RemoteException= re) {
            - =A0 =A0 =A0 =A0 =A0 =A0throw new junit.framework= .AssertionFailedError("Remote Exception caught: " + re );
            - =A0 =A0 =A0 =A0}
            - =A0 =A0 =A0 =A0try {
            - =A0 =A0 =A0 =A0 =A0 =A0int value =3D -3;<= /tt>
            - =A0 =A0 =A0 =A0 =A0 =A0value =3D binding.getID2F= romName(name);
            - =A0 =A0 =A0 =A0 =A0 =A0assertTrue("getID2Fr= omName is brokent " + value,
            - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 valu= e =3D=3D pi.getId2());
            - =A0 =A0 =A0 =A0} catch (java.rmi.RemoteException= re) {
            - =A0 =A0 =A0 =A0 =A0 =A0throw new junit.framework= .AssertionFailedError("Remote Exception caught: " + re );
            - =A0 =A0 =A0 =A0}
            + =A0 =A0 =A0 =A0test.wsdl.arrays.PersonalInfo val= ue =3D null;
            + =A0 =A0 =A0 =A0value =3D binding.getPersonalInfo= FromName(name);
            + =A0 =A0 =A0 =A0assertTrue("Name is corrupte= d " + value,
            + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 value.getNam= e().equals(pi.getName()));
            + =A0 =A0 =A0 =A0assertTrue("Movies are corru= pted " + value,
            + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 value.getFav= oriteMovies()[1].equals(pi.getFavoriteMovies()[1]));
            + =A0 =A0 =A0 =A0assertTrue("Hobbies are corr= upted " + value,
            + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 value.getHob= bies()[1].equals(pi.getHobbies()[1]));
            + =A0 =A0 =A0 =A0assertTrue("Pets are corrupt= ed " + value,
            + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 value.getPet= s().elementAt(1).equals(pi.getPets().elementAt(1)));
            + =A0 =A0 =A0 =A0assertTrue("Id is corrupted = " + value,
            + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 value.getId(= )[0] =3D=3D 0 && value.getId()[1] =3D=3D 0 && value.get= Id()[2] =3D=3D 7);
            + =A0 =A0 =A0 =A0assertTrue("Id2 is corrupted= " + value,
            + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 value.getId2= () =3D=3D pi.getId2());
            + =A0 =A0 =A0 =A0assertTrue("Food are corrupt= ed " + value,
            + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 value.getFoo= ds(1).equals(pi.getFoods(1)));
            + =A0 =A0 =A0 =A0assertTrue("Nickname is corr= upted " + value,
            + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 value.getNic= kName()[1] =3D=3D pi.getNickName()[1]);
            +
            + =A0 =A0 =A0 =A0Vector value2 =3D null;
            + =A0 =A0 =A0 =A0value2 =3D binding.getPetsFromNam= e(name);
            + =A0 =A0 =A0 =A0assertTrue("PetsFromName is = broken " + value2,
            + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 value2.eleme= ntAt(1).equals(pi.getPets().elementAt(1)));
            +
            + =A0 =A0 =A0 =A0int[] value3 =3D null;
            + =A0 =A0 =A0 =A0value3 =3D binding.getIDFromName(= name);
            + =A0 =A0 =A0 =A0assertTrue("getIDFromName is= brokent " + value3,
            + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 value3[0] =3D= =3D 0 && value3[1] =3D=3D 0 && value3[2] =3D=3D 7);
            +
            + =A0 =A0 =A0 =A0int value4 =3D -3; + =A0 =A0 =A0 =A0value4 =3D binding.getID2FromName= (name);
            + =A0 =A0 =A0 =A0assertTrue("getID2FromName i= s brokent " + value4,
            + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 value4 =3D=3D= pi.getId2());
            }
            }



            1.4 =A0 =A0 =A0 +2 -4 =A0 =A0 =A0xml-axis/java= /test/wsdl/sequence/SequenceTest.wsdl

            Index: SequenceTest.wsdl
            =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
            RCS file: /home/cvs/xml-axis/java/test/wsdl/sequen= ce/SequenceTest.wsdl,v
            retrieving revision 1.3
            retrieving revision 1.4
            diff -u -r1.3 -r1.4
            --- SequenceTest.wsdl 31 May 2002 19:08:12 -0000 1= .3
            +++ SequenceTest.wsdl 30 Jul 2002 06:16:04 -0000 1= .4
            @@ -4,7 +4,7 @@
                    targetNamespace=3D"urn:SequenceTest2"= ;
                    xmlns:tns=3D"urn:SequenceTest2"
                    xmlns:typens=3D"urn:SequenceTest2"
            - =A0 =A0 =A0 =A0 =A0 =A0 xmlns:xsd=3D"http://www.w3.org/1999/XMLSchema<= /a>"
            + =A0 =A0 =A0 =A0 =A0 =A0 xmlns:xsd=3D"
            http://www.w3.org/2001/XMLSchema<= /a>"
            @@ -15,8 +15,6 @@
            <xsd:schema targetNamespace=3D"urn:Sequenc= eTest2" -
            -
                <xsd:complexType name=3D"sequenceInfo&= quot;>
                <xsd:sequence>
            <xsd:element name=3D"zero" =A0type=3D= "xsd:int"/>
            @@ -36,7 +34,7 @@
              </message>
            <message name=3D"testSequenceResponse"= ;>
            - =A0 =A0<part name=3D"rc" type=3D&qu= ot;soapenc:int"/>
            + =A0 =A0<part name=3D"return" type=3D= "xsd:boolean"/>
              </message>

              <!-- port type declns -->
            1.5 =A0 =A0 =A0 +6 -16 =A0 =A0 xml-axis/java/t= est/wsdl/sequence/SequenceTestServiceTestCase.java

            Index: SequenceTestServiceTestCase.java
            =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
            RCS file: /home/cvs/xml-axis/java/test/wsdl/sequen= ce/SequenceTestServiceTestCase.java,v
            retrieving revision 1.4
            retrieving revision 1.5
            diff -u -r1.4 -r1.5
            --- SequenceTestServiceTestCase.java 5 Feb 2002 16= :22:40 -0000 1.4
            +++ SequenceTestServiceTestCase.java 30 Jul 2002 0= 6:16:04 -0000 1.5
            @@ -1,7 +1,8 @@
            /**
            * SequenceTestServiceTestCase.java
            = *
            - * @author: Rich Scheuerle (scheu@us.ibm.com)
            + * @author Rich Scheuerle (scheu@us.ibm.com)
            + * @author Glen Daniels (gdaniels@apache.org)
            */

            package test.wsdl.sequence;
            @@ -11,23 +12,12 @@ <= /font>
              super(name);
              }
            - =A0 =A0public void testSequenceTest() {
            + =A0 =A0public void testSequenceTest() throws Exc= eption {
            test.wsdl.sequence.SequenceTestPortType binding;
            - =A0 =A0 =A0 =A0try {
            - =A0 =A0 =A0 =A0 =A0 =A0binding =3D new SequenceT= estLocator().getSequenceTest();
            - =A0 =A0 =A0 =A0}
            - =A0 =A0 =A0 =A0catch (javax.xml.rpc.ServiceExcep= tion jre) {
            - =A0 =A0 =A0 =A0 =A0 =A0throw new junit.framework= .AssertionFailedError("JAX-RPC ServiceException caught: " + j= re );
            - =A0 =A0 =A0 =A0}
            + =A0 =A0 =A0 =A0binding =3D new SequenceTestLocat= or().getSequenceTest();
            assertTrue("binding is null", binding !=3D= null);
            - =A0 =A0 =A0 =A0try {
            - =A0 =A0 =A0 =A0 =A0 =A0Integer value =3D null;
            - =A0 =A0 =A0 =A0 =A0 =A0value =3D binding.testSeq= uence(new test.wsdl.sequence.SequenceInfo());
            - =A0 =A0 =A0 =A0 =A0 =A0assertTrue("Test Seq= uence Failed=3D"+value, =A0 =A0 =A0 =A0 =A0 =A0 (value !=3D null))= ;
            - =A0 =A0 =A0 =A0 =A0 =A0assertTrue("Test Seq= uence Failed=3D"+value.intValue() , (value.intValue() =3D=3D 0));<= /font>
            - =A0 =A0 =A0 =A0} catch (java.rmi.RemoteException= re) {
            - =A0 =A0 =A0 =A0 =A0 =A0throw new junit.framework= .AssertionFailedError("Remote Exception caught: " + re );
            - =A0 =A0 =A0 =A0}
            + =A0 =A0 =A0 =A0assertTrue("Test failed!&quo= t;,
            + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 binding.test= Sequence(new test.wsdl.sequence.SequenceInfo()));
            }
            }



            1.2 =A0 =A0 =A0 +0 -29 =A0 =A0 xml-axis/java/t= est/wsdl/sequence/buildComponent.xml

            Index: buildComponent.xml
            =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
            RCS file: /home/cvs/xml-axis/java/test/wsdl/sequen= ce/buildComponent.xml,v
            retrieving revision 1.1
            retrieving revision 1.2
            diff -u -r1.1 -r1.2
            --- buildComponent.xml 22 Jul 2002 20:14:25 -0000 = 1.1
            +++ buildComponent.xml 30 Jul 2002 06:16:04 -0000 = 1.2
            @@ -34,40 +34,11 @@ <= /font>
                  testcase=3D"no">
                  <mapping namespace=3D"urn:SequenceTest2&qu= ot; package=3D"test.wsdl.sequence"/>
            </wsdl2java>
            - =A0 =A0<!-- Copy modified files to work direc= tory -->
            - =A0 =A0<copy todir=3D"${build.dir}/work/= test/wsdl/sequence" overwrite=3D"yes"> - =A0 =A0 =A0<fileset dir=3D"${test.dir}/w= sdl/sequence">
            - =A0 =A0 =A0 =A0<include name=3D"Sequence= Info.java"/>
            - =A0 =A0 =A0</fileset>
            - =A0 =A0</copy>
              <!-- Compile Java -->
              <javac srcdir=3D"${build.dir}/work" d= estdir=3D"${build.dest}" debug=3D"${debug}">
                <classpath refid=3D"classpath" /&= gt;
                <include name=3D"test/wsdl/sequence/**.jav= a" />
            - =A0 =A0 =A0<exclude name=3D"test/wsdl/se= quence/*TestCase.java" />
            - =A0 =A0 =A0<exclude name=3D"test/wsdl/se= quence/*Impl.java" />
            </javac>
            - =A0 =A0<!-- Now create a WSDL file from the J= ava classes -->
            - =A0 =A0<java2wsdl output=3D"build/work/t= est/wsdl/sequence/SequenceTest.wsdl"
            - =A0 =A0 =A0 =A0 =A0 =A0 =A0 className=3D "t= est.wsdl.sequence.SequenceTestPortType"
            - =A0 =A0 =A0 =A0 =A0 =A0 =A0 implClass=3D "t= est.wsdl.sequence.SequenceTestSoapBindingSkeleton"
            = - =A0 =A0 =A0 =A0 =A0 =A0 =A0 namespace=3D"ur= n:SequenceTest2"
            - =A0 =A0 =A0 =A0 =A0 =A0 =A0 location=3D"<= tt>http://localhost:8080/axis/ser= vices/SequenceTest
            ">
            - =A0 =A0 =A0 =A0<mapping namespace=3D"urn= :SequenceTest2" package=3D"test.wsdl.sequence"/>
            - =A0 =A0</java2wsdl>
            - =A0 =A0<!-- Delete the intermediate files so = we recreate over a clean slate -->
            - =A0 =A0<delete dir=3D"${build.dir}/class= es/test/wsdl/sequence"/>
            - =A0 =A0<!-- Recreate Java files from the new = WSDL -->
            - =A0 =A0<wsdl2java url=3D"build/work/test= /wsdl/sequence/SequenceTest.wsdl"
            - =A0 =A0 =A0 =A0 =A0 =A0 =A0 output=3D"build= /work"
            - =A0 =A0 =A0 =A0 =A0 =A0 =A0 deployscope=3D"= session"
            - =A0 =A0 =A0 =A0 =A0 =A0 =A0 serverSide=3D"y= es"
            - =A0 =A0 =A0 =A0 =A0 =A0 =A0 skeletonDeploy=3D&qu= ot;yes"
            - =A0 =A0 =A0 =A0 =A0 =A0 =A0 noimports=3D"no= "
            - =A0 =A0 =A0 =A0 =A0 =A0 =A0 verbose=3D"no&q= uot;
            - =A0 =A0 =A0 =A0 =A0 =A0 =A0 testcase=3D"no&= quot;>
            - =A0 =A0 =A0 =A0<mapping namespace=3D"urn= :SequenceTest2" package=3D"test.wsdl.sequence"/>
            - =A0 =A0</wsdl2java>
            </target>

            <target name=3D"deploy"/>

            1.1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0xml-axi= s/java/test/wsdl/sequence/SequenceService.java

            Index: SequenceService.java
            =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
            /*
            * The Apache Software License, Version 1.1<= /tt>
            *
            *
            * Copyright (c) 2001 The Apache Software Foundatio= n. =A0All rights
            * reserved.
            *
            * Redistribution and use in source and binary form= s, with or without
            * modification, are permitted provided that the fo= llowing conditions
            * are met:
            *
            * 1. Redistributions of source code must retain th= e above copyright
            * =A0 =A0notice, this list of conditions and the f= ollowing disclaimer.
            *
            * 2. Redistributions in binary form must reproduce= the above copyright
            * =A0 =A0notice, this list of conditions and the f= ollowing disclaimer in
            * =A0 =A0the documentation and/or other materials = provided with the
            * =A0 =A0distribution.
            *
            * 3. The end-user documentation included with the = redistribution,
            * =A0 =A0if any, must include the following acknow= ledgment:
            * =A0 =A0 =A0 "This product includes software= developed by the
            * =A0 =A0 =A0 =A0Apache Software Foundation (http://www.apache.org/)."
            * =A0 =A0Alternately, this acknowledgment may appe= ar in the software itself,
            * =A0 =A0if and wherever such third-party acknowle= dgments normally appear.
            *
            * 4. The names "Axis" and "Apache S= oftware Foundation" must
            * =A0 =A0not be used to endorse or promote product= s derived from this
            * =A0 =A0software without prior written permission= . For written
            * =A0 =A0permission, please contact apache@apache.= org.
            *
            * 5. Products derived from this software may not b= e called "Apache",
            * =A0 =A0nor may "Apache" appear in thei= r name, without prior written
            * =A0 =A0permission of the Apache Software Foundat= ion.
            *
            * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPR= ESSED OR IMPLIED
            * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE I= MPLIED WARRANTIES
            * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR = PURPOSE ARE
            * DISCLAIMED. =A0IN NO EVENT SHALL THE APACHE SOFT= WARE FOUNDATION OR
            * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIR= ECT, INCIDENTAL,
            * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (IN= CLUDING, BUT NOT
            * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR S= ERVICES; LOSS OF
            * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)= HOWEVER CAUSED AND
            * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,= STRICT LIABILITY,
            * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARIS= ING IN ANY WAY OUT
            * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF = THE POSSIBILITY OF
            * SUCH DAMAGE.
            * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D
            *
            * This software consists of voluntary contribution= s made by many
            * individuals on behalf of the Apache Software Fou= ndation. =A0For more
            * information on the Apache Software Foundation, p= lease see
            * <http://www.apache.org/>.
            */
            package test.wsdl.sequence;

            import org.w3c.dom.Element;
            import org.w3c.dom.NodeList;
            import org.w3c.dom.Node;
            import org.w3c.dom.Document;
            import org.w3c.dom.Text;
            import org.apache.axis.utils.XMLUtils;=
            import java.util.Vector;

            /**
            * Sequence test service. =A0This is a custom built= message-style service
            * which confirms that
            *
            * @author Glen Daniels (gdaniels@apache.org)
            */
            public class SequenceService {
            private String [] names =3D new String [] { "= zero",
                                          "one",
                                          "two",
                                          "three",
                                          "four",
                                          "five" };
              /**
              * This is a message-style service because we're ju= st testing the
              * serialization.
              *
              * @return
              */
              public Element [] testSequence(Vector elems) {
              Element zero =3D null;
              for (int i =3D 0; i < elems.size(); i++) {
                    zero =3D findTheZero((Element)elems.get(i));
                    if (zero !=3D null)
                break;
                }
                Document retDoc =3D XMLUtils.newDocument();
                Element [] ret =3D new Element [1]; ret[0] =3D retDoc.createElementNS("urn:Sequen= ceTest",
                "testSequenceResponse");
                = boolean success =3D false;
                Element resultElement;

                if (zero !=3D null) {
                // Check for correct ordering
                int i =3D 1;
                Node sib =3D zero.getNextSibling(); for (i =3D 1; i < names.length; i++) {
                      while ((sib !=3D null) && !(sib instan= ceof Element))
                      sib =3D sib.getNextSibling();
                      if ((sib =3D=3D null) ||
                      !(names[i].equals(((Element)sib).getLocalName())))=
                        break;
                    sib =3D sib.getNextSibling();
                    }
                    if (i =3D=3D names.length)
                success =3D true;
                }
                resultElement =3D retDoc.createElement("r= eturn");

                String resultStr =3D "false";
                if (success) {
                resultStr =3D "true";
                }
                Text text =3D retDoc.createTextNode(resultStr);
                resultElement.appendChild(text);
                ret[0].appendChild(resultElement);=
                return ret;
              }

              /**
              * Walk an XML tree, looking for a <zero> ele= ment
              * @param start
              * @return
              */
              private Element findTheZero(Element start) {
              if (names[0].equals(start.getLocalName())) {
                return start;
                }
                NodeList nl =3D start.getChildNodes();=
                for (int i =3D 0; i < nl.getLength(); i++) {
                    Node node =3D nl.item(i);
                    if (node instanceof Element) {
                      Element result =3D findTheZero((Element)node);=
                      if (result !=3D null) {
                      return result;
                      }
                }
                }
                return null;
            }
            }


            1.1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0xml-axi= s/java/test/wsdl/sequence/deploy.wsdd

            Index: deploy.wsdd
            =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
            <!-- Deployment for sequence test, built manual= ly because the test -->
            <!-- implementation just deals with raw XML =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0-->

            1.1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0xml-axi= s/java/test/wsdl/sequence/readme.txt

            Index: readme.txt
            =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
            This test confirms that the WSDL2Java / serializat= ion system does the right
            thing with <sequence> ordering of XML elemen= ts (which map to bean fields).
            In the WSDL file, we have a type with six orde= red elements. =A0We build this
            into a bean, then use the generated client + bean = to call a test service.
            The service is NOT generated, but a custom bui= lt message-style service which
            simply confirms the XML looks right by walking the= DOM tree until it finds
            the <zero> element, then checking the siblin= gs look right. =A0It returns a
            boolean true/false which indicates if the run was = successful.
            --Glen Daniels
            July 30, 2002



          = --0__=09BBE695DFD53C0B8f9e8a93df938690918c09BBE695DFD53C0B--