Skip to content

Commit

Permalink
Issue #240: Do not allow exporting of default, bridge or synthetic me…
Browse files Browse the repository at this point in the history
…thods
  • Loading branch information
hypfvieh committed Oct 23, 2023
1 parent 927bc8e commit aeaad83
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ The library will remain open source and MIT licensed and can still be used, fork
- Updated export-object documentation ([#236](https://github.com/hypfvieh/dbus-java/issues/236))
- Fixed issues with autoConnect option, added method to register to bus by 'Hello' message manually, thanks to [brett-smith](https://github.com/brett-smith) ([#238](https://github.com/hypfvieh/dbus-java/issues/238))
- Added feature which allows to annotate setter or getter methods in exported objects to use the DBus Properties interface behind the scenes, thanks to [brett-smith](https://github.com/brett-smith) ([PR#235](https://github.com/hypfvieh/dbus-java/issues/235))
- `ExportedObject.isExcluded(Method)` now returns true for bridge, default and synthetic methods, reported by [brett-smith](https://github.com/brett-smith) ([#240](https://github.com/hypfvieh/dbus-java/issues/240))

##### Changes in 4.3.1 (2023-10-03):
- Provide classloader to ServiceLoader in TransportBuilder (for loading actual transports) and AbstractTransport (for loading IMessageReader/Writer implementations), thanks to [cthbleachbit](https://github.com/cthbleachbit) ([#210](https://github.com/hypfvieh/dbus-java/issues/210), [PR#211](https://github.com/hypfvieh/dbus-java/issues/211))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,11 @@ public String getIntrospectiondata() {
}

public static boolean isExcluded(Method _meth) {
return !Modifier.isPublic(_meth.getModifiers())
return _meth == null
|| !Modifier.isPublic(_meth.getModifiers())
|| _meth.isSynthetic() // method created by compiler
|| _meth.isDefault() // method with default implementation (in interfaces), won't work anyway
|| _meth.isBridge() // bridge method created by compiler
|| _meth.getAnnotation(DBusIgnore.class) != null
|| _meth.getAnnotation(DBusBoundProperty.class) != null
|| _meth.getName().equals("getObjectPath") && _meth.getReturnType().equals(String.class)
Expand Down

0 comments on commit aeaad83

Please sign in to comment.