-
-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Receving signals doesn't work after upgrading to 5.1.0 #268
Comments
No bug I am aware of. The code responsible for finding the constructor is part of Do you have a test or sample setup I can use to reproduce this problem? |
I've created a small sample application here: https://github.com/AsamK/dbus-java-test-case By default it uses dbus-java 5.0.0 and successfully prints |
Thanks a lot. I'll already started digging into this. It pretty much looks like that the changes required to fix the Right now, the method which converts the DBus signature to constructor argument types generates the wrong type. With the changes for Variant Converting primitives to wrapper types is required for The problem I have to solve now is to find a way to detect which kind of type should be used. I'll investigate this further and will report back when I have a solution. |
…imitive array or Collections in constructor
I just pushed changes which should fix this issue, patched snapshot version should be available soon. The changes for this issue are a bit larger than expected. But I think the handling of signal constructors in combination with array, array of primitives or Collection types should now be working in all flavors. It was required to investigate the constructor arguments in more detail, so that the library is able to convert a signature like When there are multiple constructors matching the this signature (e.g. you have |
Thanks, I just tried it and it still doesn't work. |
- Improved detection of constructors when compatible types are used instead of equal types (e.g. CharSequence and String) - Improved handling of primitive and wrapper array type (int[] / Integer[])
Sorry... I was so focused on getting every corner case right that I missed the main goal. |
Thanks, that works now as expected. I found another difference between 5.0.0 and 5.1.0 with generic methods that return a
I've updated the sample repo with new methods. Methods that have a return type of |
I'm afraid, but this is the expected behavior since 5.1.0 when using |
Ok, then I'll adapt my code. |
After upgrading to dbus-java 5.1.0 (from 5.0.0) receiving signals doesn't work anymore. I didn't see anything related in the changelog.
Could not find suitable constructor for class org.asamk.Signal$MessageReceivedV2 with argument-types: [class java.lang.Long, class java.lang.String, class java.util.ArrayList, class java.lang.String, class java.util.LinkedHashMap]
The constructor is defined here (which worked until 5.0.0): https://github.com/AsamK/signal-cli/blob/master/src/main/java/org/asamk/Signal.java#L201
public MessageReceivedV2( String objectpath, long timestamp, String sender, byte[] groupId, String message, final Map<String, Variant<?>> extras ) throws DBusException
I tried removing the first
objectpath
path parameter and changing thebyte[]
to aList<Byte>
, but that didn't work either.Do I need to adapt anything in my code, or is this a bug?
The text was updated successfully, but these errors were encountered: