axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/utils JavaUtils.java
Date Fri, 28 Feb 2003 01:36:24 GMT
jmsnell     2003/02/27 17:36:24

  Modified:    java/src/org/apache/axis/utils JavaUtils.java
  Log:
  Fix http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16844
  
  Added HashMap ==> Map conversion
  
  Revision  Changes    Path
  1.92      +19 -0     xml-axis/java/src/org/apache/axis/utils/JavaUtils.java
  
  Index: JavaUtils.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/JavaUtils.java,v
  retrieving revision 1.91
  retrieving revision 1.92
  diff -u -r1.91 -r1.92
  --- JavaUtils.java	28 Feb 2003 01:01:56 -0000	1.91
  +++ JavaUtils.java	28 Feb 2003 01:36:24 -0000	1.92
  @@ -223,6 +223,25 @@
               log.debug( Messages.getMessage("convert00", clsName, destClass.getName()));
           }
   
  +        
  +        if (arg instanceof java.util.HashMap &&
  +            java.util.Map.class.isAssignableFrom(destClass)) {
  +              if (java.util.HashMap.class.isAssignableFrom(destClass)) return arg;
  +              try {
  +                java.util.Map newMap = (java.util.Map)destClass.newInstance();
  +                for (java.util.Iterator i = ((java.util.Map)arg).keySet().iterator();
  +                     i.hasNext();) {
  +                    Object key = i.next();
  +                    Object value = ((java.util.Map)arg).get(key);
  +                    newMap.put(key,value);
  +                }
  +                return newMap;
  +              } catch (Exception e) {
  +                return arg;
  +              }
  +        }
  +
  +
           // See if a previously converted value is stored in the argument.
           Object destValue = null;
           if (arg instanceof ConvertCache) {
  
  
  

Mime
View raw message