configcat / java-sdk

ConfigCat SDK for Java. ConfigCat is a hosted feature flag service: https://configcat.com. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.
https://configcat.com/docs/sdk-reference/java
MIT License
20 stars 6 forks source link

Settings Class is only Package Public #24

Closed MarwinMoellers closed 1 year ago

MarwinMoellers commented 1 year ago

If you're not sure whether your problem is specifically related to this repository, or to the ConfigCat service overall, please contact the ConfigCat support. This issue tracker is intended only for feedback on the content of this repository.

Describe the bug

When trying to use the onConfigChanged callback, the Settings class is not available.

To reproduce

Use this code options.hooks().addOnConfigChanged(stringSettingMap -> stringSettingMap.get("bla")); or this client.getHooks().addOnConfigChanged((stringSettingMap) -> stringSettingsMap.get("bla")); The Compiler failes with: 'com.configcat.Setting' is not public in 'com.configcat'. Cannot be accessed from outside package

Expected behavior

On Config Changed can be used.

Screenshots

Bildschirm­foto 2023-03-07 um 15 49 23

SDK version

8.0.2

SDK configuration

onfigCatClient.get(this.configCatApiKey, (options -> { options.pollingMode(PollingModes.autoPoll(10)); options.hooks().addOnConfigChanged(stringSettingMap -> stringSettingMap.get("bla")); }));

Logs

If applicable, add the related SDK's log output here.

Language/Framework version

Java-SDK

Platform

macOS Ventura

z4kn4fein commented 1 year ago

Hi @MarwinMoellers , thank you for reporting! I've opened a new PR that fixes the issue. I'll let you know when it's released. Thanks again!

z4kn4fein commented 1 year ago

I've released the fix in v8.1.0, let me know if something doesn't work. (It will probably take some time for the pkg to be available on maven central)