[404568] Annotation validator in jaxws.core should not be flagging
errors on the generated async methods in the SEI generated by
wsimport/wsdl2java
diff --git a/bundles/org.eclipse.jst.ws.jaxws.core/src/org/eclipse/jst/ws/internal/jaxws/core/annotations/validation/UniqueNamesRule.java b/bundles/org.eclipse.jst.ws.jaxws.core/src/org/eclipse/jst/ws/internal/jaxws/core/annotations/validation/UniqueNamesRule.java
index aab3e67..300073e 100644
--- a/bundles/org.eclipse.jst.ws.jaxws.core/src/org/eclipse/jst/ws/internal/jaxws/core/annotations/validation/UniqueNamesRule.java
+++ b/bundles/org.eclipse.jst.ws.jaxws.core/src/org/eclipse/jst/ws/internal/jaxws/core/annotations/validation/UniqueNamesRule.java
@@ -28,6 +28,7 @@
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -47,6 +48,7 @@
 import javax.xml.ws.WebFault;
 
 import org.apache.xerces.util.XMLChar;
+import org.eclipse.jdt.core.Signature;
 import org.eclipse.jst.ws.annotations.core.processor.AbstractAnnotationProcessor;
 import org.eclipse.jst.ws.annotations.core.utils.AnnotationUtils;
 import org.eclipse.jst.ws.internal.jaxws.core.JAXWSCoreMessages;
@@ -58,6 +60,7 @@
 import com.sun.mirror.declaration.AnnotationValue;
 import com.sun.mirror.declaration.ClassDeclaration;
 import com.sun.mirror.declaration.Declaration;
+import com.sun.mirror.declaration.InterfaceDeclaration;
 import com.sun.mirror.declaration.MethodDeclaration;
 import com.sun.mirror.declaration.ParameterDeclaration;
 import com.sun.mirror.declaration.TypeDeclaration;
@@ -125,11 +128,24 @@
         }
     }
 
+    private boolean isAsyncMethod(MethodDeclaration methodDeclaration) {
+    	if (methodDeclaration.getReturnType() instanceof InterfaceDeclaration) {
+    		InterfaceDeclaration id = (InterfaceDeclaration) methodDeclaration.getReturnType();
+    		String qn = Signature.getTypeErasure(id.getQualifiedName());
+    		if (qn.equals("javax.xml.ws.Response") || qn.equals("java.util.concurrent.Future")) { //$NON-NLS-1$ //$NON-NLS-2$
+    			return true;
+    		}
+    	}
+    	return false;
+    }
+    
     private void checkOperationNames(Collection<? extends MethodDeclaration> methods) {
         Map<Declaration, QName> nameMap = new HashMap<Declaration, QName>();
         for (MethodDeclaration methodDeclaration : methods) {
-            nameMap.put(methodDeclaration, new QName(getTargetNamespace(methodDeclaration.getDeclaringType()),
-                    getOperationName(methodDeclaration)));
+        	if (!isAsyncMethod(methodDeclaration)) {
+                nameMap.put(methodDeclaration, new QName(getTargetNamespace(methodDeclaration.getDeclaringType()),
+                        getOperationName(methodDeclaration)));
+        	}
         }
 
         Declaration[] keys = nameMap.keySet().toArray(new Declaration[nameMap.size()]);
@@ -168,6 +184,14 @@
         methods.addAll(environment.getDeclarationsAnnotatedWith(requestWrapperDeclaration));
         methods.addAll(environment.getDeclarationsAnnotatedWith(resposeWrapperDeclaration));
 
+        Iterator<Declaration> methodsIter = methods.iterator();
+        while(methodsIter.hasNext()) {
+        	Declaration dec = methodsIter.next();
+        	if (dec instanceof MethodDeclaration && isAsyncMethod((MethodDeclaration) dec)) {        
+        		methodsIter.remove();
+        	}
+        }
+
         List<AnnotationValue> classNames = new ArrayList<AnnotationValue>();
         Map<Object, QName> qNames = new HashMap<Object, QName>();
 
diff --git a/bundles/org.eclipse.jst.ws.jaxws.core/src/org/eclipse/jst/ws/internal/jaxws/core/annotations/validation/WebServiceParametersReturnTypesRule.java b/bundles/org.eclipse.jst.ws.jaxws.core/src/org/eclipse/jst/ws/internal/jaxws/core/annotations/validation/WebServiceParametersReturnTypesRule.java
index 72bea3b..7bccfba 100644
--- a/bundles/org.eclipse.jst.ws.jaxws.core/src/org/eclipse/jst/ws/internal/jaxws/core/annotations/validation/WebServiceParametersReturnTypesRule.java
+++ b/bundles/org.eclipse.jst.ws.jaxws.core/src/org/eclipse/jst/ws/internal/jaxws/core/annotations/validation/WebServiceParametersReturnTypesRule.java
@@ -25,6 +25,7 @@
 import org.eclipse.jdt.core.IType;
 import org.eclipse.jdt.core.ITypeHierarchy;
 import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.Signature;
 import org.eclipse.jst.ws.annotations.core.processor.AbstractAnnotationProcessor;
 import org.eclipse.jst.ws.annotations.core.utils.AnnotationUtils;
 import org.eclipse.jst.ws.internal.jaxws.core.JAXWSCoreMessages;
@@ -217,7 +218,16 @@
 
     private boolean isSuitableInterface(InterfaceDeclaration interfaceDeclaration) {
         return isJavaType(interfaceDeclaration.getQualifiedName()) && JAVA_TYPES.contains(interfaceDeclaration.getQualifiedName())
-        || isXMLType(interfaceDeclaration);
+        || isXMLType(interfaceDeclaration) || isAsyncType(interfaceDeclaration);
+    }
+    
+    private boolean isAsyncType(InterfaceDeclaration interfaceDeclaration) {
+    	String qn = Signature.getTypeErasure(interfaceDeclaration.getQualifiedName());
+		if (qn.equals("javax.xml.ws.Response") || qn.equals("java.util.concurrent.Future") //$NON-NLS-1$ //$NON-NLS-2$
+			|| qn.equals("javax.xml.ws.AsyncHandler")) { //$NON-NLS-1$
+			return true;
+		}
+        return false;
     }
 
     private boolean isXMLType(InterfaceDeclaration interfaceDeclaration) {