summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS4
-rw-r--r--Makefile4
-rw-r--r--changelog10
-rw-r--r--org/freedesktop/dbus/DBusMap.java2
-rw-r--r--org/freedesktop/dbus/Marshalling.java13
-rw-r--r--org/freedesktop/dbus/Message.java11
-rw-r--r--org/freedesktop/dbus/test/test.java5
7 files changed, 39 insertions, 10 deletions
diff --git a/AUTHORS b/AUTHORS
index 70ec036..76e68f6 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -2,7 +2,7 @@ The D-Bus Java implementation was written by:
Matthew Johnson <dbus -at matthew -dot- ath -dot- cx>
-Bug fixes and other suggestions from:
+Bug fixes/reports and other suggestions from:
Remi Emonet <remi.emonet -at- inrialpes -dot- fr>
Simon McVittie <simon -dot- mcvittie -at- collabora -dot- co -dot- uk>
@@ -15,6 +15,8 @@ Roberto Francisco Arroyo Moreno <robfram -at- ugr -dot- es>
Steve Crane <Steve -dot Crane -at- rococosoft -dot- com>
Philippe Marschall <philippe -dot- marschall -at- gmail -dot- com>
Daniel Machado <cdanielmachado -at- gmail -dot- com>
+Anibal Sanchez <anibal -dot- sanchez -at- sunya -dot- com -dot- ar>
+Jan Kümmel <freedesktop -at- snorc -dot- org>
The included Viewer application was originally written by:
diff --git a/Makefile b/Makefile
index a1f0b59..42c9e5f 100644
--- a/Makefile
+++ b/Makefile
@@ -40,8 +40,8 @@ JAVAUNIXJARDIR?=/usr/share/java
DEBUG=disable
# Version numbering
-VERSION = 2.4
-RELEASEVERSION = 2.3
+VERSION = 2.3.1
+RELEASEVERSION = 2.3.1
DISTFILES=dbus-java.tex Makefile org tmp-session.conf CreateInterface.sgml DBusDaemon.sgml ListDBus.sgml DBusViewer.sgml changelog AUTHORS COPYING README INSTALL CreateInterface.sh DBusDaemon.sh ListDBus.sh DBusViewer.sh DBusDaemon.bat CreateInterface.bat ListDBus.bat DBusViewer.bat compile.bat DBusCall.bat DBusCall.sh DBusCall.sgml
diff --git a/changelog b/changelog
index 824ec7b..dfabe88 100644
--- a/changelog
+++ b/changelog
@@ -1,4 +1,12 @@
-Version 2.4:
+Version 2.3.2:
+
+ * Fix empty array/map bug (reported by Jan Kümmel
+ <freedesktop -at- snorc -dot- org>)
+
+Version 2.3.1:
+
+ * Fix regression in normal array handling (spotted by Anibal Sanchez
+ <anibal -dot- sanchez -at- sunya -dot- com -dot- ar>
Version 2.3:
diff --git a/org/freedesktop/dbus/DBusMap.java b/org/freedesktop/dbus/DBusMap.java
index 54f4b18..2bb5fbc 100644
--- a/org/freedesktop/dbus/DBusMap.java
+++ b/org/freedesktop/dbus/DBusMap.java
@@ -145,7 +145,7 @@ class DBusMap<K, V> implements Map<K, V>
{
String s = "{ ";
for (int i = 0; i < entries.length; i++)
- s += entries[i][0] + " => " + entries[i][0] + ",";
+ s += entries[i][0] + " => " + entries[i][1] + ",";
return s.replaceAll(".$", " }");
}
}
diff --git a/org/freedesktop/dbus/Marshalling.java b/org/freedesktop/dbus/Marshalling.java
index 3e79b59..e7e3a82 100644
--- a/org/freedesktop/dbus/Marshalling.java
+++ b/org/freedesktop/dbus/Marshalling.java
@@ -462,8 +462,17 @@ public class Marshalling
ts, conn);
}
if (parameter instanceof List) {
- Type type2 = ((ParameterizedType) type).getActualTypeArguments()[0];
- parameter = deSerializeParameters((List) parameter, type2, conn);
+ Type type2;
+ if (type instanceof ParameterizedType)
+ type2 = ((ParameterizedType) type).getActualTypeArguments()[0];
+ else if (type instanceof GenericArrayType)
+ type2 = ((GenericArrayType) type).getGenericComponentType();
+ else if (type instanceof Class && ((Class) type).isArray())
+ type2 = ((Class) type).getComponentType();
+ else
+ type2 = null;
+ if (null != type2)
+ parameter = deSerializeParameters((List) parameter, type2, conn);
}
// correct floats if appropriate
diff --git a/org/freedesktop/dbus/Message.java b/org/freedesktop/dbus/Message.java
index 00ca9ac..11f0416 100644
--- a/org/freedesktop/dbus/Message.java
+++ b/org/freedesktop/dbus/Message.java
@@ -891,7 +891,8 @@ public class Message
byte[] temp2 = new byte[sigb.length-ofs[0]];
System.arraycopy(sigb, ofs[0], temp2, 0, temp2.length);
String temp3 = new String(temp2);
- int temp4 = Marshalling.getJavaType(temp3, temp, 1);
+ // ofs[0] gets incremented anyway. Leave one character on the stack
+ int temp4 = Marshalling.getJavaType(temp3, temp, 1) - 1;
ofs[0] += temp4;
if (Debug.debug) Debug.print(Debug.VERBOSE, "Aligned type: "+temp3+" "+temp4+" "+ofs[0]);
}
@@ -911,7 +912,8 @@ public class Message
byte[] temp2 = new byte[sigb.length-ofs[0]];
System.arraycopy(sigb, ofs[0], temp2, 0, temp2.length);
String temp3 = new String(temp2);
- int temp4 = Marshalling.getJavaType(temp3, temp, 1);
+ // ofs[0] gets incremented anyway. Leave one character on the stack
+ int temp4 = Marshalling.getJavaType(temp3, temp, 1) - 1;
ofs[0] += temp4;
if (Debug.debug) Debug.print(Debug.VERBOSE, "Aligned type: "+temp3+" "+temp4+" "+ofs[0]);
}
@@ -976,7 +978,10 @@ public class Message
default:
throw new UnknownTypeCodeException(sigb[ofs[0]]);
}
- if (Debug.debug) Debug.print(Debug.VERBOSE, "Extracted: "+rv+" (now at "+ofs[1]+")");
+ if (Debug.debug) if (rv instanceof Object[])
+ Debug.print(Debug.VERBOSE, "Extracted: "+Arrays.deepToString((Object[]) rv)+" (now at "+ofs[1]+")");
+ else
+ Debug.print(Debug.VERBOSE, "Extracted: "+rv+" (now at "+ofs[1]+")");
return rv;
}
/**
diff --git a/org/freedesktop/dbus/test/test.java b/org/freedesktop/dbus/test/test.java
index 75259d2..c076ef0 100644
--- a/org/freedesktop/dbus/test/test.java
+++ b/org/freedesktop/dbus/test/test.java
@@ -438,6 +438,11 @@ public class test
System.out.println("Sending Signal");
/** This creates an instance of the Test Signal, with the given object path, signal name and parameters, and broadcasts in on the Bus. */
serverconn.sendSignal(new TestSignalInterface.TestSignal("/foo/bar/Wibble", "Bar", new UInt32(42)));
+
+ System.out.println("These things are on the bus:");
+ String[] names = dbus.ListNames();
+ for (String name: names)
+ System.out.println("\t"+name);
System.out.println("Getting our introspection data");
/** This gets a remote object matching our bus name and exported object path. */