axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From whitl...@apache.org
Subject cvs commit: xml-axis-wsif/java/src/org/apache/wsif/providers/java WSIFOperation_Java.java
Date Tue, 20 Aug 2002 11:52:07 GMT
whitlock    2002/08/20 04:52:07

  Modified:    java/src/org/apache/wsif/providers/ejb
                        WSIFOperation_EJB.java
               java/src/org/apache/wsif/providers/java
                        WSIFOperation_Java.java
  Log:
  Improve exceptions
  
  Revision  Changes    Path
  1.12      +20 -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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- WSIFOperation_EJB.java	19 Aug 2002 09:19:32 -0000	1.11
  +++ WSIFOperation_EJB.java	20 Aug 2002 11:52:07 -0000	1.12
  @@ -522,8 +522,17 @@
   
                   // If there is no returnPart specified then not interested in return value
                   if (returnPart != null) {
  -                    Object obj =
  -                        this.fieldTypeMaps.get(returnPart.getTypeName());
  +                    QName partType = returnPart.getTypeName();
  +                    
  +                    Object obj = this.fieldTypeMaps.get(partType);
  +                    if (obj == null)
  +                        throw new WSIFException(
  +                            "Could not map type "
  +                                + partType
  +                                + " to a java type. Part name was "
  +                                + returnPart.getName() == null 
  +                                    ? "<null>" : returnPart.getName());
  +                                
                       if (obj instanceof Vector) {
                           Vector v = (Vector) obj;
                           Vector argv = new Vector();
  @@ -534,10 +543,7 @@
                           }
                           methodReturnClass = argv;
                       } else {
  -                        methodReturnClass =
  -                            getClassForName(
  -                                (String) fieldTypeMaps.get(
  -                                    returnPart.getTypeName()));
  +                        methodReturnClass = getClassForName((String) obj);
                       }
                   } else {
                       // If we get here then the return part specified on the java operation
was not
  @@ -647,6 +653,13 @@
                   // should also check for the element
                   QName partType = part.getTypeName();
                   Object obj = this.fieldTypeMaps.get(partType);
  +                if (obj == null)
  +                    throw new WSIFException(
  +                        "Could not map type "
  +                            + partType
  +                            + " to a java type. Part name was "
  +                            + part.getName() == null ? "<null>" : part.getName());
  +                
                   if (obj instanceof Vector) {
                       Vector v = (Vector) obj;
                       Vector argv = new Vector();
  @@ -657,9 +670,7 @@
                       }
                       argTypes.add(argv);
                   } else {
  -                    argTypes.add(
  -                        getClassForName(
  -                            (String) this.fieldTypeMaps.get(partType)));
  +                    argTypes.add(getClassForName((String) obj));
                   }
   
               }
  
  
  
  1.17      +18 -2     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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- WSIFOperation_Java.java	19 Aug 2002 09:19:32 -0000	1.16
  +++ WSIFOperation_Java.java	20 Aug 2002 11:52:07 -0000	1.17
  @@ -525,7 +525,16 @@
   
                   // If there is no returnPart specified then not interested in return value
                   if (returnPart != null) {
  -                    Object obj = this.fieldTypeMaps.get(returnPart.getTypeName());
  +                    QName partType = returnPart.getTypeName();
  +                    Object obj = this.fieldTypeMaps.get(partType);
  +                    if (obj == null)
  +                        throw new WSIFException(
  +                            "Could not map type "
  +                                + partType
  +                                + " to a java type. Part name was "
  +                                + returnPart.getName() == null 
  +                                    ? "<null>" : returnPart.getName());
  +                                
                       if (obj instanceof Vector) {
                           Vector v = (Vector) obj;
                           Vector argv = new Vector();
  @@ -537,7 +546,7 @@
                           methodReturnClass = argv;
                       } else {
                           methodReturnClass =
  -                            getClassForName((String) fieldTypeMaps.get(returnPart.getTypeName()));
  +                            getClassForName((String) obj);
                       }
                   } else {
                       // If we get here then the return part specified on the java operation
was not
  @@ -640,6 +649,13 @@
                   // should also check for the element
                   QName partType = part.getTypeName();
                   Object obj = this.fieldTypeMaps.get(partType);
  +                if (obj == null)
  +                    throw new WSIFException(
  +                        "Could not map type "
  +                            + partType
  +                            + " to a java type. Part name was "
  +                            + part.getName() == null ? "<null>" : part.getName());
  +                
                   if (obj instanceof Vector) {
                       Vector v = (Vector) obj;
                       Vector argv = new Vector();
  
  
  

Mime
View raw message