if (null == reply) throw new DBusExecutionException("No reply within specified time");
   public static Object executeRemoteMethod(RemoteObject ro, Method m, DBusConnection conn, Class<? extends DBusInterface> iface, Object... args) throws DBusExecutionException   {      Type[] ts = m.getGenericParameterTypes();      try {         args = DBusConnection.convertParameters(args, ts);      } catch (Exception e) {         e.printStackTrace();         throw new DBusExecutionException(e.getMessage());      }      MethodCall call = new MethodCall(ro.service, ro.objectpath, ro.iface, m.getName(), args);      synchronized (conn.outgoing) {         conn.outgoing.add(call);      }      Class c = m.getReturnType();      // get reply      if (c.equals(DBusNoReply.class)) return null;      DBusMessage reply = call.getReply();                     Object[] rp = reply.getParameters();      if (reply instanceof DBusErrorMessage) {         if (null == rp || 0 == rp.length || null == rp[0])            throw new DBusExecutionException("Got Error Message in Reply");         else            throw new DBusExecutionException(""+rp[0]);      }      if (null == rp) {          if(null == c || Void.TYPE.equals(c)) return null;         else throw new DBusExecutionException("Wrong return type (expected void)");      }      switch (rp.length) {         case 0:            if (null == c || Void.TYPE.equals(c))               return null;            else throw new DBusExecutionException("Wrong return type (expected void)");         case 1:            try {                rp = DBusConnection.deSerialiseParameters(rp,                      new Type[] { m.getGenericReturnType() });            }            catch (Exception e) {                throw new DBusExecutionException("Wrong return type (failed to de-serialise correct types: "+e.getMessage()+")");            }            return rp[0];         default:            // check we are meant to return multiple values            if (!Tuple.class.isAssignableFrom(c))               throw new DBusExecutionException("Wrong return type (not expecting Tuple)");                        ParameterizedType p = (ParameterizedType) m.getGenericReturnType();                        // check we have the correct number of args            ts = p.getActualTypeArguments();            if (ts.length != rp.length)                throw new DBusExecutionException("Incorrect number of return values. Expected "+ts.length+" got "+rp.length);            Constructor con;            try {                // convert everything to the correct types               rp = DBusConnection.deSerialiseParameters(rp, ts);               con = ((Class) p.getRawType()).getDeclaredConstructors()[0];             }            catch (Exception e) {                throw new DBusExecutionException("Wrong return type (Tuple type invalid: "+e.getMessage()+")");            }            // create tuple and return stuff            try { return con.newInstance(rp); }            catch (Exception e) {               throw new DBusExecutionException("Wrong return type (failed to create Tuple, contents probably invalid)");            }      }   }