You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I have noted several issues using a 5.0.1-SNAPSHOT (master, commit 5041727) to generate the org.freedesktop.NetworkManager interface with the dbus-java-utils module.
Here are the commands. I set the --propertyMethods argument to use the new annotation @DBusBoundProperty.
The generated class AddAndActivateConnection2Tuple uses Variant but does not import it.
The gererated interface NetworkManager has property methods annotated with @DBusBoundProperty.
However the ones using a TypeRef type are not generated properly. For instance, I get:
Attempting to use the first version result in a ClassCastException
> Task :MainNOK.main()
24/05/17 10:47:30 INFO transports.TransportBuilder: Using transport dbus-java-transport-native-unixsocket for address unix:path=/var/run/dbus/system_bus_socket
0 [main] INFO org.freedesktop.dbus.connections.transports.TransportBuilder - Using transport dbus-java-transport-native-unixsocket for address unix:path=/var/run/dbus/system_bus_socket
Exception in thread "main" java.lang.ClassCastException: class java.util.ArrayList cannot be cast to class org.freedesktop.NetworkManager$PropertyDevicesType (java.util.ArrayList is in module java.base of loader 'bootstrap'; org.freedesktop.NetworkManager$PropertyDevicesType is in unnamed module of loader 'app')
at jdk.proxy2/jdk.proxy2.$Proxy6.getDevices(Unknown Source)
at dev.tutetaki.MainNOK.main(MainNOK.java:25)
Similarly, generated interface Device has property methods annotated with @DBusBoundProperty.
But for the field using a Struct type, I get:
Attempting to use the first version result in a ClassCastException
24/05/17 11:39:40 INFO transports.TransportBuilder: Using transport dbus-java-transport-native-unixsocket for address unix:path=/var/run/dbus/system_bus_socket
0 [main] INFO org.freedesktop.dbus.connections.transports.TransportBuilder - Using transport dbus-java-transport-native-unixsocket for address unix:path=/var/run/dbus/system_bus_socket
Exception in thread "main" java.lang.ClassCastException: class [Ljava.lang.Object; cannot be cast to class org.freedesktop.networkmanager.PropertyStateReasonStruct ([Ljava.lang.Object; is in module java.base of loader 'bootstrap'; org.freedesktop.networkmanager.PropertyStateReasonStruct is in unnamed module of loader 'app')
at jdk.proxy2/jdk.proxy2.$Proxy8.getStateReason(Unknown Source)
at dev.tutetaki.MainOK.main(MainOK.java:42)
I fixed the mentioned issues in the latest commits. Anyway, the InterfaceCodeGenerator is far from being perfect. It's just a helper to get started somehow...
Hello, I have noted several issues using a 5.0.1-SNAPSHOT (master, commit 5041727) to generate the
org.freedesktop.NetworkManager
interface with the dbus-java-utils module.Here are the commands. I set the
--propertyMethods
argument to use the new annotation@DBusBoundProperty
.The generated class
AddAndActivateConnection2Tuple
usesVariant
but does not import it.The gererated interface
NetworkManager
has property methods annotated with@DBusBoundProperty
.However the ones using a
TypeRef
type are not generated properly. For instance, I get:Whereas the expected should be:
Attempting to use the first version result in a ClassCastException
Similarly, generated interface
Device
has property methods annotated with@DBusBoundProperty
.But for the field using a
Struct
type, I get:Whereas the expected should be (I'm not sure about this one. Is the intention to use
PropertyStateReasonStruct
?):Attempting to use the first version result in a ClassCastException
Here is a sample project to reproduce https://github.com/tutetaki/sample-dbus-object/tree/master
The text was updated successfully, but these errors were encountered: