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 ow...@apache.org on 2002/10/09 18:07:17 UTC

cvs commit: xml-axis-wsif/java/src/org/apache/wsif/providers/java WSIFPort_Java.java WSIFOperation_Java.java

owenb       2002/10/09 09:07:17

  Modified:    java/src/org/apache/wsif/providers/ejb
                        WSIFOperation_EJB.java
               java/src/org/apache/wsif/providers/java WSIFPort_Java.java
                        WSIFOperation_Java.java
  Log:
  Added the following fixes:
  - Fixed parsing of the format binding to correctly deal with more than 2 mappings for the same type
  - Fixed resolution of target methods(construtors) to allow for the use of subclasses/implementations
    of those classes/interfaces specified on the signature of the method.
  
  Revision  Changes    Path
  1.18      +18 -9     xml-axis-wsif/java/src/org/apache/wsif/providers/ejb/WSIFOperation_EJB.java
  
  Index: WSIFOperation_EJB.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/providers/ejb/WSIFOperation_EJB.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- WSIFOperation_EJB.java	18 Sep 2002 15:38:20 -0000	1.17
  +++ WSIFOperation_EJB.java	9 Oct 2002 16:07:16 -0000	1.18
  @@ -354,15 +354,17 @@
                           if (cl.getName().equals(retType.getName())) {
                               found = true;
                               break;
  +                        } else if (cl.isAssignableFrom(retType)) {
  +                            found = true;
  +                            break;
                           }
                       }
                       if (!found)
                           continue;
                   } else {
                       if (retType != null && retClass != null) {
  -                        if (!((Class) retClass)
  -                            .getName()
  -                            .equals(retType.getName()))
  +                        if (!(((Class) retClass).getName().equals(retType.getName()))
  +                            	&& !(((Class) retClass).isAssignableFrom(retType)))
                               continue;
                       }
                   }
  @@ -378,6 +380,9 @@
                               if (cl.getName().equals(params[j].getName())) {
                                   found = true;
                                   break;
  +                            } else if (params[j].isAssignableFrom(cl)) {
  +                                found = true;
  +                                break;
                               }
                           }
                           if (!found) {
  @@ -385,9 +390,8 @@
                               break;
                           }
                       } else {
  -                        if (!((Class) obj)
  -                            .getName()
  -                            .equals(params[j].getName())) {
  +                        if (!(((Class) obj).getName().equals(params[j].getName()))
  +                            	&& !(params[j].isAssignableFrom((Class) obj))) {
                               match = false;
                               break;
                           }
  @@ -472,11 +476,16 @@
               String type = typeMap.getFormatType();
               if (typeName != null && type != null) {
                   if (fieldTypeMaps.containsKey(typeName)) {
  -                    Vector v = new Vector();
  -                    v.addElement(fieldTypeMaps.get(typeName));
  +                    Vector v = null;
  +                	Object obj = fieldTypeMaps.get(typeName);                	
  +                	if (obj instanceof Vector) {
  +                		v = (Vector) obj;
  +                	} else {
  +                		v = new Vector();
  +	                    v.addElement(obj);
  +                	}                	                    
                       v.addElement(type);
                       this.fieldTypeMaps.put(typeName, v);
  -
                   } else {
                       this.fieldTypeMaps.put(typeName, type);
                   }
  
  
  
  1.8       +8 -3      xml-axis-wsif/java/src/org/apache/wsif/providers/java/WSIFPort_Java.java
  
  Index: WSIFPort_Java.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/providers/java/WSIFPort_Java.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- WSIFPort_Java.java	23 Aug 2002 14:12:59 -0000	1.7
  +++ WSIFPort_Java.java	9 Oct 2002 16:07:16 -0000	1.8
  @@ -279,11 +279,16 @@
               String type = typeMap.getFormatType();
               if (typeName != null && type != null) {
                   if (fieldTypeMaps.containsKey(typeName)) {
  -                    Vector v = new Vector();
  -                    v.addElement(fieldTypeMaps.get(typeName));
  +                	Vector v = null;
  +                	Object obj = fieldTypeMaps.get(typeName);                	
  +                	if (obj instanceof Vector) {
  +                		v = (Vector) obj;
  +                	} else {
  +                		v = new Vector();
  +	                    v.addElement(obj);
  +                	}                	                    
                       v.addElement(type);
                       this.fieldTypeMaps.put(typeName, v);
  -
                   } else {
                       this.fieldTypeMaps.put(typeName, type);
                   }
  
  
  
  1.20      +15 -3     xml-axis-wsif/java/src/org/apache/wsif/providers/java/WSIFOperation_Java.java
  
  Index: WSIFOperation_Java.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/providers/java/WSIFOperation_Java.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- WSIFOperation_Java.java	18 Sep 2002 15:38:20 -0000	1.19
  +++ WSIFOperation_Java.java	9 Oct 2002 16:07:16 -0000	1.20
  @@ -315,6 +315,9 @@
                           if (cl.getName().equals(params[j].getName())) {
                               found = true;
                               break;
  +                        } else if (params[j].isAssignableFrom(cl)) {
  +                            found = true;
  +                            break;
                           }
                       }
                       if (!found) {
  @@ -322,7 +325,8 @@
                           break;
                       }
                   } else {
  -                    if (!((Class) obj).getName().equals(params[j].getName())) {
  +                    if (!(((Class) obj).getName().equals(params[j].getName()))
  +                        && !(params[j].isAssignableFrom((Class) obj))) {
                           match = false;
                           break;
                       }
  @@ -425,13 +429,17 @@
                               if (cl.getName().equals(retType.getName())) {
                                   found = true;
                                   break;
  +                            } else if (cl.isAssignableFrom(retType)) {
  +                              	found = true;
  +                               	break;
                               }
                           }
                           if (!found)
                               continue;
                       } else {
                           if (retType != null && retClass != null) {
  -                            if (!((Class) retClass).getName().equals(retType.getName()))
  +                            if (!(((Class) retClass).getName().equals(retType.getName()))
  +                            	&& !(((Class) retClass).isAssignableFrom(retType)))
                                   continue;
                           }
                       }
  @@ -447,6 +455,9 @@
                                   if (cl.getName().equals(params[j].getName())) {
                                       found = true;
                                       break;
  +                                } else if (params[j].isAssignableFrom(cl)) {
  +                                	found = true;
  +                                	break;
                                   }
                               }
                               if (!found) {
  @@ -454,7 +465,8 @@
                                   break;
                               }
                           } else {
  -                            if (!((Class) obj).getName().equals(params[j].getName())) {
  +                            if (!(((Class) obj).getName().equals(params[j].getName()))
  +                            	&& !(params[j].isAssignableFrom((Class) obj))) {
                                   match = false;
                                   break;
                               }