owenb       2003/02/12 08:20:39

  Modified:    java/src/org/apache/wsif/base Tag: pre1_2_0-patches
                        WSIFDefaultMessage.java
  Log:
  Bugzilla fix 17005. See http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17005
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.8.2.2   +23 -8     
xml-axis-wsif/java/src/org/apache/wsif/base/WSIFDefaultMessage.java
  
  Index: WSIFDefaultMessage.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis-wsif/java/src/org/apache/wsif/base/WSIFDefaultMessage.java,v
  retrieving revision 1.8.2.1
  retrieving revision 1.8.2.2
  diff -u -r1.8.2.1 -r1.8.2.2
  --- WSIFDefaultMessage.java   8 Nov 2002 17:09:43 -0000       1.8.2.1
  +++ WSIFDefaultMessage.java   12 Feb 2003 16:20:39 -0000      1.8.2.2
  @@ -275,18 +275,33 @@
               Trc.exit(c);
               return c;
           } catch (NullPointerException ne) {
  -             Trc.exception(ne);
  +            Trc.exception(ne);
               handlePartNotFoundException(name);
               Trc.exit(0);
               return 0;
           } catch (ClassCastException ce) {
  -             Trc.exception(ce);
  -            handlePartCastException(
  -                name,
  -                parts.get(name).getClass().getName(),
  -                "Character");
  -            Trc.exit(0);
  -            return 0;
  +             // If the part is a String of length 1 convert it to 
  +             // a char and return the char.
  +            try {
  +                String s = (String) parts.get(name);
  +                if (s != null && s.length() == 1) {
  +                    char c = s.charAt(0);
  +                    Trc.exit(c);
  +                    return c;
  +                } else {
  +                     // throw the original exception
  +                     throw ce;
  +                }
  +            } catch (ClassCastException ce2) {
  +             // trace the original exception
  +                Trc.exception(ce);
  +                handlePartCastException(
  +                    name,
  +                    parts.get(name).getClass().getName(),
  +                    "Character");
  +                Trc.exit(0);
  +                return 0;
  +            }            
           }
       }
   
  
  
  


Reply via email to