Skip to content
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

Regression in 3.2.2, #114

Closed
weliem opened this issue Aug 8, 2020 · 2 comments
Closed

Regression in 3.2.2, #114

weliem opened this issue Aug 8, 2020 · 2 comments

Comments

@weliem
Copy link

weliem commented Aug 8, 2020

My library (https://github.com/weliem/blessed-bluez) uses your library and I just tried updating from 3.2.1 to 3.2.2.

After updating, I noticed this regression. When starting a Bluetooth discovery, I handle the signals that are sent by the adapter. However, in 3.2.2 no signals arrive and I see these warnings in the log:

[DBus Worker Thread-1] WARN org.freedesktop.dbus.messages.DBusSignal - Could not find suitable constructor for class org.freedesktop.dbus.interfaces.Properties$PropertiesChanged with argument-types: [class java.lang.String, class org.freedesktop.dbus.DBusMap, class java.util.ArrayList]
[DBus Worker Thread-2] WARN org.freedesktop.dbus.messages.DBusSignal - Could not find suitable constructor for class org.freedesktop.dbus.interfaces.Properties$PropertiesChanged with argument-types: [class java.lang.String, class org.freedesktop.dbus.DBusMap, class java.util.ArrayList]
[DBus Worker Thread-3] WARN org.freedesktop.dbus.messages.DBusSignal - Could not find suitable constructor for class org.freedesktop.dbus.interfaces.Properties$PropertiesChanged with argument-types: [class java.lang.String, class org.freedesktop.dbus.DBusMap, class java.util.ArrayList]
[DBus Worker Thread-4] WARN org.freedesktop.dbus.messages.DBusSignal - Could not find suitable constructor for class org.freedesktop.dbus.interfaces.Properties$PropertiesChanged with argument-types: [class java.lang.String, class org.freedesktop.dbus.DBusMap, class java.util.ArrayList]

Looks like a contructor was removed in 3.2.2. When I switch back to 3.2.1, everything works fine again.

Any thoughts?

hypfvieh added a commit that referenced this issue Aug 8, 2020
The changes introduced in #110 did not cover the use case of interfaces classes
used as constructor arguments. When e.g. using Map or List interface in constructor the
current expectedArgumentsList.equals(receivedArgumentsList) will fail, because the received arguments
are not the interface type, but a compatible class.
This requires some more attention, which means every expectedArgument has be be changed for
compatibility to the received argument type.

This behavior has been added in this commit.
Every received argument is now checked with 'isAssignable' to the expected arguments.
This will allow inheritance for objects as well as allowing the usage of interface classes in constructor
definitions.
@hypfvieh
Copy link
Owner

hypfvieh commented Aug 8, 2020

This is a regression introduced by changing signal processing to support multiple signals with the same name but different arguments (#110).

I pushed a fix for it, please test again with the snapshot. I will create a new release if this is working for you.

Another side note:
I don't think it is a good idea to copy classes from bluez-dbus to your project.

Any updates and changes/fixes added upstream will then be missing in your copy.
Also you will then mess up with the package name, which may cause trouble if someone uses bluez-dbus and your library in the same project. This may also fail if java's new modularization feature may be used in bluez-dbus in the future.

I would appreciate if you would contribute your changes to bluez-dbus as pull requests and use bluez-dbus as dependency in your project. This way anyone can profit from fixes/additions in bluez-dbus.

@weliem
Copy link
Author

weliem commented Aug 8, 2020

Hi, thanks for the fix! I tried the snapshot and it is working now! Would be great if you can do a release...

As for bluez-dbus, I will contribute back with PRs once I get into stable waters. I just started my library and it is still very early. I am making tons of changes all the time. For now it was easier to copy the files and make changes as I go...

But I am very thankful for your work! Good job!

@weliem weliem closed this as completed Aug 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants