Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated Java-API in Bootstrapping Documentation #942

Open
nils-christian opened this issue Oct 9, 2024 · 2 comments
Open

Deprecated Java-API in Bootstrapping Documentation #942

nils-christian opened this issue Oct 9, 2024 · 2 comments

Comments

@nils-christian
Copy link

Hi,

I noticed the usage of a deprecated Java API in the documentation.

Which documentation is missing/incorrect?

In the bootstrapping documentation you show how to initialize the engine.

final FeelEngine engine = new FeelEngine.Builder()
            .valueMapper(SpiServiceLoader.loadValueMapper())
            .functionProvider(SpiServiceLoader.loadFunctionProvider())
            .build();

The Builder class is deprecated. Instead something like the following has to be used

final FeelEngine engine = new FeelEngine( SpiServiceLoader.loadFunctionProvider( ), SpiServiceLoader.loadValueMapper( ), new FeelEngine.Configuration( false ), null );

or

final FeelEngine engine = new FeelEngine( SpiServiceLoader.loadFunctionProvider( ), SpiServiceLoader.loadValueMapper( ), FeelEngine$.MODULE$.defaultConfiguration( ), FeelEngine$.MODULE$.defaultClock( ) );

The second code is a very weird notation for a Java developer though.

Link to the documentation:

Best regards

Nils

@nils-christian
Copy link
Author

Sorry for the additional comment, but I just noticed that a lot of methods are deprecated in the feel engine. It seems that instead the FeelEngineApi should be used. Please correct this in the documentation.

@saig0
Copy link
Member

saig0 commented Oct 10, 2024

@nils-christian you're right. The developer guide is outdated. 🙈

For Java, you should use:

FeelEngineApi feelEngine = FeelEngineBuilder.create().build();

// or especially for Java code:
FeelEngineApi feelEngine = FeelEngineBuilder.forJava().build();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants