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

CreateInterface for firewalld Creates Class / Package Name clash #35

Closed
sshort opened this issue Dec 19, 2018 · 6 comments
Closed

CreateInterface for firewalld Creates Class / Package Name clash #35

sshort opened this issue Dec 19, 2018 · 6 comments

Comments

@sshort
Copy link
Contributor

sshort commented Dec 19, 2018

Running CreateInterface to create code for the object path '/org/fedoraproject/FirewallD1` creates
a Java class org.fedoraproject.FirewallD1.java whose name is the same as a java package, so the code
does not compile.

Also: the imports for DBusInterface and DBusSignal need to reflect the new package locations for these.

@hypfvieh
Copy link
Owner

Could you provide the introspection xml generated by DBus?

I don't use Fedora/firewalld and I've started a re-write of the CreateInterface tool and some more test data would be helpful.

@sshort
Copy link
Contributor Author

sshort commented Dec 20, 2018

Attached. If it helps I'm using firewalld on Mint for this.

firewalld_dbus_xml.zip

@sshort
Copy link
Contributor Author

sshort commented Dec 20, 2018

I've identified a problem I introduced. Because the Structs can now be in a package, the import for that package needs to be added to the generated interface class. For some interfaces/paths, the Struct definition has not yet been created, so the 'import xxx' statement cannot be written. I think that means that code generation needs to be a 2 pass process, but I am still trying to think of alternatives.

@sshort
Copy link
Contributor Author

sshort commented Dec 20, 2018

Fix offered in #36

@hypfvieh
Copy link
Owner

I have added a new branch with a completely rewritten version of the interface creation tool.
If you could take a look, that would be great.

The branch name is 'interface-tool', the class you have to run is org.freedesktop.dbus.utils.generator.InterfaceCodeGenerator

Please note that this tool is not done yet. It still lacks support for multi-value return and may have some serious bugs.
I only tested it with a few DBus services and with some of your provided introspection XMLs.

If you find bugs and want to provide a fix for that, you are always welcome.

@hypfvieh
Copy link
Owner

The new InterfaceCodeGenerator is now part of the latest release.
I'll close this bug report, please open a new one if you find bugs in the new implementation.

The old tool is still available, but deprecated.

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