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
{{ message }}
Repository navigation
ClassBuilderInfo sometimes generates invalid imports for classes in the same package #264
In method org.freedesktop.dbus.utils.generator.ClassBuilderInfo#createClassFileContent(boolean, java.util.Set<java.lang.String>), the call to org.freedesktop.dbus.utils.generator.ClassBuilderInfo#getImports returns a set that contains PresetUnitFilesWithModeChangesStruct. Notice that it does not have it's package name. The import should be org.freedesktop.systemd1.PresetUnitFilesWithModeChangesStruct, which would cause the code at org/freedesktop/dbus/utils/generator/ClassBuilderInfo.java:298
... to not filter out PresetUnitFilesWithModeChangesStruct despite it's actual generated class being in the same package.
So it seems like the root issue is that getImports().add(...) (or addAll()) is called at some point with a class name that has it's package name removed.
changed the title [-]ClassBuilderInfo sometimes generates imports for classes in the same package[/-][+]ClassBuilderInfo sometimes generates invalid imports for classes in the same package[/+]on Aug 20, 2024
Can you please add for which systemd path you try to create the classes for? I would like to investigate and fix this, but with about 200 possible pathes it is pointless to start.
So just the classname was remaining. Because this class and the class using it are in the same package, the whole import can be skipped. Therefore removing imports without any packages should fix it.
Activity
[-]ClassBuilderInfo sometimes generates imports for classes in the same package[/-][+]ClassBuilderInfo sometimes generates invalid imports for classes in the same package[/+]hypfvieh commentedon Aug 22, 2024
Can you please add for which systemd path you try to create the classes for? I would like to investigate and fix this, but with about 200 possible pathes it is pointless to start.
Issue #264: Skip imports of classes in same package
hypfvieh commentedon Aug 25, 2024
This should be fixed now.
The issue was, that the package name was removed by
So just the classname was remaining. Because this class and the class using it are in the same package, the whole import can be skipped. Therefore removing imports without any packages should fix it.
ritzow commentedon Aug 25, 2024
Thank you!