int i = 0; for (Map.Entry e: m.entrySet()) { values[i] = DBusConnection.convertParameter( e.getValue(), ts[1]); keys[i] = e.getKey(); i++; } } catch (Exception e) { if (DBusConnection.EXCEPTION_DEBUG) e.printStackTrace(); throw new DBusException(e.getMessage());
Vector<Type> vt = new Vector<Type>(); DBusConnection.getJavaType(sig.substring(1), vt, 2); if (vt.get(0) instanceof ParameterizedType) cs[0] = (Class) ((ParameterizedType) vt.get(0)).getRawType(); else cs[0] = (Class) vt.get(0); this.keys = (Object[]) Array.newInstance(cs[0], content.length); if (vt.get(1) instanceof ParameterizedType) cs[1] = (Class) ((ParameterizedType) vt.get(1)).getRawType(); else cs[1] = (Class) vt.get(1); if (Map.class.isAssignableFrom(cs[1])) cs[1] = MapContainer.class; if (List.class.isAssignableFrom(cs[1])) cs[1] = ListContainer.class; this.values = (Object[]) Array.newInstance(cs[1], content.length); } catch (Exception CNFe) { if (DBusConnection.EXCEPTION_DEBUG) CNFe.printStackTrace(); throw new DBusException("Map contains invalid type: "+CNFe.getMessage());
   public MapContainer(Map<Object,Object> m, ParameterizedType t) throws DBusException   {      Type[] ts = t.getActualTypeArguments();      Class c;      sig = "{";      c = (Class) ts[0];      //keys = m.keySet().toArray((Object[]) Array.newInstance(c, 0));      keys = (Object[]) Array.newInstance(c, m.size());      String[] s = DBusConnection.getDBusType(ts[0]);      if (1 != s.length) throw new DBusException("List Contents not single type");      sig += s[0];      if (ts[1] instanceof Class)         c = (Class) ts[1];      else if (ts[1] instanceof ParameterizedType)         c = (Class) ((ParameterizedType) ts[1]).getRawType();      if (Map.class.isAssignableFrom(c))         c = MapContainer.class;      if (List.class.isAssignableFrom(c))          c = ListContainer.class;      values = (Object[]) Array.newInstance(c, m.size());      try {         int i = 0;         for (Map.Entry e: m.entrySet()) {            values[i] = DBusConnection.convertParameter( e.getValue(), ts[1]);            keys[i] = e.getKey();            i++;         }      } catch (Exception e) {         if (DBusConnection.EXCEPTION_DEBUG) e.printStackTrace();         throw new DBusException(e.getMessage());      }      s = DBusConnection.getDBusType(ts[1]);      if (1 != s.length) throw new DBusException("List Contents not single type");      sig += s[0];      sig += '}';      this.map = m;   }