--- a/org/freedesktop/dbus/DBusConnection.java +++ b/org/freedesktop/dbus/DBusConnection.java @@ -763,6 +766,26 @@ public class DBusConnection throw new DBusException("Failure in serializing parameters: "+e.getMessage()); } } + else if (Tuple.class.isAssignableFrom(r)) { + Constructor con = r.getDeclaredConstructors()[0]; + Field[] fs = r.getDeclaredFields(); + Type[] ts = new Type[fs.length]; + ts = p.getActualTypeArguments(); + for (Field f : fs) { + Position pos = f.getAnnotation(Position.class); + if (null == pos) continue; + // ts[pos.value()] = f.getGenericType(); + } + Object[] oldparams = ((Tuple) parameter).getParameters(); + Object[] newparams = convertParameters(oldparams, ts); + try { + parameter = con.newInstance(newparams); + } catch (Exception e) { + e.printStackTrace (System.err); + if (DBusConnection.EXCEPTION_DEBUG) e.printStackTrace(); + throw new DBusException("Failure in serializing parameters: "+e.getMessage()); + } + } } else if (type instanceof GenericArrayType) {