Skip to content

Wrong signal constructor retrieved #110

@purejava

Description

@purejava

Hi,

thanks a lot for providing and maintaining dbus-java!

I implement a signal handler for the KWallet interface, that has two signals with the same name, but different contructors:

<signal name="walletClosed">
  <arg name="wallet" type="s" direction="out"/>
</signal>
<signal name="walletClosed">
  <arg name="handle" type="i" direction="out"/>
</signal>

Reference: https://github.com/KDE/kwallet/blob/master/src/api/KWallet/org.kde.KWallet.xml

Demo code available at https://github.com/purejava/dbusjavatest.git - branch wip-kwallet-api -> simply run App.java.
Please note, that you need a KDE desktop environment or at least kwallet installed.

As Java does not allow to have two classes / signals of the same name, I introduced a second interface AbstractInterface, that contains the second signal with the int signature.

On closing a wallet, both signals get emitted:

signal time=1594906367.214555 sender=:1.79 -> destination=(null destination) serial=16981 path=/modules/kwalletd5; interface=org.kde.KWallet; member=walletClosed
   int32 1765833520
signal time=1594906367.214570 sender=:1.79 -> destination=(null destination) serial=16982 path=/modules/kwalletd5; interface=org.kde.KWallet; member=walletClosed
   string "kdewallet"

Nevertheless, the instanceof-Code in the SignalHandler does identify both signals of the same type / instanceof KWallet, which is incorrect. One should be instanceof AbstractInterface.

Looking through your code I could not find out what's wrong. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions