You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ga...@apache.org on 2007/07/18 00:26:28 UTC

svn commit: r557076 - in /webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description: builder/converter/ impl/

Author: gawor
Date: Tue Jul 17 15:26:20 2007
New Revision: 557076

URL: http://svn.apache.org/viewvc?view=rev&rev=557076
Log:
fixes ClassCastException problem as described in AXIS2-2419

Modified:
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/ConverterUtils.java
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaMethodsToMDCConverter.java
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ParameterDescriptionImpl.java

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/ConverterUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/ConverterUtils.java?view=diff&rev=557076&r1=557075&r2=557076
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/ConverterUtils.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/ConverterUtils.java Tue Jul 17 15:26:20 2007
@@ -30,6 +30,7 @@
 
 import javax.jws.HandlerChain;
 import javax.jws.soap.SOAPBinding;
+import javax.xml.bind.annotation.XmlList;
 import javax.xml.ws.WebServiceRef;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.AnnotatedElement;
@@ -231,5 +232,18 @@
             paramType = getType(((GenericArrayType)type).getGenericComponentType(), paramType) + "[]";
         }
         return paramType;
+    }
+    
+    /**
+     * This method will search array of parameter annotations for the presence of the @XmlList
+     * annotation.
+     */
+    public static boolean hasXmlListAnnotation(Annotation[] annotations) {
+        for(Annotation annotation : annotations) {
+            if(annotation.annotationType() == XmlList.class) {
+                return true;
+            }
+        }
+        return false;
     }
 }

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaMethodsToMDCConverter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaMethodsToMDCConverter.java?view=diff&rev=557076&r1=557075&r2=557076
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaMethodsToMDCConverter.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaMethodsToMDCConverter.java Tue Jul 17 15:26:20 2007
@@ -32,6 +32,7 @@
 import javax.xml.ws.RequestWrapper;
 import javax.xml.ws.ResponseWrapper;
 import javax.xml.ws.WebEndpoint;
+
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
 import java.lang.reflect.ParameterizedType;
@@ -67,6 +68,7 @@
                 setExceptionList(mdc, method);
                 mdc.setMethodName(method.getName());
                 setReturnType(mdc, method);
+                setIsListType(mdc, method);
                 mdc.setDeclaringClass(method.getDeclaringClass().getName());
                 attachHandlerChainAnnotation(mdc, method);
                 attachOnewayAnnotation(mdc, method);
@@ -302,4 +304,9 @@
             mdc.setReturnType(((Class)type).getName());
 		}
 	}
+    
+    private void setIsListType(MethodDescriptionComposite mdc, Method method) {
+        mdc.setIsListType(ConverterUtils.hasXmlListAnnotation(method.getAnnotations()));
+    }
+        
 }

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java?view=diff&rev=557076&r1=557075&r2=557076
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java Tue Jul 17 15:26:20 2007
@@ -42,6 +42,7 @@
 import org.apache.axis2.jaxws.description.builder.MethodDescriptionComposite;
 import org.apache.axis2.jaxws.description.builder.OneWayAnnot;
 import org.apache.axis2.jaxws.description.builder.ParameterDescriptionComposite;
+import org.apache.axis2.jaxws.description.builder.converter.ConverterUtils;
 import org.apache.axis2.wsdl.WSDLConstants;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -186,7 +187,7 @@
         parentEndpointInterfaceDescription = parent;
         partAttachmentMap = new HashMap<String, AttachmentDescription>();
         setSEIMethod(method);
-		checkForXmlListAnnotation(method.getAnnotations());
+		isListType = ConverterUtils.hasXmlListAnnotation(method.getAnnotations());
         // The operationQName is intentionally unqualified to be consistent with the remaining parts of the system. 
         // Using a qualified name will cause breakage.
         // Don't do --> this.operationQName = new QName(parent.getTargetNamespace(), getOperationName());
@@ -1658,14 +1659,6 @@
     public void setOperationRuntimeDesc(OperationRuntimeDescription ord) {
         // TODO Add toString support
         runtimeDescMap.put(ord.getKey(), ord);
-    }
-
-    private void checkForXmlListAnnotation(Annotation[] annotations) {
-    	for(Annotation annotation : annotations) {
-    		if(annotation.annotationType() == XmlList.class) {
-    			isListType = true;
-    		}
-    	}
     }
     
     public boolean isListType() {

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ParameterDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ParameterDescriptionImpl.java?view=diff&rev=557076&r1=557075&r2=557076
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ParameterDescriptionImpl.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ParameterDescriptionImpl.java Tue Jul 17 15:26:20 2007
@@ -28,6 +28,7 @@
 import org.apache.axis2.jaxws.description.ParameterDescriptionJava;
 import org.apache.axis2.jaxws.description.ParameterDescriptionWSDL;
 import org.apache.axis2.jaxws.description.builder.ParameterDescriptionComposite;
+import org.apache.axis2.jaxws.description.builder.converter.ConverterUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -90,7 +91,7 @@
                     getGenericParameterActualType((ParameterizedType)parameterGenericType);
         }
         findWebParamAnnotation(parameterAnnotations);
-        findXmlListAnnotation(parameterAnnotations);
+        this.isListType = ConverterUtils.hasXmlListAnnotation(parameterAnnotations);
     }
 
     ParameterDescriptionImpl(int parameterNumber, ParameterDescriptionComposite pdc,
@@ -120,18 +121,6 @@
             //         javadoc: "Note that an interface that manually extends this one does not define an annotation type."
             if (checkAnnotation.annotationType() == WebParam.class) {
                 webParamAnnotation = (WebParam)checkAnnotation;
-            }
-        }
-    }
-
-    /**
-     * This method will search array of parameter annotations for the presence of the @XmlList
-     * annotation.
-     */
-    private void findXmlListAnnotation(Annotation[] annotations) {
-    	for (Annotation checkAnnotation:annotations) {
-            if (checkAnnotation.annotationType() == XmlList.class) {
-                isListType = true;
             }
         }
     }



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