diff --git a/README.md b/README.md index 9819456b..754cbf12 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,8 @@ The library will remain open source and MIT licensed and can still be used, fork - Virtual-Threads can be enabled/disabled for each of the different executor services used in `ReceivingService`: `SIGNAL`, `ERROR`, `METHODCALL`, `METHODRETURN` - default remains native threads on all executors - Fixed possible NullPointerException in SASL auth ([#294](https://github.com/hypfvieh/dbus-java/issues/294)) - - Fixed SASL authentication issue when running in server mode in combination with unix sockets ([#298](https://github.com/hypfvieh/dbus-java/issues/298)) + - Fixed SASL authentication issue when running in server mode in combination with unix sockets ([#298](https://github.com/hypfvieh/dbus-java/issues/298)) + - Fixed various issues with `InterfaceCodeGenerator` ([#302](https://github.com/hypfvieh/dbus-java/issues/302), [#303](https://github.com/hypfvieh/dbus-java/issues/303), [#304], (https://github.com/hypfvieh/dbus-java/issues/304), [#306](https://github.com/hypfvieh/dbus-java/issues/306) ##### Changes in 5.2.0 (2025-12-21): - removed properties from dbus-java.version which causes issues with reproducable builds ([PR#279](https://github.com/hypfvieh/dbus-java/issues/279)) diff --git a/dbus-java-utils/src/main/java/org/freedesktop/dbus/utils/generator/ClassBuilderInfo.java b/dbus-java-utils/src/main/java/org/freedesktop/dbus/utils/generator/ClassBuilderInfo.java index 2b4bd48a..7834e122 100644 --- a/dbus-java-utils/src/main/java/org/freedesktop/dbus/utils/generator/ClassBuilderInfo.java +++ b/dbus-java-utils/src/main/java/org/freedesktop/dbus/utils/generator/ClassBuilderInfo.java @@ -476,7 +476,7 @@ public String toString() { } private String handleArg(Object _value) { - if (_value instanceof String s) { + if (_value instanceof String s && !s.endsWith(".class")) { return "\"" + s + "\""; } else { return String.valueOf(_value); diff --git a/dbus-java-utils/src/test/java/org/freedesktop/dbus/utils/generator/InterfaceCodeGeneratorTest.java b/dbus-java-utils/src/test/java/org/freedesktop/dbus/utils/generator/InterfaceCodeGeneratorTest.java index 5d592fb8..72bdacdc 100644 --- a/dbus-java-utils/src/test/java/org/freedesktop/dbus/utils/generator/InterfaceCodeGeneratorTest.java +++ b/dbus-java-utils/src/test/java/org/freedesktop/dbus/utils/generator/InterfaceCodeGeneratorTest.java @@ -130,6 +130,20 @@ void testHandleStructSignals() throws Exception { } + @Test + void testIssue306() throws Exception { + InterfaceCodeGenerator ci2 = loadDBusXmlFile(true, + new File("src/test/resources/CreateInterface/xdg-desktop/org.freedesktop.impl.portal.Notification.xml"), + "/", "org.freedesktop.impl.portal.Notification"); + Map analyze = ci2.analyze(true); + + assertEquals(1, analyze.size()); + + String clzContent = analyze.get(analyze.keySet().iterator().next()); + + assertTrue(clzContent.contains("@DBusBoundProperty(type = PropertySupportedOptionsType.class)")); + } + @Test void testCreateSampleStructArgs() throws Exception { InterfaceCodeGenerator ci2 = loadDBusXmlFile( diff --git a/dbus-java-utils/src/test/resources/CreateInterface/xdg-desktop/org.freedesktop.impl.portal.Notification.xml b/dbus-java-utils/src/test/resources/CreateInterface/xdg-desktop/org.freedesktop.impl.portal.Notification.xml new file mode 100644 index 00000000..a26fa68d --- /dev/null +++ b/dbus-java-utils/src/test/resources/CreateInterface/xdg-desktop/org.freedesktop.impl.portal.Notification.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +