ws-wsif-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ow...@apache.org
Subject cvs commit: xml-axis-wsif/java/src/org/apache/wsif/base WSIFDefaultMessage.java
Date Wed, 12 Feb 2003 16:20:07 GMT
owenb       2003/02/12 08:20:07

  Modified:    java/src/org/apache/wsif/base WSIFDefaultMessage.java
  Log:
  Bugzilla fix 17005. See http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17005
  
  Revision  Changes    Path
  1.11      +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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- WSIFDefaultMessage.java	7 Dec 2002 12:34:01 -0000	1.10
  +++ WSIFDefaultMessage.java	12 Feb 2003 16:20:07 -0000	1.11
  @@ -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;
  +            }            
           }
       }
   
  
  
  

Mime
View raw message