hypfvieh / dbus-java

Improved version of java DBus library provided by freedesktop.org (https://dbus.freedesktop.org/doc/dbus-java/)
https://hypfvieh.github.io/dbus-java/
MIT License
185 stars 73 forks source link

Generation creates uncompilable code for complex types with primitives #170

Closed Urist-McGit closed 2 years ago

Urist-McGit commented 2 years ago

The code generation fails when using a more complex data structure in the interface. The most simple example interface is this:

<interface name="org.example">
  <method name="ExampleMethod">
    <arg type="(ai)" name="exampleArg"/>
  </method>
</interface>

This creates uncompilable code. The cause is that the generated code contains type arguments that are primitives, in the above case int instead of Integer. This replacement works when the arguments are not in a struct, so e.g. ai as argument type above would work. I looked into the code and it seems like the recursive creation of struct members does not take care of the replacement of primitives in type arguments.