All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.patches.13-LPS-105899.patch Maven / Gradle / Ivy

diff --git a/org/apache/axis/description/JavaServiceDesc.java b/org/apache/axis/description/JavaServiceDesc.java
index dfb5f2f56d345..12e9b3985d90a 100644
--- a/org/apache/axis/description/JavaServiceDesc.java
+++ b/org/apache/axis/description/JavaServiceDesc.java
@@ -47,6 +47,8 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.StringTokenizer;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 
 /**
@@ -59,6 +61,9 @@ import java.util.StringTokenizer;
  * @author Glen Daniels ([email protected])
  */
 public class JavaServiceDesc implements ServiceDesc {
+    private static final Pattern _xsdAnyTypePattern = Pattern.compile(
+        Pattern.quote(Constants.XSD_ANYTYPE.toString()));
+
     protected static Log log =
             LogFactory.getLog(JavaServiceDesc.class.getName());
 
@@ -1096,6 +1101,28 @@ public class JavaServiceDesc implements ServiceDesc {
             ArrayList currentOverloads =
                     (ArrayList)name2OperationsMap.get(methodName);
             if (currentOverloads != null) {
+                Collections.sort(currentOverloads, new Comparator() {
+                    public int compare(Object o1, Object o2) {
+                        int o1AnyTypeParamCount = 0;
+                        int o2AnyTypeParamCount = 0;
+
+                        Matcher matcher = _xsdAnyTypePattern.matcher(
+                            o1.toString());
+
+                        while (matcher.find()) {
+                            o1AnyTypeParamCount++;
+                        }
+
+                        matcher = _xsdAnyTypePattern.matcher(o2.toString());
+
+                        while (matcher.find()) {
+                            o2AnyTypeParamCount++;
+                        }
+
+                        return o1AnyTypeParamCount - o2AnyTypeParamCount;
+                    }
+                });
+
                 // For each one, sync it to the implementation class' methods
                 for (Iterator i = currentOverloads.iterator(); i.hasNext();) {
                     OperationDesc oper = (OperationDesc) i.next();




© 2015 - 2025 Weber Informatics LLC | Privacy Policy