sftwnd opened a new pull request, #1315: URL: https://github.com/apache/curator/pull/1315
Since #1262, `PersistentWatcher` casts the client to `CuratorFrameworkBase` to reach the underlying client, because `NamespaceFacade` does not support `getCuratorListenable()`. As a result, `PersistentWatcher` and `CuratorCache` fail with `ClassCastException` for any other `CuratorFramework` implementation, for example a decorator of the public interface. This worked in 5.8.0. This change uses the underlying client only for `CuratorFrameworkBase` instances, so namespaced facades keep working (#1259). For any other implementation it falls back to the public `getCuratorListenable()`. Both `start()` and `close()` are covered; the cast in `close()` was added by #1293. Two tests are added to `TestPersistentWatcher`. They use a `java.lang.reflect.Proxy`-based delegating client and cover: - watch events; - the `Closed` notification; - de-registration of listeners on close. Both tests fail on master with `ClassCastException` and pass with the fix. `TestPersistentWatcher`, `TestCuratorCache*` and `spotless:check` pass locally on JDK 21. Fixes #1314. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
